[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 29 Sep 2024 10:05:29 -0400 (EDT) |
branch: master
commit bd6326bdeb983fa07608892b09591fcc0adb48de
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Jul 3 06:43:53 2024 +0200
* tp/Texinfo/Convert/HTML.pm (_convert_sp_command),
tp/Texinfo/Convert/Plaintext.pm (_convert),
tp/Texinfo/XS/convert/convert_html.c (convert_sp_command): consider
empty @sp argument to be 1, to have an output more consistent with
Texinfo TeX.
* tp/Texinfo/Convert/LaTeX.pm (_convert): consider empty @sp argument
to be empty.
* tp/Makefile.tres, tp/t/converters_tests.t
(sp_empty_lines_1_no_arg_zero): test of @sp, @sp 0 and @sp 1 with
diverse possibilities for empty lines.
---
ChangeLog | 15 +
tp/Makefile.tres | 1 +
tp/Texinfo/Convert/HTML.pm | 10 +-
tp/Texinfo/Convert/LaTeX.pm | 13 +-
tp/Texinfo/Convert/Plaintext.pm | 21 +-
tp/Texinfo/XS/convert/convert_html.c | 30 +-
tp/t/converters_tests.t | 50 ++
.../sp_empty_lines_1_no_arg_zero.pl | 824 ++++++++++++++++++++
.../res_parser/formatting_chm/chapter.html | 3 +
.../res_parser/formatting_chm/formatting.html | 2 +
.../EPUB/xhtml/chapter.xhtml | 3 +
.../EPUB/xhtml/formatting.xhtml | 2 +
.../res_parser/formatting_html32/formatting.html | 5 +
.../formatting_html_no_split/formatting.html | 3 +
.../res_parser/formatting_info/formatting.info | 832 +++++++++++----------
.../res_parser/formatting_latex/formatting.tex | 10 +-
.../res_parser/formatting_plaintext/formatting.txt | 799 ++++++++++----------
.../formatting_regions/formatting_regions.html | 5 +
.../res_parser/formatting_xhtml/formatting.html | 5 +
.../formatting_enable_encoding/formatting.html | 5 +
.../EPUB/xhtml/chapter.xhtml | 3 +
.../EPUB/xhtml/formatting.xhtml | 2 +
.../res_parser/formatting_exotic/chapter.html | 3 +
.../res_parser/formatting_fr/formatting.html | 5 +
.../res_parser/formatting_fr_icons/formatting.html | 5 +
.../res_parser/formatting_fr_info/formatting.info | 832 +++++++++++----------
.../formatting.info | 832 +++++++++++----------
.../formatting.info | 832 +++++++++++----------
.../formatting_inline_css/formatting.html | 4 +
.../res_parser/formatting_mathjax/formatting.html | 5 +
.../formatting_numerical_entities/formatting.html | 5 +
.../formatting.txt | 799 ++++++++++----------
.../formatting_sort_element_counts/formatting.html | 3 +
.../formatting_texi2html/formatting.html | 5 +
.../formatting_texi2html_nodes/chapter.html | 3 +
.../formatting_texi2html_nodes/index.html | 2 +
.../formatting_weird_quotes/formatting.html | 5 +
.../res_parser/formatting_singular/chapter.html | 3 +
38 files changed, 3493 insertions(+), 2493 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c3af2f9cd6..6e7b246399 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2024-07-03 Patrice Dumas <pertusus@free.f>
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_sp_command),
+ tp/Texinfo/Convert/Plaintext.pm (_convert),
+ tp/Texinfo/XS/convert/convert_html.c (convert_sp_command): consider
+ empty @sp argument to be 1, to have an output more consistent with
+ Texinfo TeX.
+
+ * tp/Texinfo/Convert/LaTeX.pm (_convert): consider empty @sp argument
+ to be empty.
+
+ * tp/Makefile.tres, tp/t/converters_tests.t
+ (sp_empty_lines_1_no_arg_zero): test of @sp, @sp 0 and @sp 1 with
+ diverse possibilities for empty lines.
+
2024-07-02 Patrice Dumas <pertusus@free.f>
* tp/Texinfo/Convert/Plaintext.pm (_convert_def_line, _convert):
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index aab6adaab0..5360303070 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -284,6 +284,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/converters_tests/simplest_test_prefix/res_latex \
t/results/converters_tests/simplest_test_prefix/res_xml \
t/results/converters_tests/some_at_commands_in_ref_nodes.pl \
+ t/results/converters_tests/sp_empty_lines_1_no_arg_zero.pl \
t/results/converters_tests/sp_in_example.pl \
t/results/converters_tests/spaces_in_empty_node_names.pl \
t/results/converters_tests/spaces_in_node_names.pl \
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 67f50cc849..3e63fa7779 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -5486,15 +5486,19 @@ sub _convert_sp_command($$$$)
my $command = shift;
my $args = shift;
+ my $sp_nr = 1;
if (defined($command->{'extra'})
- and defined($command->{'extra'}->{'misc_args'})
- and defined($command->{'extra'}->{'misc_args'}->[0])) {
- my $sp_nr = $command->{'extra'}->{'misc_args'}->[0];
+ and $command->{'extra'}->{'misc_args'}) {
+ $sp_nr = $command->{'extra'}->{'misc_args'}->[0];
+ }
+ if ($sp_nr > 0) {
if (in_preformatted_context($self) or in_string($self)) {
return "\n" x $sp_nr;
} else {
return ($self->get_info('line_break_element')."\n") x $sp_nr;
}
+ } else {
+ return '';
}
}
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index d891231fd6..114b1a9342 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -4116,17 +4116,14 @@ sub _convert($$)
$result .= "\\noindent{}";
return $result;
} elsif ($cmdname eq 'sp') {
- my $sp_nr = 1;
+ my $sp_nr = '';
if ($element->{'extra'}
- and $element->{'extra'}->{'misc_args'}
- and $element->{'extra'}->{'misc_args'}->[0]) {
- # this useless copy avoids perl changing the type to integer!
+ and $element->{'extra'}->{'misc_args'}) {
$sp_nr = $element->{'extra'}->{'misc_args'}->[0];
}
- # FIXME \vskip is a TeX primitive, so the syntax seems to be
- # different from LaTeX, and some people warn against using
- # TeX primitives. However there is no obvious corresponding
- # command in LaTeX, except for adding enough \\.
+ # NOTE \vskip is a TeX primitive that does what we need here,
+ # stop any paragraph and add vertical space.
+ # The code output here is the same as the code used in Texinfo TeX.
$result .= "\\vskip $sp_nr\\baselineskip %\n";
return $result;
} elsif ($cmdname eq 'need') {
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index ab08e1032c..cb6f5add82 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -3680,21 +3680,20 @@ sub _convert($$)
_add_lines_count($self, $lines_count);
return '';
} elsif ($cmdname eq 'sp') {
- # FIXME No argument should mean 1, not 0, to check
+ _stream_output($self,
+ add_pending_word($formatter->{'container'}),
+ $formatter->{'container'});
+ my $sp_nr = 1;
if ($element->{'extra'}
and $element->{'extra'}->{'misc_args'}) {
+ $sp_nr = $element->{'extra'}->{'misc_args'}->[0];
+ }
+ for (my $i = 0; $i < $sp_nr; $i++) {
_stream_output($self,
- add_pending_word($formatter->{'container'}),
- $formatter->{'container'});
- # this useless copy avoids perl changing the type to integer!
- my $sp_nr = $element->{'extra'}->{'misc_args'}->[0];
- for (my $i = 0; $i < $sp_nr; $i++) {
- _stream_output($self,
- end_line($formatter->{'container'}),
- $formatter->{'container'});
- }
- delete $self->{'text_element_context'}->[-1]->{'counter'};
+ end_line($formatter->{'container'}),
+ $formatter->{'container'});
}
+ delete $self->{'text_element_context'}->[-1]->{'counter'};
return;
} elsif ($cmdname eq 'contents') {
my $sections_list;
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index ae092db2cc..e0f78eab02 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -11125,25 +11125,27 @@ convert_sp_command (CONVERTER *self, const enum
command_id cmd,
{
const STRING_LIST *misc_args = lookup_extra_misc_args (element,
AI_key_misc_args);
+ unsigned int sp_nr = 1;
+ int i;
+
if (misc_args && misc_args->number > 0)
{
- int i;
const char *sp_number_string = misc_args->list[0];
- unsigned int sp_nr = strtoul (sp_number_string, NULL, 10);
+ sp_nr = strtoul (sp_number_string, NULL, 10);
+ }
- if (html_in_preformatted_context (self) || html_in_string (self))
- {
- for (i= 0; i < sp_nr; i++)
- text_append_n (result, "\n", 1);
- }
- else
+ if (html_in_preformatted_context (self) || html_in_string (self))
+ {
+ for (i = 0; i < sp_nr; i++)
+ text_append_n (result, "\n", 1);
+ }
+ else
+ {
+ for (i = 0; i < sp_nr; i++)
{
- for (i= 0; i < sp_nr; i++)
- {
- text_append_n (result, self->line_break_element.string,
- self->line_break_element.len);
- text_append_n (result, "\n", 1);
- }
+ text_append_n (result, self->line_break_element.string,
+ self->line_break_element.len);
+ text_append_n (result, "\n", 1);
}
}
}
diff --git a/tp/t/converters_tests.t b/tp/t/converters_tests.t
index ed774ef0d3..36c1067812 100644
--- a/tp/t/converters_tests.t
+++ b/tp/t/converters_tests.t
@@ -446,6 +446,56 @@ sp after para
@sp 1
@end example
'],
+# NOTE comparison of TeX/LaTeX output with Plaintext show differences.
+# In TeX/LaTeX with @sp 1, and irrespective of the number of empty line
+# the vertical space is always the same, interparagraph small space + 1
+# character. In plaintext trailing empty lines do not produce an empty
+# line (as in TeX), but leading empty line do. Also, @sp 0 without empty
+# lines lead to no empty line between paragraphs in Plaintext.
+# This is not of practical concern, as both @sp 0 (and @sp without
+# argument) behaviour are undefined, and both TeX and Plaintext output
+# are consistent with the documentation. Also @sp should rarely, if ever,
+# be used in Plaintext.
+['sp_empty_lines_1_no_arg_zero',
+'A
+
+A010
+@sp 1
+A110
+
+@sp 1
+A011
+
+@sp 1
+A111
+
+@sp 1
+
+A000
+@sp 0
+A100
+
+@sp 0
+A001
+
+@sp 0
+A101
+
+@sp 0
+
+A0 0
+@sp
+A1 0
+
+@sp
+A0 1
+
+@sp
+A1 1
+
+@sp
+
+B'],
['line_breaks',
'@documentdescription
a document @* yes!
diff --git a/tp/t/results/converters_tests/sp_empty_lines_1_no_arg_zero.pl
b/tp/t/results/converters_tests/sp_empty_lines_1_no_arg_zero.pl
new file mode 100644
index 0000000000..699b4bfd5a
--- /dev/null
+++ b/tp/t/results/converters_tests/sp_empty_lines_1_no_arg_zero.pl
@@ -0,0 +1,824 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'sp_empty_lines_1_no_arg_zero'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'A
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A010
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '1'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '1'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A110
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '1'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '1'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A011
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '1'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '1'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 10
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A111
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '1'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '1'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 13
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A000
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '0'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '0'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 16
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A100
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '0'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '0'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 19
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A001
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '0'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '0'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 22
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A101
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '0'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'extra' => {
+ 'misc_args' => [
+ '0'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 25
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A0 0
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'source_info' => {
+ 'line_nr' => 28
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A1 0
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'source_info' => {
+ 'line_nr' => 31
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A0 1
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'source_info' => {
+ 'line_nr' => 34
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'A1 1
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'sp',
+ 'source_info' => {
+ 'line_nr' => 37
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'B'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'sp_empty_lines_1_no_arg_zero'} = 'A
+
+A010
+@sp 1
+A110
+
+@sp 1
+A011
+
+@sp 1
+A111
+
+@sp 1
+
+A000
+@sp 0
+A100
+
+@sp 0
+A001
+
+@sp 0
+A101
+
+@sp 0
+
+A0 0
+@sp
+A1 0
+
+@sp
+A0 1
+
+@sp
+A1 1
+
+@sp
+
+B';
+
+
+$result_texts{'sp_empty_lines_1_no_arg_zero'} = 'A
+
+A010
+
+A110
+
+
+A011
+
+
+A111
+
+
+
+A000
+A100
+
+A001
+
+A101
+
+
+A0 0
+A1 0
+
+A0 1
+
+A1 1
+
+
+B';
+
+$result_errors{'sp_empty_lines_1_no_arg_zero'} = [
+ {
+ 'error_line' => '@sp missing argument
+',
+ 'line_nr' => 28,
+ 'text' => '@sp missing argument',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => '@sp missing argument
+',
+ 'line_nr' => 31,
+ 'text' => '@sp missing argument',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => '@sp missing argument
+',
+ 'line_nr' => 34,
+ 'text' => '@sp missing argument',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => '@sp missing argument
+',
+ 'line_nr' => 37,
+ 'text' => '@sp missing argument',
+ 'type' => 'error'
+ }
+];
+
+
+$result_floats{'sp_empty_lines_1_no_arg_zero'} = {};
+
+
+
+$result_converted{'plaintext'}->{'sp_empty_lines_1_no_arg_zero'} = 'A
+
+ A010
+
+ A110
+
+
+ A011
+
+
+ A111
+
+
+ A000
+ A100
+
+ A001
+
+ A101
+
+ A0 0
+
+ A1 0
+
+
+ A0 1
+
+
+ A1 1
+
+
+ B
+';
+
+
+$result_converted{'html_text'}->{'sp_empty_lines_1_no_arg_zero'} = '<p>A
+</p>
+<p>A010
+</p><br>
+<p>A110
+</p>
+<br>
+<p>A011
+</p>
+<br>
+<p>A111
+</p>
+<br>
+
+<p>A000
+</p><p>A100
+</p>
+<p>A001
+</p>
+<p>A101
+</p>
+
+<p>A0 0
+</p><br>
+<p>A1 0
+</p>
+<br>
+<p>A0 1
+</p>
+<br>
+<p>A1 1
+</p>
+<br>
+
+<p>B</p>';
+
+
+$result_converted{'xml'}->{'sp_empty_lines_1_no_arg_zero'} = '<para>A
+</para>
+<para>A010
+</para><sp spaces=" " value="1" line="1"></sp>
+<para>A110
+</para>
+<sp spaces=" " value="1" line="1"></sp>
+<para>A011
+</para>
+<sp spaces=" " value="1" line="1"></sp>
+<para>A111
+</para>
+<sp spaces=" " value="1" line="1"></sp>
+
+<para>A000
+</para><sp spaces=" " value="0" line="0"></sp>
+<para>A100
+</para>
+<sp spaces=" " value="0" line="0"></sp>
+<para>A001
+</para>
+<sp spaces=" " value="0" line="0"></sp>
+<para>A101
+</para>
+<sp spaces=" " value="0" line="0"></sp>
+
+<para>A0 0
+</para><sp></sp>
+<para>A1 0
+</para>
+<sp line=" "></sp>
+<para>A0 1
+</para>
+<sp></sp>
+<para>A1 1
+</para>
+<sp line=" "></sp>
+
+<para>B</para>';
+
+
+$result_converted{'docbook'}->{'sp_empty_lines_1_no_arg_zero'} = '<para>A
+</para>
+<para>A010
+</para><para>A110
+</para>
+<para>A011
+</para>
+<para>A111
+</para>
+
+<para>A000
+</para><para>A100
+</para>
+<para>A001
+</para>
+<para>A101
+</para>
+
+<para>A0 0
+</para><para>A1 0
+</para>
+<para>A0 1
+</para>
+<para>A1 1
+</para>
+
+<para>B</para>';
+
+
+$result_converted{'latex_text'}->{'sp_empty_lines_1_no_arg_zero'} = 'A
+
+A010
+\\vskip 1\\baselineskip %
+A110
+
+\\vskip 1\\baselineskip %
+A011
+
+\\vskip 1\\baselineskip %
+A111
+
+\\vskip 1\\baselineskip %
+
+A000
+\\vskip 0\\baselineskip %
+A100
+
+\\vskip 0\\baselineskip %
+A001
+
+\\vskip 0\\baselineskip %
+A101
+
+\\vskip 0\\baselineskip %
+
+A0 0
+\\vskip \\baselineskip %
+A1 0
+
+\\vskip \\baselineskip %
+A0 1
+
+\\vskip \\baselineskip %
+A1 1
+
+\\vskip \\baselineskip %
+
+B';
+
+1;
diff --git a/tp/tests/coverage/res_parser/formatting_chm/chapter.html
b/tp/tests/coverage/res_parser/formatting_chm/chapter.html
index 9c24dd3d42..cdb754281f 100644
--- a/tp/tests/coverage/res_parser/formatting_chm/chapter.html
+++ b/tp/tests/coverage/res_parser/formatting_chm/chapter.html
@@ -1918,6 +1918,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="f--ile.e--xt"
alt="jk _" %@ in b "">
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="filejk%20_%22%20%25%40.jpg"
alt="altjk _" %@">
</p>
+<br>
<pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
@@ -3022,6 +3023,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="f--ile.e--xt"
alt="jk _" %@ in b "">
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="filejk%20_%22%20%25%40.jpg"
alt="altjk _" %@">
</p>
+<br>
<pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
@@ -4271,6 +4273,7 @@ Invalid use of @':
+
</pre><pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
Ḉ Ḉ a̋ ȧ å a͡
ă ǎ
diff --git a/tp/tests/coverage/res_parser/formatting_chm/formatting.html
b/tp/tests/coverage/res_parser/formatting_chm/formatting.html
index b8a7949d9a..7575019b0d 100644
--- a/tp/tests/coverage/res_parser/formatting_chm/formatting.html
+++ b/tp/tests/coverage/res_parser/formatting_chm/formatting.html
@@ -1901,6 +1901,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="f--ile.e--xt"
alt="jk _" %@ in b "">
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="filejk%20_%22%20%25%40.jpg"
alt="altjk _" %@">
</p>
+<br>
<strong class="author">author</strong><br>
@@ -3007,6 +3008,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="f--ile.e--xt"
alt="jk _" %@ in b "">
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="filejk%20_%22%20%25%40.jpg"
alt="altjk _" %@">
</p>
+<br>
<pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
diff --git
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
index b1034c5b71..edd09338d1 100644
---
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
+++
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/chapter.xhtml
@@ -1918,6 +1918,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="../images/35-f--ile.e--xt"
alt="jk _" %@ in b ""/>
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="../images/36-filejk-__0022-_0025_0040.jpg"
alt="altjk _" %@"/>
</p>
+<br/>
<pre class="displaymath">ü Ü ñ â é ō ì
é Ḕ
@@ -3022,6 +3023,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="../images/47-f--ile.e--xt"
alt="jk _" %@ in b ""/>
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="../images/48-filejk-__0022-_0025_0040.jpg"
alt="altjk _" %@"/>
</p>
+<br/>
<pre class="displaymath">ü Ü ñ â é ō ì
é Ḕ
@@ -4271,6 +4273,7 @@ Invalid use of @':
+
</pre><pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
Ḉ Ḉ a̋ ȧ å a͡
ă ǎ
diff --git
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
index d5eda38a6f..f42e32aba5 100644
---
a/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
+++
b/tp/tests/coverage/res_parser/formatting_epub/formatting_epub_package/EPUB/xhtml/formatting.xhtml
@@ -1901,6 +1901,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="../images/11-f--ile.e--xt"
alt="jk _" %@ in b ""/>
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="../images/12-filejk-__0022-_0025_0040.jpg"
alt="altjk _" %@"/>
</p>
+<br/>
<strong class="author">author</strong><br/>
@@ -3007,6 +3008,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="../images/23-f--ile.e--xt"
alt="jk _" %@ in b ""/>
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="../images/24-filejk-__0022-_0025_0040.jpg"
alt="altjk _" %@"/>
</p>
+<br/>
<pre class="displaymath">ü Ü ñ â é ō ì
é Ḕ
diff --git a/tp/tests/coverage/res_parser/formatting_html32/formatting.html
b/tp/tests/coverage/res_parser/formatting_html32/formatting.html
index 12bea942bd..9622654411 100644
--- a/tp/tests/coverage/res_parser/formatting_html32/formatting.html
+++ b/tp/tests/coverage/res_parser/formatting_html32/formatting.html
@@ -1852,6 +1852,7 @@ html ''
<p><code>@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img src="f--ile.e--xt" alt="jk _" %@ in b
"">
<code>@image{file@verb{:jk _" %@:},,,alt@verb{:jk _" %@:}}</code> <img
src="filejk%20_%22%20%25%40.jpg" alt="altjk _" %@">
</p>
+<br>
<strong>author</strong><br>
@@ -2932,6 +2933,7 @@ html ''
<p><code>@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img src="f--ile.e--xt" alt="jk _" %@ in b
"">
<code>@image{file@verb{:jk _" %@:},,,alt@verb{:jk _" %@:}}</code> <img
src="filejk%20_%22%20%25%40.jpg" alt="altjk _" %@">
</p>
+<br>
<pre>ü Ü ñ â é ō ì é
Ḕ
@@ -4080,6 +4082,7 @@ html ''
<p><code>@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img src="f--ile.e--xt" alt="jk _" %@ in b
"">
<code>@image{file@verb{:jk _" %@:},,,alt@verb{:jk _" %@:}}</code> <img
src="filejk%20_%22%20%25%40.jpg" alt="altjk _" %@">
</p>
+<br>
<pre>ü Ü ñ â é ō ì é
Ḕ
@@ -5158,6 +5161,7 @@ html ''
<p><code>@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img src="f--ile.e--xt" alt="jk _" %@ in b
"">
<code>@image{file@verb{:jk _" %@:},,,alt@verb{:jk _" %@:}}</code> <img
src="filejk%20_%22%20%25%40.jpg" alt="altjk _" %@">
</p>
+<br>
<pre>ü Ü ñ â é ō ì é
Ḕ
@@ -6380,6 +6384,7 @@ Invalid use of @':
+
</pre><pre>ü Ü ñ â é ō ì é
Ḕ
Ḉ Ḉ a̋ ȧ å a͡
ă ǎ
diff --git
a/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html
b/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html
index 91ab5a1a93..178401a452 100644
--- a/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html
+++ b/tp/tests/coverage/res_parser/formatting_html_no_split/formatting.html
@@ -1971,6 +1971,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="f--ile.e--xt"
alt="jk _" %@ in b "">
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="filejk%20_%22%20%25%40.jpg"
alt="altjk _" %@">
</p>
+<br>
<pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
@@ -3075,6 +3076,7 @@ html ''
<p><code class="code">@image{f--ile,aze,az,@verb{:jk _" %@:} @b{in b
"},e--xt}</code> <img class="image" src="f--ile.e--xt"
alt="jk _" %@ in b "">
<code class="code">@image{file@verb{:jk _" %@:},,,alt@verb{:jk _"
%@:}}</code> <img class="image" src="filejk%20_%22%20%25%40.jpg"
alt="altjk _" %@">
</p>
+<br>
<pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
@@ -4324,6 +4326,7 @@ Invalid use of @':
+
</pre><pre class="displaymath">ü Ü ñ â é ō
ì é Ḕ
Ḉ Ḉ a̋ ȧ å a͡
ă ǎ
diff --git a/tp/tests/coverage/res_parser/formatting_info/formatting.info
b/tp/tests/coverage/res_parser/formatting_info/formatting.info
index 276cfa56a7..25bf170f43 100644
--- a/tp/tests/coverage/res_parser/formatting_info/formatting.info
+++ b/tp/tests/coverage/res_parser/formatting_info/formatting.info
@@ -618,6 +618,7 @@ aaa"