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

[Bug] rehype-hljs-var fails for hcl snippets #496

Open
ptgott opened this issue Sep 20, 2024 · 0 comments
Open

[Bug] rehype-hljs-var fails for hcl snippets #496

ptgott opened this issue Sep 20, 2024 · 0 comments

Comments

@ptgott
Copy link
Contributor

ptgott commented Sep 20, 2024

Given the following MDX page:

---
title: Test page
description: Test page
---

This is a var in an hcl block:

```hcl
provider "teleport" {
  addr        = '<Var name="teleport.example.com:443" />'
  join_method = '<Var name="token-join-method" />'
  join_token  = "terraform_bot"
}

The dev server renders the following:

image

The rehype-hljs-var plugin replaces Var tags with a placeholder string, applies syntax highlighting with hljs, then replaces the placeholder string with the original Var tags. In this case, the second replacement does not occur. Fix the plugin so it renders Var components correctly in HCL snippets.

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