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

Fix ^ to not match after a string terminating newline #9

Closed
slevithan opened this issue Dec 17, 2024 · 0 comments
Closed

Fix ^ to not match after a string terminating newline #9

slevithan opened this issue Dec 17, 2024 · 0 comments

Comments

@slevithan
Copy link
Owner

slevithan commented Dec 17, 2024

See shikijs/shiki#866. Oniguruma's ^ doesn't match after a string-terminating \n (though it matches after every other \n, including the position sandwiched between \n\n). There is no equivalent restriction on $.

In other words, oniguruma-to-es needs to change its conversion for ^ from (?<=^|\n) to (?<=^|\n(?!$)).

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