Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Respect whitespace in feature descriptions #87

Closed
mattwynne opened this issue Dec 4, 2010 · 4 comments
Closed

Respect whitespace in feature descriptions #87

mattwynne opened this issue Dec 4, 2010 · 4 comments

Comments

@mattwynne
Copy link
Contributor

We've just added a feature to relishapp[1] which passes each Feature's description through a markdown formatter.

The problem I've hit is that gherkin seems to be stripping the whitespace which I'd have expected to be left at the start and end of lines in the description. Whitespace is quite important for markdown formatting: you need to add two spaces to the end of the line to make it write a <br/> tag, and you're probably familiar with four space indents for pre-formatted blocks.

I've added a failing scenario in my fork of gherkin[2] but I'll need some help making it pass, assuming that it's possible and you guys think it's a good idea.

[1] http://relishapp.com/relish/relish/dir/projects/render-description-as-markdown

[2] https://github.com/mattwynne/gherkin/blob/respect-for-whitespace-in-descriptions/features/json_formatter.feature#L278

@mattwynne
Copy link
Contributor Author

To save you having to run it, the feature fails with:

-    "description" => "one line  \nanother line\n    some pre-formatted stuff",
+    "description" => "one line\nanother line\n\nsome pre-formatted stuff",
         "keyword" => "Feature",
            "line" => 1,
            "name" => "Foo"

@mattwynne
Copy link
Contributor Author

I've got this working with the Ruby lexer, but it's going to take some infinite monkey business to get the C lexer working. Any volunteers to help?

@aslakhellesoy
Copy link
Contributor

Attributions. Closed by 6502ce6

@aslakhellesoy
Copy link
Contributor

Good work on this folks - I just released 2.3.2 which has this fix.

bryanl pushed a commit to bryanl/gherkin that referenced this issue Jun 23, 2012
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants