[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (_convert_exdent_com
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (_convert_exdent_command): use command name as class for pre. |
Date: |
Mon, 10 Jan 2022 11:11:10 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 55f2c772e8 * tp/Texinfo/Convert/HTML.pm (_convert_exdent_command): use
command name as class for pre.
55f2c772e8 is described below
commit 55f2c772e8dc7b3cbf3a99a5c91278b6a82b1ab0
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Jan 10 17:11:00 2022 +0100
* tp/Texinfo/Convert/HTML.pm (_convert_exdent_command): use command
name as class for pre.
* tp/Texinfo/Convert/HTML.pm (_convert_center_command): simple
formatting if in_string.
* tp/Texinfo/Convert/HTML.pm (%default_types_conversion): remove
rawpreformatted, the default formatting is right.
---
ChangeLog | 11 +++++++++++
tp/Texinfo/Convert/HTML.pm | 24 +++++++++++++-----------
tp/t/results/coverage/exdent_and_commands.pl | 4 ++--
tp/t/results/coverage/exdent_and_formats.pl | 8 ++++----
4 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c21c016c6f..462ed2649e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-01-10 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_exdent_command): use command
+ name as class for pre.
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_center_command): simple
+ formatting if in_string.
+
+ * tp/Texinfo/Convert/HTML.pm (%default_types_conversion): remove
+ rawpreformatted, the default formatting is right.
+
2022-01-10 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (%css_map, _default_format_heading_text)
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 6e6de15c8c..583ab3e2a7 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -3670,16 +3670,21 @@ sub _convert_exdent_command($$$$)
my $command = shift;
my $args = shift;
- # FIXME do something better with css and span?
+
+ my $arg =
$self->get_pending_formatted_inline_content().$args->[0]->{'normal'};
+
+ if ($self->in_string()) {
+ return $arg ."\n";
+ }
+
+ # FIXME do something with CSS? Currently nothing is defined for exdent
+
my $preformatted = $self->in_preformatted();
- if ($self->in_preformatted() or $self->in_string()) {
- return $self->_convert_preformatted_type($cmdname, $command,
- $args->[0]->{'normal'} ."\n");
+ if ($self->in_preformatted()) {
+ return $self->html_attribute_class('pre', $cmdname).'>'.$arg ."\n</pre>";
} else {
- # ignore alignment information
- return $self->html_attribute_class('p', $cmdname).'>'
- .$args->[0]->{'normal'} ."\n</p>";
+ return $self->html_attribute_class('p', $cmdname).'>'.$arg ."\n</p>";
}
}
@@ -3693,8 +3698,7 @@ sub _convert_center_command($$$$)
my $args = shift;
if ($self->in_string()) {
- return $self->_convert_preformatted_type($cmdname, $command,
- $args->[0]->{'normal'}."\n");
+ return $args->[0]->{'normal'}."\n";
} else {
return $self->html_attribute_class('div', $cmdname).">"
.$args->[0]->{'normal'}."\n</div>";
@@ -4891,7 +4895,6 @@ sub _convert_preformatted_type($$$$)
$content = $self->get_pending_formatted_inline_content().$content;
return '' if ($content eq '');
- return $content if ($type eq 'rawpreformatted');
my $pre_class = $self->_preformatted_class();
@@ -4929,7 +4932,6 @@ sub _convert_preformatted_type($$$$)
}
$default_types_conversion{'preformatted'} = \&_convert_preformatted_type;
-$default_types_conversion{'rawpreformatted'} = \&_convert_preformatted_type;
sub _convert_bracketed_type($$$$) {
my $self = shift;
diff --git a/tp/t/results/coverage/exdent_and_commands.pl
b/tp/t/results/coverage/exdent_and_commands.pl
index e57ce4c5b0..74d5dd0e25 100644
--- a/tp/t/results/coverage/exdent_and_commands.pl
+++ b/tp/t/results/coverage/exdent_and_commands.pl
@@ -457,9 +457,9 @@ $result_converted{'html_text'}->{'exdent_and_commands'} =
'<blockquote>
<div class="example">
<pre class="example">example
-</pre><pre class="example">in exdented protected eol
+</pre><pre class="exdent">in exdented protected eol
</pre><pre class="example">following
-</pre><pre class="example">in exdented a @*
+</pre><pre class="exdent">in exdented a @*
and following
</pre><pre class="example">after exdented
</pre></div>
diff --git a/tp/t/results/coverage/exdent_and_formats.pl
b/tp/t/results/coverage/exdent_and_formats.pl
index d1d9eda102..5a2326290a 100644
--- a/tp/t/results/coverage/exdent_and_formats.pl
+++ b/tp/t/results/coverage/exdent_and_formats.pl
@@ -1906,15 +1906,15 @@ $result_converted{'html_text'}->{'exdent_and_formats'}
= '<div class="example">
<pre class="example"> Example Hoho. TeX .
@.
-</pre><pre class="example">Other line
+</pre><pre class="exdent">Other line
</pre><pre class="example">not exdented
</pre></div>
<div class="example">
-<pre class="example">exdented and dash --- in example
+<pre class="exdent">exdented and dash --- in example
</pre><pre class="example">Not exdented
-</pre><pre class="example">exdented
+</pre><pre class="exdent">exdented
</pre><pre class="example">Not exdented
</pre></div>
@@ -1946,7 +1946,7 @@ quotation2
<pre class="example">Example Hoho.
</pre><div class="example">
<pre class="example">Nested Other line
-</pre><pre class="example">exdented nested other line
+</pre><pre class="exdent">exdented nested other line
</pre></div>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (_convert_exdent_command): use command name as class for pre.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (%css_map, _default_format_heading_text) (_convert_command_simple_block, _convert_exdent_command) (_convert_center_command, _convert_paragraph_type): use class for headings alignement selector. Use _convert_command_simple_block to convert raggedright, flushleft, flushright and group, that output a <div>. Use classes line flushleft-paragraph to align paragraphs.
- Next by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (%css_rules_not_collected, %css_map) (%style_commands_element): format key like other style commands. Use kbd.kbd for the CSS selector for @kbd.
- Previous by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (%css_map, _default_format_heading_text) (_convert_command_simple_block, _convert_exdent_command) (_convert_center_command, _convert_paragraph_type): use class for headings alignement selector. Use _convert_command_simple_block to convert raggedright, flushleft, flushright and group, that output a <div>. Use classes line flushleft-paragraph to align paragraphs.
- Next by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (%css_rules_not_collected, %css_map) (%style_commands_element): format key like other style commands. Use kbd.kbd for the CSS selector for @kbd.
- Index(es):