rmpestano / cukedoctor

BDD living documentation using Cucumber and Asciidoctor: https://goo.gl/Yp3NiU
https://rmpestano.github.io/cukedoctor/
Apache License 2.0
122 stars 23 forks source link

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

Closed luisfcorreia closed 10 months ago

luisfcorreia commented 10 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.

Most specifically, if a Feature name starts with a number...

We're creating the PDF from code, using along many other things cukedoctor-converter

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
==========

****

NOTE: this was previously also opened in asciidoctorj-pdf as an issue https://github.com/asciidoctor/asciidoctorj-pdf/issues/98

luisfcorreia commented 10 months ago

Adding a bit into the issue, a friend just suggested the following, adding newlines in specific places prevents the error from occouring and follows asciidoc specification.

An AsciiDoc document is a series of blocks stacked on top of one another (by line). These blocks are typically offset from one another by empty lines (though these may be optional in certain circumstances).

Apparently cukedoctor-converter isn't following this convention (empty lines between blocks).

I've went through the code myself but can't figure out how to add lines in "public CukedoctorConverter renderFeatures(List features)"


[[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
****
luisfcorreia commented 10 months ago

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