mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-06-25 10:58:39 +00:00
lint
This commit is contained in:
@@ -123,13 +123,11 @@ const createHighlightPlugin = (renderer, tab)=>{
|
|||||||
tokens.forEach((tok)=>{
|
tokens.forEach((tok)=>{
|
||||||
const line = view.state.doc.line(tok.line + 1);
|
const line = view.state.doc.line(tok.line + 1);
|
||||||
|
|
||||||
// INLINE TOKENS (marks)
|
|
||||||
if(tok.from != null && tok.to != null && tok.from < tok.to) {
|
if(tok.from != null && tok.to != null && tok.from < tok.to) {
|
||||||
const from = line.from + tok.from;
|
const from = line.from + tok.from;
|
||||||
const to = line.from + tok.to;
|
const to = line.from + tok.to;
|
||||||
|
|
||||||
const attrs = {};
|
const attrs = {};
|
||||||
// attach URL only for links
|
|
||||||
if(tok.type === 'Image' && tok.url) {
|
if(tok.type === 'Image' && tok.url) {
|
||||||
|
|
||||||
attrs['data-url'] = tok.url;
|
attrs['data-url'] = tok.url;
|
||||||
@@ -143,10 +141,7 @@ const createHighlightPlugin = (renderer, tab)=>{
|
|||||||
: {})
|
: {})
|
||||||
}).range(from, to)
|
}).range(from, to)
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// LINE TOKENS
|
|
||||||
else {
|
|
||||||
decos.push(
|
decos.push(
|
||||||
Decoration.line({
|
Decoration.line({
|
||||||
class : `cm-${tok.type}`
|
class : `cm-${tok.type}`
|
||||||
@@ -168,9 +163,7 @@ const createHighlightPlugin = (renderer, tab)=>{
|
|||||||
return Decoration.set(decos);
|
return Decoration.set(decos);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{ decorations: (v)=>v.decorations }
|
||||||
decorations : (v)=>v.decorations
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user