Skip to content

fix(bash): keep heredoc continuations highlighted#4415

Open
puneetdixit200 wants to merge 1 commit into
highlightjs:mainfrom
puneetdixit200:fix-bash-heredoc-continuation
Open

fix(bash): keep heredoc continuations highlighted#4415
puneetdixit200 wants to merge 1 commit into
highlightjs:mainfrom
puneetdixit200:fix-bash-heredoc-continuation

Conversation

@puneetdixit200

Copy link
Copy Markdown

Fixes #4377.

Summary

  • Keep Bash heredoc continuation commands on the command line instead of folding them into the heredoc string.
  • Start the heredoc string span on the following line and end it at the matching delimiter.
  • Add a Bash markup regression for <<-EOF | cat.
  • Update the existing Bash heredoc expectation and changelog entry.

Tests

  • Red before fix: the reported sample highlighted EOF | cat inside the heredoc string span, so cat was not highlighted as a command.
  • ONLY_LANGUAGES=bash npm run test-markup
  • npx eslint --no-eslintrc -c .eslintrc.lang.js src/languages/bash.js
  • npm run build
  • git diff --check

Note: I also ran the full npm run test-markup; it reached 537 passing tests and then hit the existing 2s Mocha timeout on http/default, unrelated to the Bash fixture. The Bash markup suite passed in both focused runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant