mirror of
https://github.com/tateisu/SubwayTooter
synced 2025-01-18 12:16:46 +01:00
update full_description.pl, recognize html block tags.
This commit is contained in:
parent
2c74dff276
commit
81f762541b
@ -27,15 +27,14 @@ my $blockElements = join "|", qw(
|
||||
br
|
||||
);
|
||||
|
||||
# Attributes part inside HTML tag.
|
||||
my $attrsRe = qr!(?:[^>/"]+|"[^"]*")*!;
|
||||
|
||||
my $blockElementsRe = qr!(?:$blockElements)!i;
|
||||
my $trimElementsRe = qr!\s*(</?$blockElementsRe\b$attrsRe/?>)\s*!;
|
||||
# block tag it may have attributes, and spaces before/after tag.
|
||||
my $trimElementsRe = qr!\s*(</?(?:$blockElements)\b(?:[^>/"]+|"[^"]*")*/?>)\s*!i;
|
||||
|
||||
## verbose debugging.
|
||||
#say $trimElementsRe;
|
||||
#while( $text =~ /$trimElementsRe/g){
|
||||
# say "match: [$&]";
|
||||
# next if $& eq $1;
|
||||
# say "[$&] => [$1]";
|
||||
#}
|
||||
|
||||
# trim spaces before/after block tags. also <br>,<br/>,</br>
|
||||
|
Loading…
Reference in New Issue
Block a user