fix: 🐛 Flytta mellanslag utanför taggarna (#124)
This commit is contained in:
parent
4991f910a3
commit
79e2a7577b
|
@ -199,7 +199,7 @@ describe('newsItem', () => {
|
|||
BannerImageGuid: '7a8142d9d9d54cf090e8457e4c629227',
|
||||
BannerImageListId: 'a88c22e8-7094-4a71-b4fd-8792c62a7b4a',
|
||||
Body:
|
||||
'<i>italic</i> <b>bold</b> <em>emphasis </em><br/><strong>strong</strong>',
|
||||
'<i>italic</i> <b>bold</b> <em>emphasis </em><br/><strong>strong</strong><strong>nbsp </strong>',
|
||||
BodyNoHtml: null,
|
||||
AuthorDisplayName: 'Tieto Evry',
|
||||
altText: null,
|
||||
|
@ -238,5 +238,6 @@ describe('newsItem', () => {
|
|||
expect(item.body).toContain('**bold**')
|
||||
expect(item.body).toContain('*emphasis*')
|
||||
expect(item.body).toContain('**strong**')
|
||||
expect(item.body).toContain('**nbsp**')
|
||||
})
|
||||
})
|
|
@ -45,6 +45,8 @@ const rearrangeWhitespace = (html: string = ''): string => {
|
|||
trimNodes.forEach((trimNode) => {
|
||||
content = content.split(`<${trimNode}> `).join(` <${trimNode}>`)
|
||||
content = content.split(` </${trimNode}>`).join(`</${trimNode}> `)
|
||||
content = content.split(`<${trimNode}>&nbsp;`).join(`&nbsp;<${trimNode}>`)
|
||||
content = content.split(`&nbsp;</${trimNode}>`).join(`</${trimNode}>&nbsp;`)
|
||||
})
|
||||
return content
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue