Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

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

Closed
ptgott opened this issue Sep 20, 2024 · 1 comment
Closed

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

ptgott opened this issue Sep 20, 2024 · 1 comment

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.

@ptgott
Copy link
Contributor Author

ptgott commented Dec 11, 2024

Fixed in #506

@ptgott ptgott closed this as completed Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant