aboutsummaryrefslogtreecommitdiff
path: root/md.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-24 17:04:47 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-24 17:04:47 -0500
commit3d78f125185ce47784245d6619f2878a6ad1b587 (patch)
tree0e6f1813098e7a40adde928e0adcd42dc7bbea78 /md.bqn
parent3338439f07f5e583d317ba9c6aed75e0b6093c3f (diff)
Trim header name before creating slug
Diffstat (limited to 'md.bqn')
-rw-r--r--md.bqn3
1 files changed, 2 insertions, 1 deletions
diff --git a/md.bqn b/md.bqn
index 81dd9970..5d5a0ae9 100644
--- a/md.bqn
+++ b/md.bqn
@@ -249,6 +249,7 @@ Markdown ← {filename𝕊𝕩:
tail ← ∧`⌾⌽ trsp∨𝕩='#' # Mask of trailing hashes
f ← <⟜« tail # Character before trailing hashes
𝕩 /˜↩ ¬ f (⊑⟨"\"," ",""⟩⊐<f/𝕩)◶⟨⊣,⊢,⊢,0¨⊢⟩ tail
+ 𝕩 Trim↩
# Add an id, containing only a-z, digits, and hyphens
Slugify ← {
𝕩 ↩ '-'¨⌾((𝕩=' ')⊸/) 𝕩 # Replace spaces with dashes
@@ -261,7 +262,7 @@ Markdown ← {filename𝕊𝕩:
s←Slugify 𝕗 ⋄ Q ← """"⊸(∾∾⊣)
(𝕨 ∾ " id="∾Q s) Html ("a class=""header"" href="∾Q"#"∾s) Html 𝕩
}
- tag extensions◶Html‿ExtHtml ProcInline Trim 𝕩
+ tag extensions◶Html‿ExtHtml ProcInline 𝕩
}⟜⊑
# List items start with a bullet (unordered) or number (ordered).