0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-06-28 16:58:40 +00:00
This commit is contained in:
Víctor Losada Hernández
2026-04-24 12:42:14 +02:00
parent 0587266e22
commit fac3ef15fa
+4 -4
View File
@@ -53,7 +53,7 @@ function getUrl(node, doc) {
if(cursor.firstChild()) {
do {
if (cursor.name === "URL") {
if(cursor.name === 'URL') {
url = doc.sliceString(cursor.from, cursor.to);
break;
}
@@ -94,16 +94,16 @@ const createHighlightPlugin = (renderer, tab)=>{
const tree = syntaxTree(view.state);
tree.iterate({
enter : (node)=>{
if (node.name === "Image") {
if(node.name === 'Image') {
const url = getUrl(node, view.state.doc);
if(!url) return;
decos.push(
Decoration.mark({
class: "cm-image",
class : 'cm-image',
attributes : {
"style": `--preview-img:url(${url});`
'style' : `--preview-img:url(${url});`
}
}).range(node.from, node.to)
);