1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop, Mobile: Fixes #5687: Fixed issue with parts of HTML notes not being displayed in some cases

This commit is contained in:
Laurent Cozic
2021-11-09 18:33:28 +00:00
parent f8d9601ff7
commit 4deeed0d5c
7 changed files with 27 additions and 3 deletions

View File

@@ -192,6 +192,15 @@ class HtmlUtils {
}
}
// For some reason, entire parts of HTML notes don't show up in
// the viewer when there's an anchor tag without an "href"
// attribute. It doesn't always happen and it seems to depend on
// what else is in the note but in any case adding the "href"
// fixes it. https://github.com/laurent22/joplin/issues/5687
if (name.toLowerCase() === 'a' && !attrs['href']) {
attrs['href'] = '#';
}
let attrHtml = this.attributesHtml(attrs);
if (attrHtml) attrHtml = ` ${attrHtml}`;
const closingSign = this.isSelfClosingTag(name) ? '/>' : '>';