Skip to content

(shell/bash) Wrong syntax highlight after a heredoc, until the end of the line. #4377

Description

@denis-migdal

Describe the issue

hljs assumes that what comes after a heredoc is a string.

However, the end of the line may be the continuation of the command line.

Which language seems to have the issue?

shell, bash

Are you using highlight or highlightAuto?

highlight

Sample Code to Reproduce

echo "ok" <<-EOF | cat
	Hello
EOF

Expected behavior

cat should be highlighted as a command instead of being highlighted as a string.

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