Skip to content

PrismJS: yaml rendering indentation issue #236

@deimosfr

Description

@deimosfr

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for support

Describe the bug

When Prism is enabled, there are indentation issues on the first line of a yaml, and so the complete code block is wrong.

Examples with a comment on the first line, it's ok:

# this is working
test:
  a: 1

This is not working, the identation fails:

test:
  a: 1

Expected behavior

When I write:

test:
  a: 1

It generates:

<div class="prism-codeblock ">
--
  | <pre id="9d18c54" class="language-yaml ">
  | <code>test:
  | a: 1</code>
  | </pre>
  | </div>

While I expect to have:

<div class="prism-codeblock ">
--
  | <pre id="a5558bb" class="language-yaml ">
  | <code>test:
  |   a: 1</code>
  | </pre>
  | </div>

Screenshots

Image

Environment

- OS: MacOS
- Browser: Chrome
- Browser Version: 135.0.7049.115

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions