修复markd解析器对混合html的处理; 优化markd引用块的样式;优化scoll组件在边缘场景下报错的的问题
parent
f65db2e830
commit
465d475488
|
@ -521,14 +521,24 @@ class Tool {
|
|||
continue
|
||||
}
|
||||
|
||||
if (isParagraph) {
|
||||
html += `${it}\n`
|
||||
} else {
|
||||
if (isHtmlBlock || isSingleLineHtml) {
|
||||
if (isParagraph) {
|
||||
isParagraph = false
|
||||
html = trimBr(html)
|
||||
html += '</p>'
|
||||
}
|
||||
html += `${it}\n`
|
||||
} else if (isMultiLineHtml) {
|
||||
if (isParagraph) {
|
||||
isParagraph = false
|
||||
html = trimBr(html)
|
||||
html += '</p>'
|
||||
}
|
||||
isHtmlBlock = !isHtmlBlock
|
||||
html += `${it}\n`
|
||||
} else {
|
||||
if (isParagraph) {
|
||||
html += `${it}\n`
|
||||
} else {
|
||||
html += `\n<p>${it}`
|
||||
isParagraph = true
|
||||
|
|
|
@ -68,6 +68,10 @@ class Markd extends Component {
|
|||
p {
|
||||
margin: 0;
|
||||
}
|
||||
> blockquote {
|
||||
margin: 5px 0;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset.md-hr {
|
||||
|
@ -193,7 +197,6 @@ class Markd extends Component {
|
|||
`
|
||||
|
||||
render() {
|
||||
// console.log(md2html(this.code))
|
||||
return html`<div class="container">${raw(md2html(this.code))}</div>`
|
||||
}
|
||||
}
|
||||
|
|
|
@ -392,7 +392,7 @@ class Scroll extends Component {
|
|||
this.__observer.observe(this.$refs.cont)
|
||||
}
|
||||
unmounted() {
|
||||
this.__observer.disconnect()
|
||||
this.__observer?.disconnect()
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in New Issue