wrong bash code highlighting (example inside)

Issue #59 new
Martin Hamant created an issue

Here is the bash code issue example:

for dbf in prefix-db_* ; do gunzip -c $dbf | mysql -uxxx $(basename ${dbf#prefix-} .sql.gz) ; done

The result that happen in JIRA with the code above (using {code:bash}) is close to what http://markup.su/highlighter/ provides with auto-detection. (to Ruby...?)

Select 'Bash' in the dropdown to see what we should actually get.

Thanks !

Comments (8)

  1. Holger Schimanski repo owner

    Thank's for reporting! Could you be a bit more specific in what is not properly highlighted and also attach a screenshot?

  2. Martin Hamant reporter

    Hi Holger,

    I've attached two screenshots :

    1) the {code:bash} result in JIRA

    Sélection_006.png

    2) the result with the online tool I mentioned above (bash selected of course), which is the one I expect

    bash_hlcorrect.png

    In JIRA the '#' char in '${dbf#....' shouldn't break the syntax highlighting like this.

    And as an indication I am specifying that the same "break" issue happen while selecting Ruby in the online tool Sélection_005.png

  3. Martin Hamant reporter

    Hi, In the context of a variable used like ${} , # should not be treated as a comment (http://tldp.org/LDP/abs/html/parameter-substitution.html) So if you are sure that {code:bash} call that bash brush so for me there is a bug in SyntaxHighligher. In that case I could open an issue from the corresponding GitHub project :) (The second screenshot in my previous comment is the expected highlight.)

  4. Log in to comment