56 |
56 |
57 local |
57 local |
58 val hidden = XML.text #> (span Markup.hiddenN |-> enclose); |
58 val hidden = XML.text #> (span Markup.hiddenN |-> enclose); |
59 |
59 |
60 val html_syms = Symtab.make |
60 val html_syms = Symtab.make |
61 [("\n", (0, "<br/>")), |
61 [("", (0, "")), |
|
62 ("\n", (0, "<br/>")), |
62 ("'", (1, "'")), |
63 ("'", (1, "'")), |
63 ("\\<spacespace>", (2, " ")), |
64 ("\\<spacespace>", (2, " ")), |
64 ("\\<exclamdown>", (1, "¡")), |
65 ("\\<exclamdown>", (1, "¡")), |
65 ("\\<cent>", (1, "¢")), |
66 ("\\<cent>", (1, "¢")), |
66 ("\\<pounds>", (1, "£")), |
67 ("\\<pounds>", (1, "£")), |
219 val output_sub = output_markup ("<sub>", "</sub>"); |
220 val output_sub = output_markup ("<sub>", "</sub>"); |
220 val output_sup = output_markup ("<sup>", "</sup>"); |
221 val output_sup = output_markup ("<sup>", "</sup>"); |
221 val output_bold = output_markup (span "bold"); |
222 val output_bold = output_markup (span "bold"); |
222 val output_loc = output_markup (span "loc"); |
223 val output_loc = output_markup (span "loc"); |
223 |
224 |
224 fun output_syms (s1 :: s2 :: ss) = |
225 fun output_syms (s1 :: rest) = |
225 if s1 = "\\<^sub>" orelse s1 = "\\<^isub>" then output_sub s1 s2 :: output_syms ss |
226 let val (s2, ss) = (case rest of [] => ("", []) | s2 :: ss => (s2, ss)) in |
226 else if s1 = "\\<^sup>" orelse s1 = "\\<^isup>" then output_sup s1 s2 :: output_syms ss |
227 if s1 = "\\<^sub>" orelse s1 = "\\<^isub>" then output_sub s1 s2 :: output_syms ss |
227 else if s1 = "\\<^bold>" then output_bold s1 s2 :: output_syms ss |
228 else if s1 = "\\<^sup>" orelse s1 = "\\<^isup>" then output_sup s1 s2 :: output_syms ss |
228 else if s1 = "\\<^loc>" then output_loc s1 s2 :: output_syms ss |
229 else if s1 = "\\<^bold>" then output_bold s1 s2 :: output_syms ss |
229 else output_sym s1 :: output_syms (s2 :: ss) |
230 else if s1 = "\\<^loc>" then output_loc s1 s2 :: output_syms ss |
230 | output_syms (s :: ss) = output_sym s :: output_syms ss |
231 else output_sym s1 :: output_syms rest |
|
232 end |
231 | output_syms [] = []; |
233 | output_syms [] = []; |
232 in |
234 in |
233 |
235 |
234 fun output_width str = |
236 fun output_width str = |
235 let val (syms, width) = |
237 let val (syms, width) = |