mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
f12000f9c2
* feat: add website * chore: fix
18 lines
491 B
JavaScript
18 lines
491 B
JavaScript
export function stripScript(content) {
|
|
const result = content.match(/<(script)>([\s\S]+)<\/\1>/)
|
|
return result && result[2] ? result[2].trim() : ''
|
|
}
|
|
|
|
export function stripStyle(content) {
|
|
const result = content.match(/<(style)\s*>([\s\S]+)<\/\1>/)
|
|
return result && result[2] ? result[2].trim() : ''
|
|
}
|
|
|
|
export function stripTemplate(content) {
|
|
content = content.trim()
|
|
if (!content) {
|
|
return content
|
|
}
|
|
return content.replace(/<(script|style)[\s\S]+<\/\1>/g, '').trim()
|
|
}
|