Skip to content

Commit

Permalink
fix: compatible with lower version browsers. #45
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 29, 2022
1 parent 8178a2f commit c02a49c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export const nextChild = (data: RootContent[] | ElementContent[] = [], index: nu
if (codeBlockParames) {
const nextNode = nextChild(data, i, 'pre', codeBlockParames)
if (nextNode) return;
element.value = element.value?.replace(/^(\n|\s)+/, '')
element.value = (element.value || '').replace(/^(\n|\s)+/, '')
return element;
} else {
element.value = element.value?.replace(/^(\n|\s)+/, '')
element.value = (element.value || '').replace(/^(\n|\s)+/, '')
return element;
}
}
Expand Down

0 comments on commit c02a49c

Please sign in to comment.