diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-06 21:30:50 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-06 21:30:50 -0400 |
| commit | 469606c1983236ca823e648fd664bd5f8dd391df (patch) | |
| tree | 074b23ae563dee77096c46f2193ce55382f332de /md.bqn | |
| parent | de0f802cf481b71d3664cd8ed42ca1de9a07f846 (diff) | |
Allow loading a file with the name in the first line of an SVG comment
Diffstat (limited to 'md.bqn')
| -rw-r--r-- | md.bqn | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -317,10 +317,11 @@ Markdown ← {filename𝕊𝕩: # Lazy rule: if it starts with < and contains >, it's probably HTML IsHtmlBlock ← ("<!--"≡4↑⊢)◶('>'∨´∘=⊢)‿2 useRepl←0 ⋄ GetRepl ← {𝕩⋄ useRepl↩1 ⋄ repl} - ProcComment ← ⟨"<!--REPL-->"⟩⊸≢◶⟨ - GetRepl - ("<!--SVG"≡⊑∘⊢)◶JoinLines‿(SvgExec∘JoinLines 1↓¯1↓⊢) - ⟩ + ProcComment ← ⟨"<!--REPL-->"⟩⊸≢◶GetRepl‿{ + n←≠s←"<!--SVG" ⋄ l←¯3↓⍟(1=≠𝕩)⊑𝕩 ⋄ a←s≡n↑l + Source ← {((0<≠)◶<‿(•LNS •path∾path∾⊢) Trim n↓l) ∾ 1↓¯1↓𝕩} + SvgExec⍟a JoinLines Source⍟a 𝕩 + } ProcHtml ← { codeMask ← "<code>" (6⥊0)⊸»⊸(>○(⌈`(1+↕∘≠)⊸×))○(⍷⟜𝕩 ∾ 0⥊˜1-˜≠) "</code>" (1¨ <⊸∾ codeMask⊸GetMultiHighlights)⊸Modify 𝕩 |
