question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Output format error if single quote used in feature definition

See original GitHub issue

Hello,

I know it’s probably not a common use case in English, but in French we often need to use single quotes as separator between words. So it’s difficult to avoid them in feature definition and I encountered a problem with the documentation generation with the following example :

# language: fr
Fonctionnalité: Parcours de recherche d'un article

  Scénario: Recherche d'un article connu
	  Etant donné que je connais déjà l'article
	  Lorsque je le cherche dans les rayons
	  Alors je le trouve à sa place

The single quote in d’un is causing a mess during generation. And the resulting html report could be seen here : https://gregorybevan.github.io/sbt-with-cucumber/cucumber.html

It seems that the problem comes from the string Parcours-de-recherche-d’un-article in the generated .adoc
https://gregorybevan.github.io/sbt-with-cucumber/cucumber.adoc

I have already checked that it’s not linked to the language of the feature file.

Sample project available here

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rmpestanocommented, Jul 21, 2022

Hey @rdlopes, that’s amazing, thank you!

1reaction
rmpestanocommented, Nov 22, 2020

Hi @GregoryBevan, I’ve played a bit with your sample project (thanks for that) but couldn’t even make it work with pure Asciidoctor.

The main issue with single quotes is on the anchor link:

[[Parcours-de-recherche-d'un-article, Parcours de recherche d'un article]]
=== *Parcours de recherche d'un article*

Asciidoctor use single quotes to enable variable substitutions in links/cross references but even escaping it with \' didn’t work, still breaks the rendering:

Screenshot 2020-11-22 at 19 08 35

On command line I get a warn:

AMSrpestano-C02Z409YLVCG:test rpestano$ asciidoctor test.adoc 
asciidoctor: WARNING: test.adoc: line 59: section title out of sequence: expected level 2, got level 3

If someone knows how to make cross references work with single quotes, following is the adoc file I’m using:

:toc: right
:backend: html5
:doctitle: Doc Title
:doctype: book
:icons: font
:!numbered:
:!linkcss:
:sectanchors:
:sectlink:
:docinfo:
:source-highlighter: highlightjs
:toclevels: 3
:hardbreaks:
:chapter-label: Chapter
:version-label: Version

= *Doc Title*

== *Summary*
[cols="12*^m", options="header,footer"]
|===
3+|Scenarios 7+|Steps 2+|Features: 1

|[green]#*Passed*#
|[red]#*Failed*#
|Total
|[green]#*Passed*#
|[red]#*Failed*#
|[purple]#*Skipped*#
|[maroon]#*Pending*#
|[yellow]#*Undefined*#
|[blue]#*Missing*#
|Total
|Duration
|Status

12+^|*<<Parcours-de-recherche-d\'un-article>>*
|1
|0
|1
|3
|0
|0
|0
|0
|0
|3
|009ms
|[green]#*passed*#
12+^|*Totals*
|1|0|1|3|0|0|0|0|0|3 2+|009ms
|===

== *Features*

[[Parcours-de-recherche-d\'un-article, Parcours de recherche d\'un article]]
=== *Parcours de recherche d\'un article*

==== Scenario: Recherche dune article connu

==========
Given ::
je connais déjà l'article icon:thumbs-up[role="green",title="Passed"] [small right]#(009ms)#
When ::
je le cherche dans les rayons icon:thumbs-up[role="green",title="Passed"] [small right]#(000ms)#
Then ::
je le trouve à sa place icon:thumbs-up[role="green",title="Passed"] [small right]#(000ms)#
==========

Read more comments on GitHub >

github_iconTop Results From Across the Web

“Double Quotes” vs 'Single Quotes' vs `Backticks` in JavaScript
In JavaScript, single quotes ( '' ) and double quotes ( “” ) are used to create string literals. Most developers use single...
Read more >
What do single quotes do in C++ when used on multiple ...
A multicharacter literal has type int and implementation-defined value. ... if you don't use up all 4 characters, the result becomes wrong below....
Read more >
about Quoting Rules - PowerShell | Microsoft Learn
Describes rules for using single and double quotation marks in PowerShell.
Read more >
How to Escape Single Quotes in SQL - Database Star
When you are working with text values in SQL, you use single quote characters. This could be when you're selecting them: SELECT 'Database...
Read more >
Single, Double, and Triple Quotes in Python | by Yong Cui
How can we fix this error? One is to escape the single quote by placing a backslash before it. The other is to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found