Skip to content

Commit

Permalink
0.9.4 (#338)
Browse files Browse the repository at this point in the history
* fix: Fixed a bug of importing file that contains empty header

* fix: Removed onWillTransformMarkdown and onDidTransformMarkdown

* fix: Fixed a bug of parsing image syntax

* feat: Updated to fontawesome 6

* fix: Fixed a bug of parsing inline code

* feat: Updated wavedrom to 3.3.0

* feat: Supported to export element as png

* refactor: Removed unnecessary console.log

* fix: Disabled png export for vscode web extension

* fix: Fixed checking isVSCodeWebExtension
  • Loading branch information
shd101wyy authored Oct 21, 2023
1 parent 377c174 commit 9afc685
Show file tree
Hide file tree
Showing 38 changed files with 3,055 additions and 3,588 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,48 @@ Please visit https://github.com/shd101wyy/vscode-markdown-preview-enhanced/relea

## [Unreleased]

## [0.9.4] - 2023-10-21

### New features

- Updated [fontawesome](https://fontawesome.com/) from version 4.7 to version 6.4.2 (Free).
A list of available icons can be found at: https://kapeli.com/cheat_sheets/Font_Awesome.docset/Contents/Resources/Documents/index
- Updated WaveDrom to the latest version 3.3.0.

### Changes

- Changed the markdown parser process to be like below. We removed the `onWillTransformMarkdown` and `onDidTransformMarkdown` hooks as these two caused the confusion.

```markdown
markdown
`onWillParseMarkdown(markdown)`
markdown
**crossnote markdown transformer**
markdown
**markdown-it or pandoc renderer**
html
`onDidParseMarkdown(html)`
html, and then rendered in the preview
```

- (Beta) Supported to export the selected element in preview to .png file and copy the blob to the clipboard:

![image](https://github.com/shd101wyy/vscode-markdown-preview-enhanced/assets/1908863/046759d8-6d89-4f41-8420-b863d2094fe7)

### Bug fixes

- Fixed a bug of importing files that contains empty heading: https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues/1840
- Fixed a bug of rendering inline math in image name: https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues/1846
- Fixed a bug of parsing inline code: https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues/1848

## [0.9.3] - 2023-10-15

### Bug fixes
Expand Down
5 changes: 3 additions & 2 deletions dependencies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ I managed some of the libraries by myself instead of through npm to reduce the o

```json
{
"font-awesome": "4.7",
"font-awesome": "6.4.2", // Download from here: https://fontawesome.com/download
// Fontawesome cheatsheet is available here: https://kapeli.com/cheat_sheets/Font_Awesome.docset/Contents/Resources/Documents/index
"katex": "v0.16.9", // Only keep the css and fonts files.
"mermaid": "10.5.0", // https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
"reveal": "4.6.0",
Expand All @@ -16,7 +17,7 @@ I managed some of the libraries by myself instead of through npm to reduce the o
"vega-lite": "5.16.1", // https://cdn.jsdelivr.net/npm/[email protected]/build/vega-lite.min.js
"vega": "5.25.0", // https://cdn.jsdelivr.net/npm/[email protected]/build/vega.min.js

"wavedrom": "2.9.1"
"wavedrom": "3.3.0" // - https://cdn.jsdelivr.net/npm/[email protected]/wavedrom.min.js
}
```

Expand Down
9 changes: 9 additions & 0 deletions dependencies/font-awesome/css/all.min.css

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions dependencies/font-awesome/css/font-awesome.min.css

This file was deleted.

Binary file removed dependencies/font-awesome/fonts/FontAwesome.otf
Binary file not shown.
Binary file not shown.
2,671 changes: 0 additions & 2,671 deletions dependencies/font-awesome/fonts/fontawesome-webfont.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
3 changes: 3 additions & 0 deletions dependencies/wavedrom/skins/narrow.js

Large diffs are not rendered by default.

16 changes: 2 additions & 14 deletions dependencies/wavedrom/wavedrom.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crossnote",
"version": "0.9.3",
"version": "0.9.4",
"description": "A powerful markdown notebook tool",
"keywords": [
"markdown"
Expand Down Expand Up @@ -75,8 +75,10 @@
"daisyui": "^3.7.3",
"esbuild-plugin-tailwindcss": "^1.1.1",
"escape-string-regexp": "^5.0.0",
"file-saver": "^2.0.5",
"html-escaper": "^3.0.3",
"html-react-parser": "^4.2.2",
"html-to-image": "^1.11.11",
"imagemagick-cli": "^0.5.0",
"jquery": "^3.7.1",
"katex": "^0.16.9",
Expand Down Expand Up @@ -123,6 +125,7 @@
"@simbathesailor/use-what-changed": "^2.0.0",
"@types/cheerio": "0.22.11",
"@types/crypto-js": "^4.1.1",
"@types/file-saver": "^2.0.6",
"@types/html-escaper": "^3.0.0",
"@types/jest": "^29.5.5",
"@types/jquery": "^3.3.29",
Expand Down
8 changes: 2 additions & 6 deletions src/converters/markdown-convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ export async function markdownConvert(

const useRelativeFilePath = !config['absolute_image_path'];

if (notebook.config.parserConfig.onWillTransformMarkdown) {
text = await notebook.config.parserConfig.onWillTransformMarkdown(text);
if (notebook.config.parserConfig.onWillParseMarkdown) {
text = await notebook.config.parserConfig.onWillParseMarkdown(text);
}

// import external files
Expand All @@ -247,10 +247,6 @@ export async function markdownConvert(

text = data.outputString;

if (notebook.config.parserConfig.onDidTransformMarkdown) {
text = await notebook.config.parserConfig.onDidTransformMarkdown(text);
}

// replace [CROSSNOTETOC]
const tocBracketEnabled = data.tocBracketEnabled;
if (tocBracketEnabled) {
Expand Down
8 changes: 2 additions & 6 deletions src/converters/pandoc-convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ export async function pandocConvert(
// process output config
processOutputConfig(outputConfig || {}, args, notebook.config.latexEngine);

if (notebook.config.parserConfig.onWillTransformMarkdown) {
text = await notebook.config.parserConfig.onWillTransformMarkdown(text);
if (notebook.config.parserConfig.onWillParseMarkdown) {
text = await notebook.config.parserConfig.onWillParseMarkdown(text);
}

// import external files
Expand All @@ -395,10 +395,6 @@ export async function pandocConvert(
});
text = data.outputString;

if (notebook.config.parserConfig.onDidTransformMarkdown) {
text = await notebook.config.parserConfig.onDidTransformMarkdown(text);
}

// add front-matter(yaml) back to text
text = '---\n' + YAML.stringify(config) + '---\n' + text;

Expand Down
Loading

0 comments on commit 9afc685

Please sign in to comment.