summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
347ff57)
Code and links are encoded with Markdown syntax in recent caniuse comments.
Some simple regular expressions will suffice for this subset.
+sub formatnotes {
+ my @html = @_;
+ for (@html) {
+ s/\h* $//gmx; # trailing whitespace
+ s/(?<= [^.\n]) $/./gmx; # consistently end each line by a period
+ Entity($_);
+ s{ ` ([^`]*) ` }{<code>$1</code>}gx;
+ s{ \[ ([^]]*) \] \( ([^)]*) \) }{<a href="$2">$1</a>}gx;
+ }
+ return @html;
+}
+
sub saytitlecol {
my ($id) = @_;
my $row = $caniuse->{data}->{$id};
sub saytitlecol {
my ($id) = @_;
my $row = $caniuse->{data}->{$id};
);
} $row->{title};
print '<div class=aside>';
);
} $row->{title};
print '<div class=aside>';
- s/\.?$/./, print "<p>$_</p>" for map { ref $_ ? @$_ : $_ || () }
- Entity($row->{description}),
- map { s/\s*\n/\n<br>/g; $_ } $row->{notes};
+ print "<p>$_</p>"
+ for formatnotes($row->{description}, $row->{notes} || ());
printf 'Resources: %s.', join(', ', map {
sprintf '<a href="%s">%s</a>', EscapeHTML($_->{url}), $_->{title}
} @$_) for grep { @$_ } $row->{links} // ();
printf 'Resources: %s.', join(', ', map {
sprintf '<a href="%s">%s</a>', EscapeHTML($_->{url}), $_->{title}
} @$_) for grep { @$_ } $row->{links} // ();