0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-06-22 04:58:40 +00:00
This commit is contained in:
Víctor Losada Hernández
2026-05-10 19:41:11 +02:00
parent 70d9614fb1
commit aac384390b
+2 -9
View File
@@ -123,13 +123,11 @@ const createHighlightPlugin = (renderer, tab)=>{
tokens.forEach((tok)=>{
const line = view.state.doc.line(tok.line + 1);
// INLINE TOKENS (marks)
if(tok.from != null && tok.to != null && tok.from < tok.to) {
const from = line.from + tok.from;
const to = line.from + tok.to;
const attrs = {};
// attach URL only for links
if(tok.type === 'Image' && tok.url) {
attrs['data-url'] = tok.url;
@@ -143,10 +141,7 @@ const createHighlightPlugin = (renderer, tab)=>{
: {})
}).range(from, to)
);
}
// LINE TOKENS
else {
} else {
decos.push(
Decoration.line({
class : `cm-${tok.type}`
@@ -168,9 +163,7 @@ const createHighlightPlugin = (renderer, tab)=>{
return Decoration.set(decos);
}
},
{
decorations : (v)=>v.decorations
}
{ decorations: (v)=>v.decorations }
);
};