fix: strikeout style rendering position #498
This commit is contained in:
@@ -754,6 +754,9 @@ export function convertElementToDom(
|
||||
if (element.underline) {
|
||||
dom.style.textDecoration = 'underline'
|
||||
}
|
||||
if (element.strikeout) {
|
||||
dom.style.textDecoration += ' line-through'
|
||||
}
|
||||
dom.innerText = element.value.replace(new RegExp(`${ZERO}`, 'g'), '\n')
|
||||
return dom
|
||||
}
|
||||
@@ -981,9 +984,13 @@ export function convertTextNodeToElement(
|
||||
element.highlight = style.backgroundColor
|
||||
}
|
||||
// 下划线
|
||||
if (style.textDecorationLine === 'underline') {
|
||||
if (style.textDecorationLine.includes('underline')) {
|
||||
element.underline = true
|
||||
}
|
||||
// 删除线
|
||||
if (style.textDecorationLine.includes('line-through')) {
|
||||
element.strikeout = true
|
||||
}
|
||||
return element
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user