Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

There is no way to comment out a part of code #40

Open
banczi opened this issue Jun 23, 2015 · 1 comment
Open

There is no way to comment out a part of code #40

banczi opened this issue Jun 23, 2015 · 1 comment

Comments

@banczi
Copy link
Contributor

banczi commented Jun 23, 2015

hashtag in description doesn't work

@danielpacak
Copy link
Contributor

This is a good one. The problem we have here is that in Gherkin comments begin with zero or more spaces, followed by a hash sign (#) and some amount of text. On the other hand, in markdown, a hash sign (#) denotes a level 1 heading.

Currently FeatureBook assumes that the whole description is written in markdown. Therefore the comments you put are parsed and interpreted as level 1 headings.

Feature: Adding comments

  Visible line 1
  # Commented line 1
  Visible line 2
  # Commented line 2

  Scenario: foo

Now the funny part is, whether we parse markdown in FeatureBoor or not, Gherkin parser fails with the example above. However it can handle the following spec:

Feature: Adding comments

  Visible line 1
  Visible line 2  
  # Commented line 1
  # Commented line 2

  Scenario: foo

Don't get fooled by the syntax highlighter used by GitHub. It works fine but it's not using a parser under the covers.

In other words, if you comment out consecutive lines in the description it's fine for Gherkin, but it fails when comments are used interchangeably with description text. @banczi can you check what's the official syntax for using comments in Gherkin and prepare some test specs we should support? This might be a bug in Gherkin node package that we use.

@danielpacak danielpacak self-assigned this Feb 6, 2016
@danielpacak danielpacak removed their assignment Oct 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants