Skip to content

Commit

Permalink
Revert "Assign ID to headers with CustomHTMLRenderer (dullage#84)"
Browse files Browse the repository at this point in the history
This reverts commit 26e6b56.
  • Loading branch information
Gedulis12 committed Aug 7, 2023
1 parent e52378c commit 7187e4e
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions flatnotes/src/components/NoteViewerEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -211,7 +190,6 @@ export default {
},
data: function () {
return {
editMode: false,
draftSaveTimeout: null,
Expand All @@ -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] },
};
},
Expand Down

0 comments on commit 7187e4e

Please sign in to comment.