mirror of
https://github.com/discourse/discourse.git
synced 2025-02-19 07:13:24 +08:00
FIX: keep 'rb' & 'rp' tags in html to markdown conversion.
This commit is contained in:
parent
fc6b093dce
commit
7dbde18f02
|
@ -102,6 +102,10 @@ export class Tag {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static whitelists() {
|
||||||
|
return ["ins", "del", "small", "big", "kbd", "ruby", "rt", "rb", "rp"];
|
||||||
|
}
|
||||||
|
|
||||||
static block(name, prefix, suffix) {
|
static block(name, prefix, suffix) {
|
||||||
return class extends Tag {
|
return class extends Tag {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -149,7 +153,7 @@ export class Tag {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static keep(name) {
|
static whitelist(name) {
|
||||||
return class extends Tag {
|
return class extends Tag {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(name, `<${name}>`, `</${name}>`);
|
super(name, `<${name}>`, `</${name}>`);
|
||||||
|
@ -479,18 +483,12 @@ function tags() {
|
||||||
...Tag.headings().map((h, i) => Tag.heading(h, i + 1)),
|
...Tag.headings().map((h, i) => Tag.heading(h, i + 1)),
|
||||||
...Tag.slices().map(s => Tag.slice(s, "\n")),
|
...Tag.slices().map(s => Tag.slice(s, "\n")),
|
||||||
...Tag.emphases().map(e => Tag.emphasis(e[0], e[1])),
|
...Tag.emphases().map(e => Tag.emphasis(e[0], e[1])),
|
||||||
|
...Tag.whitelists().map(t => Tag.whitelist(t)),
|
||||||
Tag.cell("td"),
|
Tag.cell("td"),
|
||||||
Tag.cell("th"),
|
Tag.cell("th"),
|
||||||
Tag.replace("br", "\n"),
|
Tag.replace("br", "\n"),
|
||||||
Tag.replace("hr", "\n---\n"),
|
Tag.replace("hr", "\n---\n"),
|
||||||
Tag.replace("head", ""),
|
Tag.replace("head", ""),
|
||||||
Tag.keep("ins"),
|
|
||||||
Tag.keep("del"),
|
|
||||||
Tag.keep("small"),
|
|
||||||
Tag.keep("big"),
|
|
||||||
Tag.keep("kbd"),
|
|
||||||
Tag.keep("ruby"),
|
|
||||||
Tag.keep("rt"),
|
|
||||||
Tag.li(),
|
Tag.li(),
|
||||||
Tag.link(),
|
Tag.link(),
|
||||||
Tag.image(),
|
Tag.image(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user