Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

markdown miss-hightlight "bash" when there's the word "until" #52

@bric3

Description

@bric3

I'm reporting the issue here due to this comment atom/language-gfm#78 (comment)

The issue was first reported here atom/atom#5664 then atom/language-gfm#78

The issue is still present in atom 1.8.0 which uses version 0.21.1 of language-shellscript.

I searched the repository for until, this line 'begin': '\\b(while|until)\\b' in particular got my attention, here's the whole section :

      {
        'begin': '\\b(while|until)\\b'
        'captures':
          '1':
            'name': 'keyword.control.shell'
        'end': '\\b(done)\\b'
        'name': 'meta.scope.while-loop.shell'
        'patterns': [
          {
            'include': '$self'
          }
        ]
      }

I tried to use --while and the problem was the same, other keywords of composed statements like if or for don't cause problems. Typing done somewhere after confirms this capturing section is the culprit.

I think the resolution could be to use something else than the boundary construct \b in the regex like (?:[^\\-]|^)(while|until)\\b. Or do something like the for parsing.
I don't know to test this but maybe you could.


Original issue

I was writing a simple git documentation for some colleagues, with bash hightlighted snippet, but Atom miss-highlight if there's the until word and only with the bash style.

    ```bash
    git log --since="1 week ago" --until="yesterday"
    ```

Changing the word a little (adding/removing a letter) highlighting is correct.

See :

Incorrect :
screenshot 2015-02-21 at 15 35 06

Correct (but changing one letter of the until letter):
screenshot 2015-02-21 at 15 35 32


OS : OSX 10.10.2 Yosemite
Atom : 0.182.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions