rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.
https://rehype-pretty.pages.dev
MIT License
1.03k stars 62 forks source link

showLineNumber dosent work when placed at the end of the meta tags. #204

Open beamcode opened 5 months ago

beamcode commented 5 months ago

Is this expected ? Thanks!

- Works

```tsx showLineNumbers /age/#v /name/#v /setAge/#s /setName/#s /50/#i /"Taylor"/#i const [age, setAge] = useState(50) const [name, setName] = useState("Taylor") ```

- Does now work

```tsx /age/#v /name/#v /setAge/#s /setName/#s /50/#i /"Taylor"/#i showLineNumbers const [age, setAge] = useState(50) const [name, setName] = useState("Taylor") ```

o-az commented 3 months ago

I've got a fix for this in #229

here's an example of it working when at end of metatags: https://d68419f3.rehype-pretty-example-astro.pages.dev/

https://github.com/rehype-pretty/rehype-pretty-code/blob/f4a806d9b36200fcd9518d147cfbceb4eb175dc8/examples/astro/src/pages/index.mdx?plain=1#L8

just need to update tests in #229 then will merge and do a release