asciidoctor / asciidoctorj-pdf

AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
Apache License 2.0
35 stars 17 forks source link

Section hierarchy is wrong when section text starts with number #98

Closed luisfcorreia closed 7 months ago

luisfcorreia commented 7 months ago

Hi,

during our new iteration on generating a PDF for documentation, we discovered if a section starts with a number, the converter/generator considers it as a section number, not a section title.

We're creating the PDF from code on Java code: Asciidoctor asciidoctor = Asciidoctor.Factory.create(); asciidoctor.requireLibrary("asciidoctor-diagram"); asciidoctor.convertFile(documentationAdocFile, asciiDoctorOptions); asciidoctor.shutdown();

The error occours in this line

=== 9003-GPOC

if we add any other caracter before, no error occours

=== º9003-GPOC

The following is an edited .adoc intermediate file:


:toc: left
:backend: pdf
:doctitle: XPTO - Documentação
:doctype: book
:icons: font
:numbered:
:sectanchors:
:sectlink:
:docinfo:
:source-highlighter: highlightjs
:toclevels: 3
:revnumber: 0.0.2-FORMACAO-XPTO
:hardbreaks:
:chapter-label: Chapter
:version-label: Versão
:!allow-uri-read:
:!data-uri:

= *XPTO - Documentação*

:toc-title: Índice
:data-uri: 
:imagesdir: 
:outlinelevels: 3

= *XPTO* - *Formação*

WARNING: DEMOnstração

== Introdução

Pseudo-projecto usado para formação de automação de testes

== *Funcionalidades*

[[9003-GPOC-Uso-da-tag-no-doc---Teste-1, 9003-GPOC-Uso da tag no-doc - Teste 1]]
=== 9003-GPOC-Uso da tag no-doc - Teste 1* 
****
TIP: *Como* administrador do Showcase do projeto XPTO
*Quero* realizar o registo de férias para data pretendida
*Para* o pedido ser registado na base de dados
****

==== Cenário: Registar um pedido de férias (Cenario 2)

****
Dado ::
==========

que sou administrador do Showcase do projeto XPTO
==========

E ::
==========

estou autenticado
==========

Quando ::
==========

registo o pedido de férias para data pretendida
==========

Então ::
==========

o pedido férias é registado na base de dados
==========

****
luisfcorreia commented 7 months ago

adding a bit more info, we use a cukedoctor.properties with the following content:

sections

title.features = Funcionalidades title.summary = Sum\u00e1rio title.scenario = Cen\u00e1rio

abelsromero commented 7 months ago

I could get the behavior playing with the manual id within [[ ]], but not with the actual section titles. But this is not a malfunction, ids cannot start with a number, same as anchors https://docs.asciidoctor.org/asciidoc/latest/attributes/id/#anchor.

Btw, I am not familiar with cukedoctor, but maybe it's doing some extra manipulation? The example file is not valid (for example, 2 level 0 sections, attributes at the beginning)...maybe I am missing something?

luisfcorreia commented 7 months ago

I'm still analysing the issue. It seems that we should have empty lines "around" sections, which cukedoctor-converter isn't placing.

will close the issue if problems are elsewhere

luisfcorreia commented 7 months ago

2 "level 0 sections" are ignored, that's not the issue

luisfcorreia commented 7 months ago

Closing as problem was found ans it not related to this project