You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Desktop: Keep comments when rendering Markdown to allow rendered note metadata (#11530)
This commit is contained in:
1
packages/app-cli/tests/md_to_html/sanitize_21.html
Normal file
1
packages/app-cli/tests/md_to_html/sanitize_21.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Should keep this comment: <!-- keep this & that -->
|
||||||
1
packages/app-cli/tests/md_to_html/sanitize_21.md
Normal file
1
packages/app-cli/tests/md_to_html/sanitize_21.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Should keep this comment: <!-- keep this & that -->
|
||||||
@@ -260,6 +260,10 @@ class HtmlUtils {
|
|||||||
|
|
||||||
const parser = new htmlparser2.Parser({
|
const parser = new htmlparser2.Parser({
|
||||||
|
|
||||||
|
oncomment: (encodedData: string) => {
|
||||||
|
output.push(`<!--${encodedData}-->`);
|
||||||
|
},
|
||||||
|
|
||||||
onopentag: (name: string, attrs: Record<string, string>) => {
|
onopentag: (name: string, attrs: Record<string, string>) => {
|
||||||
// Note: "name" and attribute names are always lowercase even
|
// Note: "name" and attribute names are always lowercase even
|
||||||
// when the input is not. So there is no need to call
|
// when the input is not. So there is no need to call
|
||||||
|
|||||||
Reference in New Issue
Block a user