fix: normalize tag names to lowercase for case-insensitive matching#371
Merged
fix: normalize tag names to lowercase for case-insensitive matching#371
Conversation
Uppercase BBCode tags like [DEL][/DEL] were not rendered correctly because the parser preserved the original case while the Swift renderer only matched lowercase tag names. Normalize tag names to lowercase at parse time with `to_ascii_lowercase()`.
4215ee3 to
62522da
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes case-insensitive BBCode tag handling by normalizing parsed tag names to lowercase so downstream renderers (notably the Swift ContentCombiner switch on lowercase tags) match tags consistently.
Changes:
- Normalize parsed BBCode tag names to lowercase (
to_ascii_lowercase()) when buildingSpan_Tagged. - Add a unit test covering uppercase, mixed-case, and open/close case-mismatch tags to ensure normalization.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[DEL][/DEL]or mixed-case[DEL][/del]were not rendered correctly — they fell through to the default branch and displayed as plain text.ContentCombiner.swift) only matched lowercase names in its switch statement.to_ascii_lowercase()incontent.rs.Test plan
test_uppercase_tags_normalizedcovering all-uppercase, mixed-case, and mismatched open/close tag cases🤖 Generated with Claude Code