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) {