From 34a9428d6afef06c4c22da61cf223e9442e19e17 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Fri, 8 Mar 2024 17:04:15 +0100 Subject: [PATCH] fix --- mod.ts | 2 +- test/test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod.ts b/mod.ts index 4d4db98..ff3ca96 100644 --- a/mod.ts +++ b/mod.ts @@ -462,5 +462,5 @@ export function strip(markdown: string, opts: RenderOptions = {}): string { ...getOpts(opts), tokenizer: new StripTokenizer(), }); - return stripTokens(tokens).replace(/\n{3,}/g, "\n"); + return stripTokens(tokens).replace(/\n{3,}/g, "\n").trim(); } diff --git a/test/test.ts b/test/test.ts index 68739d8..3ce62db 100644 --- a/test/test.ts +++ b/test/test.ts @@ -386,7 +386,7 @@ Deno.test("h1 test", () => { const html = render(markdown); assertEquals(html, result); - assertEquals(strip(markdown), "hello"); + assertEquals(strip(markdown), "Hello"); }); Deno.test("svg test", () => {