Skip to content

Commit

Permalink
when dom-parsing images, allow the html to set a relative ID
Browse files Browse the repository at this point in the history
This is for compatibility with the imgpaste plugin.
  • Loading branch information
splitbrain committed Nov 20, 2024
1 parent 202bbc1 commit ce64534
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export default function getSpec() {
align = 'center';
}
return {
id: attrs.media,
// a relative ID might be preferred (see imgpaste plugin)
id: dom.dataset.relID || attrs.media,
title: dom.getAttribute('alt'),
width: attrs.w,
height: attrs.h,
Expand Down

0 comments on commit ce64534

Please sign in to comment.