rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Home Page:https://rehype-pretty.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

word highlighting highlights half words

o-az opened this issue · comments

commented

Using the following snippet where I'm highlighting onRecvPacket and noticed onRecvPacketProcessing is getting highlighted too:

```solidity /onRecvPacket/#g
```

CleanShot 2024-01-17 at 22 32 56@2x

Here's a stackblitz playground to see it in action: https://stackblitz.com/edit/github-j3wpz9?file=src%2Fpages%2Findex.mdx

We should discuss if this behavior is desirable or considered a bug.

cc @atomiks

Workaround is to use a range to scope it:

```solidity /onRecvPacket/1#g
```

I'm not sure we should auto-implement breaking on boundaries (e.g. punctuation, spaces) or not. We could maybe add a flag to do that? Kind of like regex flags which fits with the syntax...

b for break:

```solidity /onRecvPacket/b#g
```
commented

I think regex is the way to go! Will do that