Skip to content

Commit

Permalink
minor, removed unused var from testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nartix committed Mar 24, 2024
1 parent cab7273 commit 7376270
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ npm install @nartix/tiptap-inline-code-highlight
```

```javascript
import { CodeInlineLowlight } from '@nartix/tiptap-inline-code-highlight';
import CodeInlineLowlight from '@nartix/tiptap-inline-code-highlight';

const editor = Editor({
extensions: [
Expand Down
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.4",
"version": "1.0.5",
"description": "Inline code highlight extension for Tiptap editor.",
"main": "src/index.js",
"scripts": {
Expand Down
9 changes: 3 additions & 6 deletions src/code-inline-lowlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function getDecorations({ doc, name, lowlight }) {

findInlineCode(doc, name).forEach((block) => {
let from = block.from;
const to = block.to;

const nodes = getHighlightNodes(lowlight.highlightAuto(block.text));

Expand Down Expand Up @@ -60,7 +59,7 @@ function findInlineCode(doc, markType) {
from: pos,
to: pos + node.nodeSize,
text: node.text,
node: mark,
// node: mark,
});
}
});
Expand All @@ -78,15 +77,14 @@ export const CodeInlineLowlight = Extension.create({
addOptions() {
return {
lowlight: {},
defaultLanguage: null,
};
},

addProseMirrorPlugins() {
if (!['highlight', 'highlightAuto', 'listLanguages'].every((api) => isFunction(this.options.lowlight[api]))) {
throw Error('You should provide an instance of lowlight to use the tiptap-code-inline-highlight extension');
throw Error('You should provide an instance of lowlight to use the @nartix/tiptap-code-inline-highlight extension');
}
const pluginKey = new PluginKey('codeInlineLowlight');
const pluginKey = new PluginKey(this.name);
return [
new Plugin({
key: pluginKey,
Expand Down Expand Up @@ -117,7 +115,6 @@ export const CodeInlineLowlight = Extension.create({
lowlight: this.options.lowlight,
});
}

return set.map(tr.mapping, tr.doc);
},
},
Expand Down

0 comments on commit 7376270

Please sign in to comment.