From 58d56764d3bdc10a5681d288c47b68d1cc9aa936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20=C3=96brink?= Date: Thu, 11 Feb 2021 13:19:26 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Replaces=20non=20breaking?= =?UTF-8?q?=20space=20with=20simple=20space=20(#57)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/parseHtml.test.ts | 2 +- lib/parseHtml.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/parseHtml.test.ts b/lib/parseHtml.test.ts index c2d4283aa..9d051f5bf 100644 --- a/lib/parseHtml.test.ts +++ b/lib/parseHtml.test.ts @@ -6,7 +6,7 @@ describe('parseHtml', () => { const html = `
Hello World - ! +  ! 
` expect(trim(html)).toEqual('
HelloWorld!
') diff --git a/lib/parseHtml.ts b/lib/parseHtml.ts index d65ff0de6..493324cc4 100644 --- a/lib/parseHtml.ts +++ b/lib/parseHtml.ts @@ -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('>')