Skip to content

Commit b5675ef

Browse files
fix: Duplicate br tags added in html when there is a line break in json
1 parent d47d282 commit b5675ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/toRedactor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export const toRedactor = (jsonValue: any,options?:IJsonToHtmlOptions) : string
229229
text = `<span id=${jsonValue['id']}>${text}</span>`
230230
}
231231
}
232-
if (jsonValue.text.includes('\n')) {
232+
if (jsonValue.text.includes('\n') && !jsonValue['break']) {
233233
text = text.replace(/\n/g, '<br/>')
234234
}
235235
Object.entries(jsonValue).forEach(([key, value]) => {

0 commit comments

Comments
 (0)