Skip to content

Commit

Permalink
fix: add regex for <br> and <br />
Browse files Browse the repository at this point in the history
  • Loading branch information
MayaGillilan committed Feb 29, 2024
1 parent aca5c6d commit e3e9238
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rich-text-from-markdown/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ async function mdToRichTextNode(
): Promise<Node[]> {
// By default <br/> is parsed as html node, causing it to be stripped out.
// We need to convert it manually in order to support it
if (node.type === 'html' && node.value === '<br/>') {
if (node.type === 'html' && node.value.match(/<br\s?\/?>/g)) {
node.value = '\n';
node.type = 'text';
}
Expand Down

0 comments on commit e3e9238

Please sign in to comment.