mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: use upload short-url in html to markdown conversion if 'base62-sha1' data attr available.
This commit is contained in:
@@ -206,8 +206,16 @@ export class Tag {
|
||||
["lightbox", "d-lazyload"].includes(attr.class) &&
|
||||
hasChild(e, "img")
|
||||
) {
|
||||
let href = attr.href;
|
||||
const img = (e.children || []).find(c => c.name === "img");
|
||||
const base62SHA1 = img.attributes["data-base62-sha1"];
|
||||
text = attr.title || "";
|
||||
return "";
|
||||
|
||||
if (base62SHA1) {
|
||||
href = `upload://${base62SHA1}`;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
if (attr.href && text !== attr.href) {
|
||||
|
||||
Reference in New Issue
Block a user