Fixes #421
This commit is contained in:
@@ -5,6 +5,7 @@ interface WrapElement {
|
||||
selector: string;
|
||||
class: string;
|
||||
nesting?: boolean;
|
||||
disableSpellCheck?: boolean;
|
||||
}
|
||||
|
||||
export function lineWrapper(wrapElements: WrapElement[]) {
|
||||
@@ -15,6 +16,10 @@ export function lineWrapper(wrapElements: WrapElement[]) {
|
||||
syntaxTree(state).iterate({
|
||||
enter: ({ type, from, to }) => {
|
||||
for (const wrapElement of wrapElements) {
|
||||
const spellCheckAttributes = wrapElement.disableSpellCheck
|
||||
? { attributes: { spellcheck: "false" } }
|
||||
: {};
|
||||
|
||||
if (type.name == wrapElement.selector) {
|
||||
if (wrapElement.nesting) {
|
||||
elementStack.push(type.name);
|
||||
@@ -29,6 +34,7 @@ export function lineWrapper(wrapElements: WrapElement[]) {
|
||||
widgets.push(
|
||||
Decoration.line({
|
||||
class: cls,
|
||||
...spellCheckAttributes,
|
||||
}).range(doc.lineAt(idx).from),
|
||||
);
|
||||
idx += line.length + 1;
|
||||
|
||||
Reference in New Issue
Block a user