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>
|
const html = `<div>
|
||||||
<b>Hello </b>
|
<b>Hello </b>
|
||||||
<i> World</i>
|
<i> World</i>
|
||||||
<u> ! </u>
|
<u> ! </u>
|
||||||
</div>`
|
</div>`
|
||||||
|
|
||||||
expect(trim(html)).toEqual('<div><b>Hello</b><i>World</i><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'
|
import { htmlDecode } from 'js-htmlencode'
|
||||||
|
|
||||||
export const trim = (html: string): string => html
|
export const trim = (html: string): string => html
|
||||||
|
.replace(/ /g, ' ')
|
||||||
.split('>')
|
.split('>')
|
||||||
.map((token) => token.trim())
|
.map((token) => token.trim())
|
||||||
.join('>')
|
.join('>')
|
||||||
|
|
Loading…
Reference in New Issue