[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7716] HTML.pm letters labelling enumerated list items
From: |
gavinsmith0123 |
Subject: |
[7716] HTML.pm letters labelling enumerated list items |
Date: |
Fri, 14 Apr 2017 04:59:27 -0400 (EDT) |
Revision: 7716
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7716
Author: gavin
Date: 2017-04-14 04:59:26 -0400 (Fri, 14 Apr 2017)
Log Message:
-----------
HTML.pm letters labelling enumerated list items
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Convert/HTML.pm
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2017-04-14 07:29:20 UTC (rev 7715)
+++ trunk/ChangeLog 2017-04-14 08:59:26 UTC (rev 7716)
@@ -1,5 +1,13 @@
2017-04-14 Gavin Smith <address@hidden>
+ * tp/Texinfo/Convert/HTML.pm (_convert_enumerate_command):
+ Handle case of labelling list entries with letters, using 'type'
+ and 'start' attributes on the <ol> tag. This worked in the
+ makeinfo implementation from Texinfo 4.13 and earlier. Report
+ from Andreas Schwab.
+
+2017-04-14 Gavin Smith <address@hidden>
+
* tp/Texinfo/Convert/HTML.pm (_convert_enumerate_command):
Check if the 'enumerate_specification' is defined, rather than
true, as if the value is '0', this is considered to be false.
Modified: trunk/tp/Texinfo/Convert/HTML.pm
===================================================================
--- trunk/tp/Texinfo/Convert/HTML.pm 2017-04-14 07:29:20 UTC (rev 7715)
+++ trunk/tp/Texinfo/Convert/HTML.pm 2017-04-14 08:59:26 UTC (rev 7716)
@@ -2981,14 +2981,25 @@
if ($content eq '') {
return '';
}
- if (defined $command->{'extra'}{'enumerate_specification'}
- and $command->{'extra'}{'enumerate_specification'} =~ /^\d*$/
- and $command->{'extra'}{'enumerate_specification'} ne '1') {
- return "<ol start=\"$command->{'extra'}{'enumerate_specification'}\">\n"
- . $content . "</ol>\n";
- } else {
- return "<ol>\n" . $content . "</ol>\n";
+ my $specification = $command->{'extra'}{'enumerate_specification'};
+ if (defined $specification) {
+ my ($start, $type);
+ if ($specification =~ /^\d*$/ and $specification ne '1') {
+ $start = $specification;
+ } elsif ($specification =~ /^[A-Z]$/) {
+ $start = 1 + ord($specification) - ord('A');
+ $type = 'A';
+ } elsif ($specification =~ /^[a-z]$/) {
+ $start = 1 + ord($specification) - ord('a');
+ $type = 'a';
+ }
+ if (defined $type and defined $start) {
+ return "<ol type=\"$type\" start=\"$start\">\n" . $content . "</ol>\n";
+ } elsif (defined $start) {
+ return "<ol start=\"$start\">\n" . $content . "</ol>\n";
+ }
}
+ return "<ol>\n" . $content . "</ol>\n";
}
$default_commands_conversion{'enumerate'} = \&_convert_enumerate_command;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7716] HTML.pm letters labelling enumerated list items,
gavinsmith0123 <=