From 7187e4ec47a67cfedaf9578dd2c3b247ab782154 Mon Sep 17 00:00:00 2001 From: Gedulis12 <80179975+Gedulis12@users.noreply.github.com> Date: Mon, 7 Aug 2023 21:38:06 +0300 Subject: [PATCH] Revert "Assign ID to headers with CustomHTMLRenderer (#84)" This reverts commit 26e6b5657a4cce34e743c1d1249b08b5e27d9362. --- flatnotes/src/components/NoteViewerEditor.vue | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/flatnotes/src/components/NoteViewerEditor.vue b/flatnotes/src/components/NoteViewerEditor.vue index f3225d7..b1a42e4 100644 --- a/flatnotes/src/components/NoteViewerEditor.vue +++ b/flatnotes/src/components/NoteViewerEditor.vue @@ -178,27 +178,6 @@ import { Viewer } from "@toast-ui/vue-editor"; import api from "../api"; import codeSyntaxHighlight from "@toast-ui/editor-plugin-code-syntax-highlight/dist/toastui-editor-plugin-code-syntax-highlight-all.js"; -const customHTMLRenderer = { - heading( node, { entering, getChildrenText } ) { - const tagName = `h${node.level}`; - - if (entering) { - return { - type: 'openTag', - tagName, - attributes: { - id: getChildrenText(node) - .toLowerCase() - .replace(/[^a-z0-9-\s]*/g, '') - .trim() - .replace(/\s/g, '-') - } - }; - } - return { type: 'closeTag', tagName }; - } -}; - export default { components: { Viewer, @@ -211,7 +190,6 @@ export default { }, data: function () { - return { editMode: false, draftSaveTimeout: null, @@ -222,13 +200,10 @@ export default { noteLoadFailedIcon: null, noteLoadFailedMessage: "Failed to load Note", viewerOptions: { - customHTMLRenderer: customHTMLRenderer, plugins: [codeSyntaxHighlight], extendedAutolinks: true, }, - editorOptions: { - customHTMLRenderer: customHTMLRenderer, - plugins: [codeSyntaxHighlight] }, + editorOptions: { plugins: [codeSyntaxHighlight] }, }; },