mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 12:10:38 +08:00

* add commonmark spec and gfm spec test and compare with markedjs * ignore .env * fix: load lang multiple times * add eslint disable * add `math`, `emoji`, `frontMatter` options to marked * fix: commonmark example 223 * fix: import markdown error * fix: commonmark example 7 * fix: commonmark example 40 * update test result * update changelog * update loose test regexp * remove unused comments
15 lines
523 B
JavaScript
15 lines
523 B
JavaScript
export const removeCustomClass = html => {
|
|
const customClass = ['indented-code-block', 'fenced-code-block', 'task-list-item']
|
|
customClass.forEach(className => {
|
|
if (html.indexOf(className) > -1) {
|
|
const REG_EXP = new RegExp(`class="${className}"`, 'g')
|
|
/* eslint-disable no-useless-escape */
|
|
const REG_EXP_SIMPLE = new RegExp(className + ` \*`, 'g')
|
|
/* eslint-enable no-useless-escape */
|
|
html = html.replace(REG_EXP, '')
|
|
.replace(REG_EXP_SIMPLE, '')
|
|
}
|
|
})
|
|
return html
|
|
}
|