diff options
-rw-r--r-- | pygments/lexers/other.py | 3 | ||||
-rw-r--r-- | tests/examplefiles/example.feature | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py index 47a4b865..acec8bb1 100644 --- a/pygments/lexers/other.py +++ b/pygments/lexers/other.py @@ -1866,7 +1866,7 @@ class GherkinLexer(RegexLexer): tokens = { 'comments': [ - (r'#.*$', Comment), + (r'^\s*#.*$', Comment), ], 'feature_elements' : [ (step_keywords, Keyword, "step_content_stack"), @@ -1895,6 +1895,7 @@ class GherkinLexer(RegexLexer): ], 'narrative': [ include('scenario_sections_on_stack'), + include('comments'), (r"(\s|.)", Name.Function), ], 'table_vars': [ diff --git a/tests/examplefiles/example.feature b/tests/examplefiles/example.feature new file mode 100644 index 00000000..a26268da --- /dev/null +++ b/tests/examplefiles/example.feature @@ -0,0 +1,16 @@ +# First comment +Feature: My amazing feature + Feature description line 1 + Feature description line 2 + +#comment +Scenario Outline: My detailed scenario #string + Given That <x> is set + When When I <subtract> + Then I should get the <remain#der> + + # indented comment + Examples: + | x | subtract | remain#der | + | 12 | 5\|3 | #73 | + | #the | 10 | 15 | |