Explorar o código

preserve highlighted text when formatting the page

Former-commit-id: ed3bc2ab5f646dbad5045b1798f6aa48752cb817
Gildas %!s(int64=6) %!d(string=hai) anos
pai
achega
b244503db1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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");