Skip to content

Commit

Permalink
asciidoc: manage empty cells in tablecells option
Browse files Browse the repository at this point in the history
fixes #343
  • Loading branch information
jnavila authored and mquinson committed Dec 23, 2021
1 parent 7fe0be4 commit 85403ec
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ __ __/ _ \ / /_ / /_
\_/ \___(_)___/ \___/ (unreleased)


Asciidoc:
* Support empty cells in tablecells mode (GitHub's #343 - J.N. Avila)

Yaml:
* New option "paths" to select the full paths to extract.
The old "key" option (that allows to select any path ending with
Expand Down
4 changes: 3 additions & 1 deletion lib/Locale/Po4a/AsciiDoc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,9 @@ sub parse {
shift @texts;
my @parts = map { ( $_, shift @texts ) } @seps;
foreach my $part (@parts) {
if ( !$part ) { next }
if ( not defined $part ) {
# allows concatenation and will be stripped anyway
$part = " "; }
if ( $part =~ /\|$/ ) {

# this is a cell separator. End the previous cell
Expand Down
6 changes: 6 additions & 0 deletions t/fmt/asciidoc/TablesCells.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ I am a paragraph styled with the lead attribute.
[.lead]
I am a paragraph styled with the lead attribute.
|===

.Empty cells
|===
|0|
||
|===
6 changes: 6 additions & 0 deletions t/fmt/asciidoc/TablesCells.norm
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ I am a paragraph styled with the lead attribute.
[.lead]
I am a paragraph styled with the lead attribute.
|===

.Empty cells
|===
|0|
| |
|===
12 changes: 12 additions & 0 deletions t/fmt/asciidoc/TablesCells.po
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,15 @@ msgstr ""
"\n"
"[.LEAD]\n"
"I AM A PARAGRAPH STYLED WITH THE LEAD ATTRIBUTE."

#. type: Block title
#: TablesCells.adoc:143
#, no-wrap
msgid "Empty cells"
msgstr "EMPTY CELLS"

#. type: Table
#: TablesCells.adoc:145
#, no-wrap
msgid "0"
msgstr "0"
12 changes: 12 additions & 0 deletions t/fmt/asciidoc/TablesCells.pot
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,15 @@ msgid ""
"[.lead]\n"
"I am a paragraph styled with the lead attribute."
msgstr ""

#. type: Block title
#: TablesCells.adoc:143
#, no-wrap
msgid "Empty cells"
msgstr ""

#. type: Table
#: TablesCells.adoc:145
#, no-wrap
msgid "0"
msgstr ""
6 changes: 6 additions & 0 deletions t/fmt/asciidoc/TablesCells.trans
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ I AM A PARAGRAPH STYLED WITH THE LEAD ATTRIBUTE.
[.LEAD]
I AM A PARAGRAPH STYLED WITH THE LEAD ATTRIBUTE.
|===

.EMPTY CELLS
|===
|0|
| |
|===

0 comments on commit 85403ec

Please sign in to comment.