From 299fecb861c88f2296f5413b01ccf1a428deff41 Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Sat, 21 Feb 2026 04:18:51 -0500 Subject: [PATCH] fix(readme): correct output indentation in examples Signed-off-by: Okiki Ojo --- readme.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index bf2f71c..b709208 100644 --- a/readme.md +++ b/readme.md @@ -24,12 +24,15 @@ console.log(greet("Ayo")); Output — 4 unwanted leading spaces, blank lines at both ends: ``` -Hello, Ayo! -Welcome aboard. + + Hello, Ayo! + Welcome aboard. + ``` -You could smash the template to column 0, but then your source becomes -unreadable. `undent` gives you both — indented source _and_ clean output: +You could smash the template to column 0, but then your source becomes unreadable. + +`undent` fixes this issues by letting you write nicely indented templates without the extra spaces in the output: ```ts import { undent } from "@okikio/undent"; @@ -46,6 +49,11 @@ console.log(greet("Ayo")); // Welcome aboard. ``` +``` +Hello, Ayo! +Welcome aboard. +``` + It finds the shared indentation across all lines, strips it, and trims the blank lines that come from the backtick placement. Beyond that, it handles several things most dedent libraries get wrong: -- 2.51.2