Browse Source

preserve highlighted text when formatting the page

Former-commit-id: ed3bc2ab5f646dbad5045b1798f6aa48752cb817
Gildas 6 years ago
parent
commit
b244503db1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      extension/ui/content/content-ui-editor-web.js

+ 1 - 1
extension/ui/content/content-ui-editor-web.js

@@ -876,7 +876,7 @@ table {
 		}
 		if (message.method == "formatPage") {
 			document.querySelectorAll(NOTE_TAGNAME).forEach(containerElement => containerElement.remove());
-			const article = new Readability(document).parse();
+			const article = new Readability(document, { classesToPreserve: ["single-file-highlight", "single-file-highlight-yellow", "single-file-highlight-green", "single-file-highlight-pink", "single-file-highlight-blue"] }).parse();
 			document.body.innerHTML = "";
 			const domParser = new DOMParser();
 			const doc = domParser.parseFromString(article.content, "text/html");