aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-17 20:05:50 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-17 20:05:50 -0400
commit73dc9172b8686444bc1e6126a0f4377e8373fbb7 (patch)
tree182ed8457e105643c1f6fe366bfef75455bca667 /doc
parentd2a41c0da6b568d203563d278a61f9e85ef1a8b8 (diff)
Handle escaped |s in tables
Diffstat (limited to 'doc')
-rw-r--r--doc/md.bqn7
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/md.bqn b/doc/md.bqn
index b303fb30..9a3c90bc 100644
--- a/doc/md.bqn
+++ b/doc/md.bqn
@@ -163,7 +163,12 @@ Markdown ← {𝕊𝕩:1𝕊𝕩; extensions𝕊𝕩:
# Any line that starts with a | is a table, at least in my lazy version
IsTable ← 1˜
ProcTable ← {
- rows ← (Trim¨ ((1-˜¬×+`)'|'⊸=)⊸⊔)¨ 𝕩
+ CutRow ← {
+ b ← '|' = 𝕩
+ r ← b > 0 Shl '\' = 𝕩
+ 1 -˜ (¬r∨1⌽b>r) × +`r
+ }
+ rows ← (Trim¨ CutRow⊸⊔)¨ 𝕩
inc ← ¬ rule ← ∧´∘∾¨'-'=rows
rows ↩ ProcInline¨¨⌾(inc⊸/) rows
rowType ← inc / +` rule # Head or body