Mercurial > urweb
comparison src/monoize.sml @ 2090:9a1547596712
Fix XML syntax for closing <input> tags
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 18 Dec 2014 07:48:37 -0500 |
parents | 0d48cfb59b29 |
children | 809bceab15a3 |
comparison
equal
deleted
inserted
replaced
2089:5f15f4ce8f3b | 2090:9a1547596712 |
---|---|
3445 val (tagStart, fm) = tagStart tag | 3445 val (tagStart, fm) = tagStart tag |
3446 val tagStart = case extra of | 3446 val tagStart = case extra of |
3447 NONE => tagStart | 3447 NONE => tagStart |
3448 | SOME extra => (L'.EStrcat (tagStart, extra), loc) | 3448 | SOME extra => (L'.EStrcat (tagStart, extra), loc) |
3449 | 3449 |
3450 val firstWord = Substring.string o #1 o Substring.splitl (fn ch => not (Char.isSpace ch)) o Substring.full | |
3451 | |
3450 fun normal () = | 3452 fun normal () = |
3451 let | 3453 let |
3452 val (xml, fm) = monoExp (env, st, fm) xml | 3454 val (xml, fm) = monoExp (env, st, fm) xml |
3453 | 3455 |
3454 val xml = case extraString of | 3456 val xml = case extraString of |
3455 NONE => xml | 3457 NONE => xml |
3456 | SOME extra => (L'.EStrcat (extra, xml), loc) | 3458 | SOME extra => (L'.EStrcat (extra, xml), loc) |
3457 in | 3459 in |
3458 ((L'.EStrcat ((L'.EStrcat (tagStart, strH ">"), loc), | 3460 ((L'.EStrcat ((L'.EStrcat (tagStart, strH ">"), loc), |
3459 (L'.EStrcat (xml, | 3461 (L'.EStrcat (xml, |
3460 strH (String.concat ["</", tag, ">"])), loc)), | 3462 strH (String.concat ["</", firstWord tag, ">"])), loc)), |
3461 loc), | 3463 loc), |
3462 fm) | 3464 fm) |
3463 end | 3465 end |
3464 | 3466 |
3465 fun isSingleton () = | 3467 fun isSingleton () = |