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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The transformerRenderWhitespace option in @shikijs/rehype doesn't work #675

Open
3 of 5 tasks
babakfp opened this issue May 12, 2024 · 0 comments
Open
3 of 5 tasks

Comments

@babakfp
Copy link

babakfp commented May 12, 2024

Validations

Describe the bug

Hi 馃憢

This is the result of the transformer function in the reproduction:

   text
{
    "type": "root",
    "children": [
        {
            "type": "element",
            "tagName": "pre",
            "properties": {},
            "children": [
                {
                    "type": "element",
                    "tagName": "code",
                    "properties": {},
                    "children": [{ "type": "text", "value": "   text\n" }],
                    "position": {
                        "start": { "line": 1, "column": 1, "offset": 0 },
                        "end": { "line": 3, "column": 4, "offset": 15 }
                    }
                }
            ],
            "position": {
                "start": { "line": 1, "column": 1, "offset": 0 },
                "end": { "line": 3, "column": 4, "offset": 15 }
            }
        }
    ],
    "position": {
        "start": { "line": 1, "column": 1, "offset": 0 },
        "end": { "line": 3, "column": 4, "offset": 15 }
    }
}

Take a look at what is before the text, the spaces are not converted.

Reproduction

https://stackblitz.com/edit/vitejs-vite-sqfaim?file=main.js

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
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

No branches or pull requests

1 participant