From 905b893ca735ffe9f7625d9eae18dbb2c12f1b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20=C3=96brink?= Date: Fri, 12 Feb 2021 14:06:29 +0100 Subject: [PATCH] fix: links (#64) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 Fixar links med mellanslag * fix: 🐛 Links med single quote --- lib/parseHtml.test.ts | 3 ++- lib/parseHtml.ts | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/parseHtml.test.ts b/lib/parseHtml.test.ts index ed3d1153..2d2628b0 100644 --- a/lib/parseHtml.test.ts +++ b/lib/parseHtml.test.ts @@ -17,9 +17,10 @@ describe('parseHtml', () => { it('handles links with spaces', () => { const html = `
Hello + Hello
` - expect(trim(html)).toEqual('
Hello
') + expect(trim(html)).toEqual('
HelloHello
') }) }) describe('toMarkdown', () => { diff --git a/lib/parseHtml.ts b/lib/parseHtml.ts index cc01b628..ac4a7aec 100644 --- a/lib/parseHtml.ts +++ b/lib/parseHtml.ts @@ -10,17 +10,26 @@ export const trim = (html: string = ''): string => { .split(' token.trim()) .join('