Skip to content

Remove newlines from tokens #63

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

Merged
merged 5 commits into from
Apr 12, 2025
Merged

Conversation

ryangjchandler
Copy link
Collaborator

This is a bug in Phiki, discovered by comparing token generation with vscode-textmate.

Phiki was including the \n character inside of tokens, which it shouldn't be doing since TextMate grammars are evaluated on a per-line basis. The \n character is only included in the subject text to ensure rules that check for a \n operate correctly (the same thing can be seen in the vscode-textmate codebase).

This is technically a breaking change for users who are consuming tokens with the codeToTokens method – users using the CommonMark plugin or the default HtmlGenerator/TerminalGenerator won't notice any changes as the appropriate updates have been made there.

@ryangjchandler ryangjchandler added the bug Something isn't working label Apr 12, 2025
@ryangjchandler ryangjchandler merged commit b959b71 into main Apr 12, 2025
3 checks passed
@ryangjchandler ryangjchandler deleted the remove-newlines-from-tokens branch April 13, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant