diff --git a/wiki/patches.txt b/wiki/patches.txt index 6e4124f7..9f6efe34 100644 --- a/wiki/patches.txt +++ b/wiki/patches.txt @@ -7,4 +7,5 @@ wiki.wiki.doctype.wiki_feedback.patches.delete_wiki_feedback_item [post_model_sync] wiki.wiki.doctype.wiki_space.patches.wiki_sidebar_migration wiki.wiki.doctype.wiki_settings.patches.wiki_navbar_item_migration -wiki.wiki.doctype.wiki_page.patches.convert_wiki_content_to_markdown \ No newline at end of file +wiki.wiki.doctype.wiki_page.patches.convert_wiki_content_to_markdown +wiki.wiki.doctype.wiki_page.patches.update_escaped_code_content \ No newline at end of file diff --git a/wiki/public/js/editor.js b/wiki/public/js/editor.js index 00ac72dd..79a7e25c 100644 --- a/wiki/public/js/editor.js +++ b/wiki/public/js/editor.js @@ -61,7 +61,15 @@ function setEditor() { theme: "ace/theme/tomorrow_night", }); editor.renderer.lineHeight = 20; - editor.setValue(markdown_content || "", 1); + frappe.call({ + method: "wiki.wiki.doctype.wiki_page.wiki_page.get_markdown_content", + args: { + wikiPageName, + }, + callback: (r) => { + editor.setValue(r.message || "", 1); + }, + }); wikiTitleInput.val($(".wiki-title").text() || ""); } diff --git a/wiki/public/scss/wiki.scss b/wiki/public/scss/wiki.scss index 4bd1a31d..06c254ad 100644 --- a/wiki/public/scss/wiki.scss +++ b/wiki/public/scss/wiki.scss @@ -40,21 +40,9 @@ body { // ------------------------------------------ - font-family: - InterVariable, - ui-sans-serif, - system-ui, - -apple-system, - BlinkMacSystemFont, - Segoe UI, - Roboto, - Helvetica Neue, - Arial, - Noto Sans, - sans-serif, - "Apple Color Emoji", - "Segoe UI Emoji", - Segoe UI Symbol, + font-family: InterVariable, ui-sans-serif, system-ui, -apple-system, + BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji"; background-color: var(--background-color); @@ -328,10 +316,7 @@ body.dark { &.active { background-color: var(--sidebar-active-item-color); border-radius: 0.625rem; - box-shadow: - 0 0 #0000, - 0 0 #0000, - 0px 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: 0 0 #0000, 0 0 #0000, 0px 1px 2px rgba(0, 0, 0, 0.1); } div { @@ -777,6 +762,7 @@ body.dark { margin-bottom: 1rem; } .wiki-title-input { + color: var(--text-color); background-color: var(--editor-background-color); } } @@ -969,10 +955,7 @@ h6:hover .feather-link { .active { color: var(--text-color); box-shadow: 1px 0 0 var(--primary) inset; - transition: - color 0.2s, - box-shadow 0.2s linear, - transform 0.2s linear; + transition: color 0.2s, box-shadow 0.2s linear, transform 0.2s linear; } a { diff --git a/wiki/wiki/doctype/wiki_page/patches/update_escaped_code_content.py b/wiki/wiki/doctype/wiki_page/patches/update_escaped_code_content.py new file mode 100644 index 00000000..9542ed57 --- /dev/null +++ b/wiki/wiki/doctype/wiki_page/patches/update_escaped_code_content.py @@ -0,0 +1,14 @@ +import frappe + + +def execute(): + wiki_pages = frappe.db.get_all("Wiki Page", fields=["name", "content"]) + for page in wiki_pages: + markdown_content = ( + page["content"] + .replace("`", "`") + .replace("${", "${") + .replace(">", ">") + .replace("<", "<") + ) + frappe.db.set_value("Wiki Page", page["name"], "content", markdown_content) diff --git a/wiki/wiki/doctype/wiki_page/templates/show.html b/wiki/wiki/doctype/wiki_page/templates/show.html index 85ac9162..816a787f 100644 --- a/wiki/wiki/doctype/wiki_page/templates/show.html +++ b/wiki/wiki/doctype/wiki_page/templates/show.html @@ -3,7 +3,7 @@