mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 16:24:17 +08:00
45c5fd2172
- removes the option from site settings - deletes the site setting on existing sites that have it - marks posts using emojis as requiring a rebake Note that the actual image files are not removed here, the plan is to remove them in a few weeks/months (when presumably the rebaking of old posts has been completed).
39 lines
865 B
JavaScript
39 lines
865 B
JavaScript
import PrettyText, { buildOptions } from "pretty-text/pretty-text";
|
|
|
|
module("lib:details-cooked-test");
|
|
|
|
const defaultOpts = buildOptions({
|
|
siteSettings: {
|
|
enable_emoji: true,
|
|
emoji_set: "google_classic",
|
|
highlighted_languages: "json|ruby|javascript",
|
|
default_code_lang: "auto",
|
|
},
|
|
censoredWords: "shucks|whiz|whizzer",
|
|
getURL: (url) => url,
|
|
});
|
|
|
|
test("details", function (assert) {
|
|
const cooked = (input, expected, text) => {
|
|
assert.equal(
|
|
new PrettyText(defaultOpts).cook(input),
|
|
expected.replace(/\/>/g, ">"),
|
|
text
|
|
);
|
|
};
|
|
cooked(
|
|
`<details><summary>Info</summary>coucou</details>`,
|
|
`<details><summary>Info</summary>coucou</details>`,
|
|
"manual HTML for details"
|
|
);
|
|
|
|
cooked(
|
|
"[details=testing]\ntest\n[/details]",
|
|
`<details>
|
|
<summary>
|
|
testing</summary>
|
|
<p>test</p>
|
|
</details>`
|
|
);
|
|
});
|