#!/usr/bin/perl use warnings; use strict; my $level = 0; while (<>) { if (m%<P_list-bull\(1\)>(.*?)</P_list-bull\(1\)%) { my $text = $1; if ($level == 0) { print qq{<list list-type="bullet">\n}; } elsif ($level == 1) { print "</p></list-item>\n"; } elsif ($level == 2) { print "</list></p></list-item>\n"; } print "<list-item><p>$text"; $level = 1; } elsif (m%<P_list-simple\(2\)>(.*?)</P_list-simple\(2\)>%) { my $text = $1; if ($level == 1) { print qq{\n<list list-type="simple">\n}; } print qq{<list-item><p>$text</p></list-item>\n}; $level = 2; } } if ($level == 1) { print "</p></list-item>\n</list>\n"; }
In reply to Re: Multilevel tag closing
by choroba
in thread Multilevel tag closing
by maha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |