mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-06-22 04:58:40 +00:00
lint
This commit is contained in:
@@ -251,13 +251,13 @@ function tokenizeCustomMarkdown(text) {
|
|||||||
);
|
);
|
||||||
if(match) endCh = match.index + match[0].length;
|
if(match) endCh = match.index + match[0].length;
|
||||||
const closingMatch = lineText.match(/ *(}})/d);
|
const closingMatch = lineText.match(/ *(}})/d);
|
||||||
|
|
||||||
if(closingMatch) {
|
if(closingMatch) {
|
||||||
tokens.push({ line: lineNumber, from: closingMatch.indices[1][0], to: closingMatch.indices[1][1], type: customTags.block });
|
tokens.push({ line: lineNumber, from: closingMatch.indices[1][0], to: closingMatch.indices[1][1], type: customTags.block });
|
||||||
} else {
|
} else {
|
||||||
tokens.push({ line: lineNumber, type: customTags.block });
|
tokens.push({ line: lineNumber, type: customTags.block });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -350,10 +350,9 @@ class ImageWidget extends WidgetType {
|
|||||||
|
|
||||||
toDOM() {
|
toDOM() {
|
||||||
const img = document.createElement('img');
|
const img = document.createElement('img');
|
||||||
img.loading = "lazy";
|
img.loading = 'lazy';
|
||||||
img.className = 'cm-preview';
|
img.className = 'cm-preview';
|
||||||
img.src = this.url;
|
img.src = this.url;
|
||||||
|
|
||||||
|
|
||||||
img.onerror = ()=>{
|
img.onerror = ()=>{
|
||||||
img.src = 'client/icons/broken-image.jpg';
|
img.src = 'client/icons/broken-image.jpg';
|
||||||
@@ -403,8 +402,8 @@ export function customHighlightPlugin(renderer, tab) {
|
|||||||
const url = getUrl(node, view.state.doc);
|
const url = getUrl(node, view.state.doc);
|
||||||
|
|
||||||
const widgetPosition = node.node.lastChild.from;
|
const widgetPosition = node.node.lastChild.from;
|
||||||
//this is not exactly standard, but should hold,
|
//this is not exactly standard, but should hold,
|
||||||
//and is the shortest way i could find of positioning
|
//and is the shortest way i could find of positioning
|
||||||
//the image inside the cm-image node
|
//the image inside the cm-image node
|
||||||
|
|
||||||
if(!url) return;
|
if(!url) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user