marktext/test/specs/help.js
Ran Luo f4f5ba3e00 add commonmark spec and gfm spec test and compare with markedjs (#943)
* 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
2019-04-17 15:29:00 +02:00

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
}