chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity
Other
571 stars 263 forks source link

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

Open chipzoller opened 2 years ago

chipzoller commented 2 years ago

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

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):