Skip to content

Multiline shell (with backslash) is highlighted incorrectly #1832

@jessetan

Description

@jessetan

The following piece of shell is incorrectly syntax highlighted. Only the first line is correctly highlighted, the rest is gray:

$ echo "foo \
    bar"

This is happening since version 2.8.0 and also happens in the online demo page on pygments.org: https://pygments.org/demo/?lexer=console&code=%24%20echo%20%22foo%20%5C%0A%20%20%20%20bar%22
The last correct version was 2.7.4

Example effect for Sphinx documentation with Pygments version 2.9.0
Screenshot 2021-06-04 at 16 57 38

Example effect for Sphinx documentation with Pygments version 2.7.4
Screenshot 2021-06-04 at 16 57 01

Metadata

Metadata

Assignees

Labels

changelog-updateItems which need to get mentioned in the changelog

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions