Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong syntax highlighting for multiline shell strings in markdown code snippets #201524

Closed
mcandre opened this issue Dec 26, 2023 · 2 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@mcandre
Copy link

mcandre commented Dec 26, 2023

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.85.1
  • OS Version: macOS Ventura

Steps to Reproduce:

  1. Edit the following Markdown file in VSCode: example.md.
  2. Render a preview tab.

Screenshot:

screenshot

The string highlighting for that first TASK_NAMES declaration multiline string block appears wonky. Everything from the opening dollar parenthesis for a subprocess ($() up to the awk statement delimiting semicolon (;) is white.

Suspect some underlying linguist sh parser is faulty. It may not be adhering to the POSIX sh language spec.

@RedCMD
Copy link
Contributor

RedCMD commented Dec 27, 2023

interestingly the code syntax highlighting works correctly

TASK_NAMES="$(
    awk '/^[a-zA-Z0-9_]+\(\)/ {
        split($0, a, /\(\)/);
        print a[1]
    }' "$0" |
        sort
)"

help() {
    echo 'Usage: ./build [<task> [<task> [<task>...]]]

Tasks:
'

    for TASK in $TASK_NAMES; do
        echo "* $TASK"
    done
}

image
its only the preview thats broken

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 8, 2024

Duplicate of #91279

@mjbvz mjbvz marked this as a duplicate of #91279 Feb 8, 2024
@mjbvz mjbvz closed this as completed Feb 8, 2024
@mjbvz mjbvz added the *duplicate Issue identified as a duplicate of another issue(s) label Feb 8, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

3 participants