mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-06-22 04:58:40 +00:00
add a comment
This commit is contained in:
@@ -395,7 +395,10 @@ export function customHighlightPlugin(renderer, tab) {
|
|||||||
if(node.name === 'Image') {
|
if(node.name === 'Image') {
|
||||||
const url = getUrl(node, view.state.doc);
|
const url = getUrl(node, view.state.doc);
|
||||||
|
|
||||||
console.log(node.node.lastChild.from);
|
const widgetPosition = node.node.lastChild.from;
|
||||||
|
//this is not exactly standard, but should hold,
|
||||||
|
//and is the shortest way i could find of positioning
|
||||||
|
//the image inside the cm-image node
|
||||||
|
|
||||||
if(!url) return;
|
if(!url) return;
|
||||||
|
|
||||||
@@ -408,7 +411,7 @@ export function customHighlightPlugin(renderer, tab) {
|
|||||||
Decoration.widget({
|
Decoration.widget({
|
||||||
widget : new ImageWidget(url),
|
widget : new ImageWidget(url),
|
||||||
side : 1
|
side : 1
|
||||||
}).range(node.node.lastChild.from)
|
}).range(widgetPosition)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user