@mirus/tiptap-editor 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tiptap-editor.mjs +1 -1
- package/package.json +1 -1
- package/src/App.vue +2 -2
- package/src/warnings.js +1 -1
package/dist/tiptap-editor.mjs
CHANGED
|
@@ -21973,7 +21973,7 @@ function Cw(t, e, n, r, i) {
|
|
|
21973
21973
|
const h = o.filter((y) => y.value === d[0]), m = p + d.index;
|
|
21974
21974
|
let v = !1;
|
|
21975
21975
|
h.forEach((y) => {
|
|
21976
|
-
y.
|
|
21976
|
+
y.length && y.offset >= 0 && (v = !0, m - 1 === y.offset && u(m, m + d[0].length, d[0]));
|
|
21977
21977
|
}), v || u(m, m + d[0].length, d[0]);
|
|
21978
21978
|
}
|
|
21979
21979
|
}
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
value: 'red',
|
|
28
28
|
message: 'did you mean...',
|
|
29
29
|
options: ['read', 'reed'], // optional
|
|
30
|
-
offset:
|
|
30
|
+
offset: 54, // identifies which instance of the word is problematic
|
|
31
31
|
length: 3, // length of the word
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
isWord: false,
|
|
41
41
|
message: 'you sure you wanted a tag?',
|
|
42
42
|
overrideClass: 'underline-blue', // optional
|
|
43
|
-
offset:
|
|
43
|
+
offset: 9,
|
|
44
44
|
length: 8,
|
|
45
45
|
},
|
|
46
46
|
{
|
package/src/warnings.js
CHANGED
|
@@ -68,7 +68,7 @@ function lint(doc, position, prev, getErrorWords, getInitialCharacterCount) {
|
|
|
68
68
|
const indexOfMatchedWord = pos + m.index;
|
|
69
69
|
let errorHasOffsetData = false;
|
|
70
70
|
matchingErrorWords.forEach((word) => {
|
|
71
|
-
if (word.
|
|
71
|
+
if (word.length && word.offset >= 0) {
|
|
72
72
|
errorHasOffsetData = true;
|
|
73
73
|
if (indexOfMatchedWord - 1 === word.offset) {
|
|
74
74
|
record(indexOfMatchedWord, indexOfMatchedWord + m[0].length, m[0]);
|