From ba044be1ca8a6246f5f0d47024deec2a2b7157ce Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Sun, 11 Jan 2026 05:57:06 +0530 Subject: [PATCH] Fix: updateTitle regex to match headings without trailing newlines --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 5fb7b3a..c1ff2c8 100644 --- a/index.html +++ b/index.html @@ -374,8 +374,8 @@ } function updateTitle() { - const match = article.textContent.match(/^\n*#(.+)\n/) - document.title = match?.[1] ?? 'Textarea' + const match = article.textContent.match(/^#\s*(.+)/m) + document.title = match?.[1]?.trim() ?? 'Textarea' } async function compress(string) {