… | |
… | |
16 | |
16 | |
17 | sub htmlfcodes { |
17 | sub htmlfcodes { |
18 | my %tag = ( |
18 | my %tag = ( |
19 | I => "i", |
19 | I => "i", |
20 | B => "b", |
20 | B => "b", |
21 | C => "tt", |
21 | C => "code", |
22 | L => "i", # broken |
22 | L => "i", # broken |
23 | F => "tt", |
23 | F => "kbd", |
24 | S => "nobr", # non-std |
24 | S => "nobr", # non-std |
25 | X => "span", # broken |
25 | X => "span", # broken |
26 | Z => "span", # broken |
26 | Z => "span", # broken |
27 | ); |
27 | ); |
28 | # strip formatting codes, dumb version |
28 | # strip formatting codes, dumb version |
29 | map { |
29 | map { |
30 | s/([IBCLFSXZ])<< (.*?) >>/<$tag{$1}>$2<\/$tag{$1}>/gs; |
30 | s/([IBCLFSXZ])<< (.*?) >>/<$tag{$1}>$2 <\/$tag{$1}>/gs; |
31 | s/([IBCLFSXZ])<(.*?)>/<$tag{$1}>$2<\/$tag{$1}>/gs; |
31 | s/([IBCLFSXZ])<(.*?)>/<$tag{$1}>$2 <\/$tag{$1}>/gs; |
32 | $_ |
32 | $_ |
33 | } @$_; |
33 | } @$_; |
34 | } |
34 | } |
35 | |
35 | |
36 | sub command { |
36 | sub command { |
… | |
… | |
79 | |
79 | |
80 | # html |
80 | # html |
81 | # pod::xhtml fails on begin/end blocks |
81 | # pod::xhtml fails on begin/end blocks |
82 | # print $fh "=begin xhtml\n\n"; |
82 | # print $fh "=begin xhtml\n\n"; |
83 | |
83 | |
|
|
84 | print $fh "=for xhtml <table>"; |
|
|
85 | print $fh map "<tr><td>" . +(join " </td><td>", htmlfcodes @$_) . " </td></tr>", @$table; |
|
|
86 | print $fh "</table>\n\n"; |
|
|
87 | |
84 | print $fh "=for html <table>"; |
88 | print $fh "=for html <table>"; |
85 | print $fh map "<tr><td>" . +(join "</td><td>", htmlfcodes @$_) . "</td></tr>", @$table; |
89 | print $fh map "<tr><td>" . +(join " </td><td>", htmlfcodes @$_) . " </td></tr>", @$table; |
86 | print $fh "</table>\n\n"; |
90 | print $fh "</table>\n\n"; |
87 | |
91 | |
88 | # print $fh "\n=end xhtml\n\n"; |
92 | # print $fh "\n=end xhtml\n\n"; |
89 | |
93 | |
90 | } |
94 | } |