FIX: Markdown handling failed on empty attribute value (#17199)
Seems to only be a problem when a markdown.it rule inserts links without a attribute value. There's no test, because it's not reproducible with the markdown rules in core.
This commit is contained in:
parent
809f3d37cd
commit
2d6ef232a7
|
@ -6,8 +6,9 @@ const HTML_TYPES = ["html_block", "html_inline"];
|
||||||
function addImage(uploads, token) {
|
function addImage(uploads, token) {
|
||||||
if (token.attrs) {
|
if (token.attrs) {
|
||||||
for (let i = 0; i < token.attrs.length; i++) {
|
for (let i = 0; i < token.attrs.length; i++) {
|
||||||
if (token.attrs[i][1].indexOf("upload://") === 0) {
|
const value = token.attrs[i][1];
|
||||||
uploads.push({ token, srcIndex: i, origSrc: token.attrs[i][1] });
|
if (value?.startsWith("upload://")) {
|
||||||
|
uploads.push({ token, srcIndex: i, origSrc: value });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue