mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 09:14:40 +08:00
FEATURE: Add base62 sha1 to cooked data attribute
* FEATURE: Add base62 sha1 to data attribute in `Post#cooked`. * FIX: Use `Upload#short_url` when quoting an image.
This commit is contained in:
@ -163,12 +163,19 @@ QUnit.test(
|
||||
|
||||
QUnit.test("converts img tag", assert => {
|
||||
const url = "https://example.com/image.png";
|
||||
const base62SHA1 = "q16M6GR110R47Z9p9Dk3PMXOJoE";
|
||||
let html = `<img src="${url}" width="100" height="50">`;
|
||||
assert.equal(toMarkdown(html), ``);
|
||||
|
||||
html = `<img src="${url}" width="100" height="50" title="some title">`;
|
||||
assert.equal(toMarkdown(html), ``);
|
||||
|
||||
html = `<img src="${url}" width="100" height="50" title="some title" data-base62-sha1="${base62SHA1}">`;
|
||||
assert.equal(
|
||||
toMarkdown(html),
|
||||
``
|
||||
);
|
||||
|
||||
html = `<div><span><img src="${url}" alt="description" width="50" height="100" /></span></div>`;
|
||||
assert.equal(toMarkdown(html), ``);
|
||||
|
||||
|
Reference in New Issue
Block a user