fix: 🐛 Replaces non breaking space with simple space (#57)
This commit is contained in:
parent
f9dc39128e
commit
58d56764d3
|
@ -6,7 +6,7 @@ describe('parseHtml', () => {
|
|||
const html = `<div>
|
||||
<b>Hello </b>
|
||||
<i> World</i>
|
||||
<u> ! </u>
|
||||
<u> ! </u>
|
||||
</div>`
|
||||
|
||||
expect(trim(html)).toEqual('<div><b>Hello</b><i>World</i><u>!</u></div>')
|
||||
|
|
|
@ -2,6 +2,7 @@ import * as h2m from 'h2m'
|
|||
import { htmlDecode } from 'js-htmlencode'
|
||||
|
||||
export const trim = (html: string): string => html
|
||||
.replace(/ /g, ' ')
|
||||
.split('>')
|
||||
.map((token) => token.trim())
|
||||
.join('>')
|
||||
|
|
Loading…
Reference in New Issue