Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent handling of literallayout block when converting DocBook (db) to Word (docx) #6610

Closed
mmatrosov opened this issue Aug 11, 2020 · 0 comments

Comments

@mmatrosov
Copy link

mmatrosov commented Aug 11, 2020

Take this doc.db file:

<preface>
<title></title>
<literallayout class="monospaced">Indented in adoc
literallayout in db</literallayout>
<screen>Listing in adoc
screen in db</screen>
<informaltable frame="all" rowsep="1" colsep="1">
<tgroup cols="2">
<colspec colname="col_1" colwidth="50*"/>
<colspec colname="col_2" colwidth="50*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>1</simpara></entry>
<entry align="left" valign="top"><simpara>2</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><literallayout class="monospaced">Indented in adoc
literallayout in db</literallayout></entry>
<entry align="left" valign="top"><screen>Listing in adoc
screen in db</screen></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</preface>

Run this command:

pandoc.exe -s doc.db -o output.docx

Open output.docx in Word:

image

See how:

  • Line breaks are missing for literallayout block in the table, while they are preserved for literallayout block outside the table and for screen block in the table
  • literallayout block in the table has "Compact" style, while literallayout block outside the table and all other blocks have "Source Code" style

PS I discovered this issue while converting from AsciiDoc to Word via DocBook. literallayout block is generated by asciidoctor from the indented code block. screen block is generated from [listing] block. Here is the source adoc file, if you are interested:

  Indented in adoc
  literallayout in db
  outside the table

----
Listing in adoc
screen in db
outside the table
----

|===
| 1 | 2
a|
  Indented in adoc
  literallayout in db
  inside the table
a|----
Listing in adoc
screen in db
inside the table
----
|===

Generated with the following command:

asciidoctor -d book -s --backend docbook --out-file doc.db input.adoc
@jgm jgm closed this as completed in 5d4932d Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant