mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 12:08:12 -05:00
FIX: respect img size when quoting multiple elements (#35144)
Adds the width/height to quoted images when selecting and quoting multiple elements from a post at once.
This commit is contained in:
@@ -365,6 +365,16 @@ export class Tag {
|
||||
href = `upload://${base62SHA1}`;
|
||||
}
|
||||
|
||||
const width = img.attributes.width;
|
||||
const height = img.attributes.height;
|
||||
|
||||
if (width && height) {
|
||||
const pipe = this.element.parentNames.includes("table")
|
||||
? "\\|"
|
||||
: "|";
|
||||
text = `${text}${pipe}${width}x${height}`;
|
||||
}
|
||||
|
||||
return ``;
|
||||
}
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ helloWorld();</code>consectetur.`;
|
||||
<span class="filename">sherlock3_sig.jpg</span><span class="informations">5496×3664 2 MB</span><span class="expand"></span>
|
||||
</div></a>
|
||||
`;
|
||||
let markdown = ``;
|
||||
let markdown = ``;
|
||||
|
||||
assert.strictEqual(toMarkdown(html), markdown);
|
||||
|
||||
@@ -437,7 +437,7 @@ helloWorld();</code>consectetur.`;
|
||||
<span class="filename">sherlock3_sig.jpg</span><span class="informations">5496×3664 2 MB</span><span class="expand"></span>
|
||||
</div></a>
|
||||
`;
|
||||
markdown = ``;
|
||||
markdown = ``;
|
||||
|
||||
assert.strictEqual(toMarkdown(html), markdown);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user