mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-05 09:04:28 -06:00
Merge pull request #591 from p1gp1g/fix/relative-img-url
Fix relative image url fetched from stylesheet domain
This commit is contained in:
commit
65dfecf484
@ -2233,8 +2233,9 @@ EasyMDE.prototype.render = function (el) {
|
||||
|
||||
|
||||
function assignImageBlockAttributes(parentEl, img) {
|
||||
parentEl.setAttribute('data-img-src', img.url);
|
||||
parentEl.setAttribute('style', '--bg-image:url(' + img.url + ');--width:' + img.naturalWidth + 'px;--height:' + calcHeight(img.naturalWidth, img.naturalHeight));
|
||||
var url = (new URL(img.url, document.baseURI)).href;
|
||||
parentEl.setAttribute('data-img-src', url);
|
||||
parentEl.setAttribute('style', '--bg-image:url(' + url + ');--width:' + img.naturalWidth + 'px;--height:' + calcHeight(img.naturalWidth, img.naturalHeight));
|
||||
_vm.codemirror.setSize();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user