From 4289975555ba4ec84d575c51aaefdf6a49764f42 Mon Sep 17 00:00:00 2001 From: Sam Arjmandi Date: Fri, 17 Oct 2025 20:13:11 -0600 Subject: [PATCH 1/5] docs(readme): remove redundant examples --- README.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/README.md b/README.md index 03280ed..1078698 100644 --- a/README.md +++ b/README.md @@ -91,27 +91,3 @@ wrapping. - `options.ignoreTags (string[], optional)` – Tags to keep intact in output (e.g., ["b", "mark"]) - `options.wrapWords (number, optional)` – Maximum words per line (takes priority over wrapLength) - `options.wrapLength (number, optional)` – Maximum characters per line - -## Examples - -```ts -import { textify } from 'html-textify'; - -const html = ` -

Title

-

Paragraph with bold and italic

- -`; - -const text = textify({ html }); -console.log(text); - -/* Output: -Title - -Paragraph with **bold** and *italic* - -- Item 1 -- Item 2 -*/ -``` From 96e4ef22ea6e392d74ab541ea3d0ed4a8a102644 Mon Sep 17 00:00:00 2001 From: Sam Arjmandi Date: Sat, 18 Oct 2025 11:51:40 -0600 Subject: [PATCH 2/5] chore: remove unnecessary comments --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 969ce69..044e3b2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,10 +4,10 @@ import { wrapByWords } from './utils/wrapByWords'; export interface TextifyOptions { html: string; - preserveFormatting?: boolean; // optional, default true - ignoreTags?: string[]; // optional tags to keep intact - wrapLength?: number; // max chars per line - wrapWords?: number; // max words per line + preserveFormatting?: boolean; + ignoreTags?: string[]; + wrapLength?: number; + wrapWords?: number; } /** From 3d52b1c97f1d8528476104d025d865242af278a6 Mon Sep 17 00:00:00 2001 From: Sam Arjmandi Date: Sat, 18 Oct 2025 11:57:09 -0600 Subject: [PATCH 3/5] fix(formatting): fix wrong links markdown --- src/utils/preserveFormat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/preserveFormat.ts b/src/utils/preserveFormat.ts index 402377e..07524e3 100644 --- a/src/utils/preserveFormat.ts +++ b/src/utils/preserveFormat.ts @@ -66,7 +66,7 @@ export function preserveFormat({ html = !ignoreTags.includes('a') ? html.replace( /(.*?)<\/a>/gi, - (_m, href: string, text: string) => `${text} (${href})` + (_m, href: string, text: string) => `[${text}](${href})` ) : html; From ba213c13856e37f08c4171fa64e4581b6ae03285 Mon Sep 17 00:00:00 2001 From: Sam Arjmandi Date: Sat, 18 Oct 2025 11:57:45 -0600 Subject: [PATCH 4/5] test(formatting): update test for links formatter --- src/utils/preserveFormat.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/preserveFormat.test.ts b/src/utils/preserveFormat.test.ts index 90d04ab..27a3ebe 100644 --- a/src/utils/preserveFormat.test.ts +++ b/src/utils/preserveFormat.test.ts @@ -31,7 +31,7 @@ describe('preserveFormat', () => { it('should handle links', () => { const html = 'Click here'; - const expected = 'Click here (https://example.com)'; + const expected = '[Click here](https://example.com)'; expect(preserveFormat({ html })).toBe(expected); }); @@ -119,7 +119,7 @@ describe('preserveFormat', () => { const result = preserveFormat({ html }); - const expected = `Main Heading\n\nParagraph with **bold** and *italic* text\n\n- Item 1\n- Item 2\n1. First\n2. Second\nLink (https://link.com)> Quote line 1\n> Quote line 2A1 B1\nA2 B2`; + const expected = `Main Heading\n\nParagraph with **bold** and *italic* text\n\n- Item 1\n- Item 2\n1. First\n2. Second\n[Link](https://link.com)> Quote line 1\n> Quote line 2A1 B1\nA2 B2`; expect(result).toBe(expected); }); }); From 7bbbb708dd576e6d32b6842d1b16672ae86e43bc Mon Sep 17 00:00:00 2001 From: Sam Arjmandi Date: Sat, 18 Oct 2025 12:07:37 -0600 Subject: [PATCH 5/5] chore(release): bumo version to 1.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 183baaf..0f6c4d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "html-textify", - "version": "1.0.0", + "version": "1.0.1", "description": "Convert html to plain text", "main": "dist/index.js", "module": "dist/index.mjs",