Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] The {{comment}} is not formatted correctly #161

Open
zhuyinna opened this issue Mar 24, 2023 · 4 comments
Open

[bug] The {{comment}} is not formatted correctly #161

zhuyinna opened this issue Mar 24, 2023 · 4 comments

Comments

@zhuyinna
Copy link

when I set the formmat of {{hightlight}} is "quotation marks", and set the formmat of {{comment}} is "Blockquote", the extracted annotation will like this:
1679631318450
You can find that that {{highlight}} part is correct, but in the {{comment}} part, there's a quotation mark in the beginning. But I didn't set "quotation marks" in the setting.

After checking the source code, I found the bug.

In line 5118~5120 of the main.js, the original code is:

const highlightFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const commentFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const tagFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");

will result that the commentFormatBefore is same as the highlightFormatBefore. So it should changed to:

const highlightFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const commentFormatBeforeColoured = commentFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const tagFormatBeforeColoured = tagFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");

What's more, there are also two little bugs:
(1) in line 4473, highlightColouredBefore = '<mark style="background: SELECTED_COLOUR>';
there lacks a Double quotation marks before ">"
(2) in line 4495, the original code is

const commentFormatBefore = commentHighlighted + commentColouredBefore;
commentBold + commentItalic + commentQuoteOpen;

the sentence was incorrectly wrapped. It should changed to :
const commentFormatBefore = commentHighlighted + commentColouredBefore + commentBold + commentItalic + commentQuoteOpen;

@zhuyinna zhuyinna changed the title There exitsts a bug: the {{comment}} is not formatted correctly [bug]: the {{comment}} is not formatted correctly Mar 24, 2023
@zhuyinna zhuyinna changed the title [bug]: the {{comment}} is not formatted correctly [bug] The {{comment}} is not formatted correctly Mar 24, 2023
@77-arthur
Copy link

你好,请问导出{{comment}}是否需要额外配置?我看默认配置会导出{{comment}},不过我生成的md一直只有{{highlight}}

@zhuyinna
Copy link
Author

你好,请问导出{{comment}}是否需要额外配置?我看默认配置会导出{{comment}},不过我生成的md一直只有{{highlight}}

设置里需要这么改,最后的{{tag}}可以不要,顺序也可以换
image

@77-arthur
Copy link

你好,请问导出{{comment}}是否需要额外配置?我看默认配置会导出{{comment}},不过我生成的md一直只有{{highlight}}

设置里需要这么改,最后的{{tag}}可以不要,顺序也可以换 image

好的谢谢!

@jinzhi666
Copy link

jinzhi666 commented Jul 5, 2023

when I set the formmat of {{hightlight}} is "quotation marks", and set the formmat of {{comment}} is "Blockquote", the extracted annotation will like this: 1679631318450 You can find that that {{highlight}} part is correct, but in the {{comment}} part, there's a quotation mark in the beginning. But I didn't set "quotation marks" in the setting.

After checking the source code, I found the bug.

In line 5118~5120 of the main.js, the original code is:

const highlightFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const commentFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const tagFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");

will result that the commentFormatBefore is same as the highlightFormatBefore. So it should changed to:

const highlightFormatBeforeColoured = highlightFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const commentFormatBeforeColoured = commentFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");
const tagFormatBeforeColoured = tagFormatBefore.replace("SELECTED_COLOUR", lineElements.highlightColour + ";");

What's more, there are also two little bugs: (1) in line 4473, highlightColouredBefore = '<mark style="background: SELECTED_COLOUR>'; there lacks a Double quotation marks before ">" (2) in line 4495, the original code is

const commentFormatBefore = commentHighlighted + commentColouredBefore;
commentBold + commentItalic + commentQuoteOpen;

the sentence was incorrectly wrapped. It should changed to : const commentFormatBefore = commentHighlighted + commentColouredBefore + commentBold + commentItalic + commentQuoteOpen;

你好,我也发现了这些BUG。转换 JSON 文件中的大纲标题 <h1> title1 </h1> 无法转换为 markdown 的 # title1,请问如何解决呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants