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

YAML syntax highlighting doesn't detect literal block scalar properly #347

Open
3 of 4 tasks
chipzoller opened this issue Jul 24, 2022 · 0 comments
Open
3 of 4 tasks
Assignees
Labels
bug Something isn't working

Comments

@chipzoller
Copy link
Owner

I have checked all the prerequisites below and I'm yet experiencing a problem

  • Read the README.md
  • Have the extended version of Hugo installed
  • Used the exampleSite's config.toml as a reference
  • I have included my repository link. Instead of pasting long snippets here.

Describe the bug

Using a code block with YAML syntax highlighting when the YAML contains a literal style block scalar the colors aren't set properly. This is easy to demonstrate with GitHub's built-in code block highlighting and a screenshot from the current Clarity theme.

steps:
    - name: Scan for vulnerabilities
      uses: aquasecurity/trivy-action@503d3abc15463af68b817d685982721f134256a5 # v0.6.0
      with: 
        # scan-type: 'image'
        image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
        format: 'json'
        ignore-unfixed: true
        # vuln-type: 'os,library'
        output: trivy-scan.json

    - name: Add scan metadata
      uses: sergeysova/jq-action@9ac92a6da6d616b4cebdddc0059e36a1ad43fab1 # v2.1.0
      with:
        cmd: cat trivy-scan.json | jq '. + {timestamp:(now|todateiso8601)}' | jq '. + {scanner:"trivy"}' > scan.json

    - name: Calculate scan file hash
      id: calculate-scan-hash
      run: |
        SCAN_DIGEST=$(sha256sum scan.json | awk '{print $1}')
        echo "::set-output name=scan_digest::$SCAN_DIGEST"
        echo "Hash of scan.json is: $SCAN_DIGEST"        

    - name: Upload vulnerability scan report
      uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
      with:
        name: scan.json
        path: scan.json
        if-no-files-found: error

And Clarity's

image

Notice how the step named "Upload vulnerability scan report" isn't colorized properly after the block scalar.

Avoid long-winded descriptions

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Brave 1.41.100
  • Hugo v0.101.0
@chipzoller chipzoller added the bug Something isn't working label Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants