From 5cb7c8d67a7bfd4b37fe3099eb03a64fba0a0ae5 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 9 Nov 2015 14:32:49 -0800 Subject: [PATCH] tweak md html reparsing: closes #290 --- lib/down-jet/rend.hoon | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/down-jet/rend.hoon b/lib/down-jet/rend.hoon index 51e11d859..fde91bc07 100644 --- a/lib/down-jet/rend.hoon +++ b/lib/down-jet/rend.hoon @@ -67,16 +67,20 @@ => [ele=i.lum .(lum t.lum)] ?. ?=(%html -.ele) (push (reso ele) ~) + :: begin reparsing of html that the spec jankily lets through :: =+ tex=(trip (role p.ele)) - =^ mar tex [p q.q]:(need q:(many:poxa 1^1 tex)) + =^ mar lum (chomp tex (sear |=(a=marl ?~(a ~ (some a))) many:poxa)) ?^ mar - (push mar) + (push u.mar) =^ hed lum (chomp tex head:poxa) ?^ hed =+ max=`marx`u.hed (push(lum q) [max p] ~):[apex(had `n.max) .] =^ tal lum (chomp tex tail:poxa) ?~ tal + =^ cha lum (chomp tex prn) + ?^ cha + (push :/([u.cha]~) ~) (push ;lost:"{tex}" ~) ?: =(had tal) [~ lum] @@ -84,6 +88,7 @@ =. lum [ele lum] (lose "unclosed {}") (lose "close {}") + :: end reparsing of html that the spec jankily lets through :: :: ++ lose |=(a=tape [[;lost:"{a}"]~ lum]) ++ chomp @@ -92,7 +97,7 @@ =+ vex=(fel 1^1 tap) ?~ q.vex [~ lum] :- [~ (wonk vex)] - ?~(q.q.u.q.vex lum [[%html (crip q.q.u.q.vex) ~] lum]) + ?~(q.q.u.q.vex lum [[%html (lore (crip q.q.u.q.vex))] lum]) :: ++ push |= a=marl