Skip to content

Commit

Permalink
fix: Fixed a bug of parsing slides (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
shd101wyy authored Oct 9, 2023
1 parent f4c9c12 commit c906f48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Please visit https://github.com/shd101wyy/vscode-markdown-preview-enhanced/relea

## [Unreleased]

## [0.8.21] - 2023-10-09

### Bug fixes

- Fixed a bug of rendering front-matter that caused the failure of rendering slides: https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues/1814

## [0.8.20] - 2023-10-09

### New features
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crossnote",
"version": "0.8.20",
"version": "0.8.21",
"description": "A powerful markdown notebook tool",
"keywords": [
"markdown"
Expand Down
8 changes: 7 additions & 1 deletion src/markdown-engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2607,7 +2607,13 @@ sidebarTOCBtn.addEventListener('click', function(event) {
// enhanceWithEmojiToSvg($);
// }

html = frontMatterTable + $('head').html() + $('body').html(); // cheerio $.html() will add <html><head></head><body>$html</body></html>, so we hack it by select body first.
html =
frontMatterTable +
// NOTE: '\n' is necessary here. Otherwise, it might generate html like '</table><p data-source-line="12">[CROSSNOTESLIDE]</p>'
// and we will fail to parse for slides, which splits by `^<p...>[CROSSNOTESLIDE]</p>`.
'\n' +
$('head').html() +
$('body').html(); // cheerio $.html() will add <html><head></head><body>$html</body></html>, so we hack it by select body first.

/**
* check slides
Expand Down

0 comments on commit c906f48

Please sign in to comment.