Skip to content

Commit

Permalink
bug fix, highlight not applying to initial content
Browse files Browse the repository at this point in the history
  • Loading branch information
nartix committed Mar 24, 2024
1 parent 98608f0 commit fc7e261
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nartix/tiptap-inline-code-highlight",
"version": "1.0.7",
"version": "1.0.8",
"description": "Inline code highlight extension for Tiptap editor.",
"main": "src/index.js",
"scripts": {
Expand Down
9 changes: 6 additions & 3 deletions src/code-inline-lowlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ export const CodeInlineLowlight = Extension.create({
new Plugin({
key: pluginKey,
state: {
init(_, { doc }) {
return DecorationSet.empty;
},
init: (_, { doc }) =>
getDecorations({
doc: doc,
name: CODE_MARK_TYPE,
lowlight: this.options.lowlight,
}),
apply: (tr, set, oldState, newState) => {
const oldMarks = findInlineCode(oldState.doc, CODE_MARK_TYPE);
const newMarks = findInlineCode(newState.doc, CODE_MARK_TYPE);
Expand Down

0 comments on commit fc7e261

Please sign in to comment.