asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.13k stars 500 forks source link

line break in theme attribute "with_email" not working any more #2519

Closed pykereaper closed 2 months ago

pykereaper commented 2 months ago

I'm in the progress of upgrading from org.asciidoctor.jvm.pdf 3.3.2 to 4.0.2.
All in all, the progress went relatively smoothly with only minor changes to make. However, there's one thing I'm missing.

I'm using this setting in my custom theme:

title-page:
  authors:
    content:
      with_email: "{author}\n{email}"

Notice the \n to make a line break. This worked flawlessly in 3.3.2. In 4.0.2 this one produces only a space character, but not a newline. Inserting unicode chars doesn't work either.

Is it still possible in 4.0.2 to define a line break?

mojavelinux commented 2 months ago

The correct syntax is as follows:

extends: default
title-page:
  authors:
    content:
      with_email: |
        {author} +
        {email}

or

extends: default
title-page:
  authors:
    content:
      with_email: "{author} +\n{email}"

The value supports inline AsciiDoc and to make a hardbreak in a line of AsciiDoc, it requires +\n. This change was introduced in Asciidoctor PDF 2 by #1642.

If you need additional support, please direct your questions to the project chat at https://chat.asciidoctor.org.

pykereaper commented 1 month ago

Thank you so much for the quick response! Will keep the chat in mind for next time! :+1: