mirror of
https://github.com/wekan/wekan.git
synced 2026-03-05 13:20:15 +01:00
Fix Broken Hyperlinks in Markdown to HTML conversion.
Thanks to xet7 ! Fixes #5932
This commit is contained in:
parent
e1902d58c1
commit
973a49526f
4 changed files with 113 additions and 103 deletions
|
|
@ -214,7 +214,7 @@ if (Package.ui) {
|
|||
if (self.templateContentBlock) {
|
||||
text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING);
|
||||
}
|
||||
if (text.includes("[]") !== false) {
|
||||
if (text.includes("[]")) {
|
||||
// Prevent hiding info: https://wekan.github.io/hall-of-fame/invisiblebleed/
|
||||
// If markdown link does not have description, do not render markdown, instead show all of markdown source code using preformatted text.
|
||||
// Also show html comments.
|
||||
|
|
@ -223,7 +223,9 @@ if (Package.ui) {
|
|||
// Prevent hiding info: https://wekan.github.io/hall-of-fame/invisiblebleed/
|
||||
// If text does not have hidden markdown link, render all markdown.
|
||||
// Also show html comments.
|
||||
return HTML.Raw(DOMPurify.sanitize(Markdown.render(text).replace('<!--', '<font color="red" title="Warning! Hidden HTML comment!" aria-label="Warning! Hidden HTML comment!"><!--</font>').replace('-->', '<font color="red" title="Warning! Hidden HTML comment!" aria-label="Warning! Hidden HTML comment!">--></font>'), getSecureDOMPurifyConfig()));
|
||||
const renderedMarkdown = Markdown.render(text).replace('<!--', '<font color="red" title="Warning! Hidden HTML comment!" aria-label="Warning! Hidden HTML comment!"><!--</font>').replace('-->', '<font color="red" title="Warning! Hidden HTML comment!" aria-label="Warning! Hidden HTML comment!">--></font>');
|
||||
const sanitized = DOMPurify.sanitize(renderedMarkdown, getSecureDOMPurifyConfig());
|
||||
return HTML.Raw(sanitized);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue