Re: Multi-line attributes and PDF generation
Posted by
mojavelinux on
Nov 26, 2018; 12:54am
URL: https://discuss.asciidoctor.org/Multi-line-attributes-and-PDF-generation-tp5703p6611.html
You need to apply substitutions to the value. You can do that using:
doc.apply_subs doc.attr('response-contact'), [:post_replacements]
You can apply whatever substitutions you want applied.
Cheers,
-Dan
On Tue, Jun 27, 2017 at 8:28 AM joster [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
I'm generating a custom title page in asciidoctor-pdf by monkey-patching the layout_title_page function. One of the elements that I need to use is a multi-line attribute from the document. It looks something like this:
:response-contact: W. Witch + \
Magic Sleigh Corp AG + \
Secrit Projjects Dept. + \
Narnia, Land of + \
Project ref.: some string + \
Offer Number: ATS12345678
When I use it in the body of the document, it's fine, and renders as expected. When I use it directly in my monkey-patched layout_title_page function via doc.attr 'response-contact', however, it still has the plus signs at the end of each line:
W. Witch +
Magic Sleigh Corp AG +
Secrit Projjects Dept. +
Narnia, Land of +
Project ref.: some string +
Offer Number: ATSDDMMYYYY
I could of course just strip them out myself, but that seems hackish. I'm sure there's a better way to do this, right?
--