rehype-pretty-code
rehype-pretty-code copied to clipboard
word highlighting highlights half words
Using the following snippet where I'm highlighting onRecvPacket
and noticed onRecvPacketProcessing
is getting highlighted too:
```solidity /onRecvPacket/#g
```
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
```
I think regex is the way to go! Will do that