mirror of
https://github.com/doocs/md.git
synced 2024-11-28 13:36:32 +08:00
fix: render katex (#253)
This commit is contained in:
parent
effb43d7d9
commit
0fba96465a
@ -343,7 +343,13 @@ export default {
|
|||||||
clipboardDiv.innerHTML = mergeCss(clipboardDiv.innerHTML)
|
clipboardDiv.innerHTML = mergeCss(clipboardDiv.innerHTML)
|
||||||
|
|
||||||
// 调整 katex 公式元素为行内标签,目的是兼容微信公众号渲染
|
// 调整 katex 公式元素为行内标签,目的是兼容微信公众号渲染
|
||||||
clipboardDiv.innerHTML = clipboardDiv.innerHTML.replace(/class="base"( style="display: inline")*/g, `class="base" style="display: inline"`)
|
clipboardDiv.innerHTML = clipboardDiv.innerHTML
|
||||||
|
.replace(
|
||||||
|
/class="base"( style="display: inline")*/g,
|
||||||
|
`class="base" style="display: inline"`
|
||||||
|
)
|
||||||
|
// 公众号不支持 position, 转换为等价的 translateY
|
||||||
|
.replace(/top:(.*?)em/g, `transform: translateY($1em)`)
|
||||||
|
|
||||||
if (this.isMacCodeBlock) {
|
if (this.isMacCodeBlock) {
|
||||||
clipboardDiv.innerHTML = clipboardDiv.innerHTML.replaceAll(
|
clipboardDiv.innerHTML = clipboardDiv.innerHTML.replaceAll(
|
||||||
|
Loading…
Reference in New Issue
Block a user