asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
322 stars 97 forks source link

Quotes causes entire document to be italicized in pdf output #428

Open codeprefect opened 2 years ago

codeprefect commented 2 years ago

This is an example issue. Use just the headings and fill out all necessary information. Screenshots & Files and Additional Context are optional.

Description

I have a document that contains two quotes in the same section, but when I exported the document to PDF, the entire document became italicized. Removing the second quote block seems to make the italicization go away, but I definitely will have more than one quote in the document.

System Information

You can find the VSCode and OS information under Help -> About. To check the extension information go to the extension browser (CTRL+SHIFT+X, Mac CMD+SHIFT+X). OS: MacOS Big Sur 11.2.3 (20D91) VS Code:

Version: 1.59.0
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:14:40.191Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.3.0

AsciiDoc: v2.8.9 wkhtmltopdf: 0.12.6 (with patched qt)

To Reproduce

Steps to reproduce the issue:

  1. Create a new asciidoc document and paste the text below
= This is header
Author <mubarakadeimam@gmail.com>
version, 2021-08-16: testing
:attributes:

== This is a section
Hello, I am just putting this here as a placeholder

[quote]
This is the first quote

Another placeholder text between the quotes to better highlight the problem

[quote]
Here is the second quote, commenting out this quote will remove the italics on the whole document
  1. Type FN + F1, and click AsciiDoc: Export document to PDF
  2. Check the PDF output, the entire document is italicized.
  3. Remove/Comment out the second quote block
  4. Repeat Step 2
  5. Check the PDF output, the document is normal.
  6. Optional: convert both versions to HTML using AsciiDoc: Save HTML Document, the italics issue does not occur here.

Screenshots & Files

Screenshot 2021-08-16 at 04 00 53 Screenshot 2021-08-16 at 04 14 25 Screenshot 2021-08-16 at 04 15 07 Screenshot 2021-08-16 at 04 14 10 Screenshot 2021-08-16 at 04 14 49 Screenshot 2021-08-16 at 04 24 50

Additional Context

This error is only applicable to the wkhtmltopdf export route. I am constraint to using this approach because asciidoctor-pdf fails to render my kroki images.

Further investigation has revealed that this is an issue with wkhtmltopdf/wkhtmltopdf#5067

danyill commented 2 years ago

Sorry about this difficulty and thanks for filing an issue.

See #239 for some thoughts around wkhtmltopdf. We really need to replace it with a tool better suited to Asciidoc IMHO. Sadly I can't even run your example without getting considerable error output from wkhtmltopdf.

Upstream is packaging the binaries in a manner that will no longer work with the way they are installed here (they are per distribution installers, we rely on binaries being available for the architecture) so updating wkhtmltopdf is not a readily available option.

I guess the only workaround I can recommend for now is to save as HTML and then print to pdf in google chrome, or alternatively to install asciidoctor-web-pdf (which has binary releases) and use this to prepare a PDF.

I have a prototype for replacing wkhtmltopdf with asciidoctor-web-pdf in this extension. Hopefully I can finish it soon. I've opened an issue for the replacement, see #433