Merge pull request #294 from answerdev/feat/1.0.8/ui
fix: fixed the BR tag in the editor block formula HTML caused renderi…
This commit is contained in:
@@ -80,6 +80,13 @@ export function createEditorUtils(
|
||||
|
||||
export function htmlRender(el: HTMLElement | null) {
|
||||
if (!el) return;
|
||||
// Replace all br tags with newlines
|
||||
// Fixed an issue where the BR tag in the editor block formula HTML caused rendering errors.
|
||||
el.querySelectorAll('br').forEach((br) => {
|
||||
br.parentNode?.insertBefore(document.createTextNode('\n'), br);
|
||||
br.parentNode?.removeChild(br);
|
||||
});
|
||||
|
||||
import('mermaid').then(({ default: mermaid }) => {
|
||||
mermaid.initialize({ startOnLoad: false });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user