Skip to content

Commit 850671f

Browse files
hsk81marijnh
authored andcommitted
Fix duplicate cm- prefix in overlay styling
Ensure that when an overlay is added that the class `cm-overlay` is used to denote a `span` instead of `cm-cm-overlay` (with the `cm-` prefix repeated twice). * E.g. before fix: ``` <span class="cm-cm-overlay cm-spell-error">zpelling</span> ``` * And after fix: ``` <span class="cm-overlay cm-spell-error">zpelling</span> ```
1 parent 96cd888 commit 850671f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/line/highlight.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ export function highlightLine(cm, line, state, forceToEnd) {
3232
}
3333
if (!style) return
3434
if (overlay.opaque) {
35-
st.splice(start, i - start, end, "cm-overlay " + style)
35+
st.splice(start, i - start, end, "overlay " + style)
3636
i = start + 2
3737
} else {
3838
for (; start < i; start += 2) {
3939
let cur = st[start+1]
40-
st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style
40+
st[start+1] = (cur ? cur + " " : "") + "overlay " + style
4141
}
4242
}
4343
}, lineClasses)

0 commit comments

Comments
 (0)