fix: remove stray extra '>' when buffering note open tags#1
Merged
Conversation
NoteProcessor.appendOpenTag's template literal had a trailing '>' after the selfClosing ternary, so every captured open tag emitted a doubled closing bracket: `<b foo="bar">>` or `<br/>>`. Notes stored by the SAX parser accumulated these malformed tags, and the HTML cleaner's tag-strip regex left stray '>' characters in user- visible output. Also strengthen the existing NoteProcessor coverage test to assert the exact buffer content for both selfClosing=true and the regular open/close flow so the regression cannot reappear silently. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Bug audit of recent history (full repo is only 8 commits, so I reviewed everything). Found and fixed one clear, user-visible bug.
NoteProcessor.appendOpenTagemits malformed tags into note bufferssrc/parser/processors/NoteProcessor.tshad a trailing literal>after the selfClosing ternary in the template literal:Every captured open tag produced a doubled closing bracket:
selfClosing=falseproduced<b foo="bar">>instead of<b foo="bar">selfClosing=trueproduced<br/>>instead of<br/>Because the SAX parser always feeds nested-within-note elements through this method (
SaxOmniFocusParser.tsline ~194), every task/project note that contains markup ends up stored with these stray>characters.HTMLCleanerstrips tags with/<[^>]+>/g, which consumes the first>but leaves the stray second one behind, so the fix is visible to end users in the rendered ASCII chart and in the JSON output (raw note).I verified the bug with a one-off script before fixing, then strengthened the existing NoteProcessor coverage test in
tests/additional-coverage.test.tsso the buffer format is now asserted directly (previously the test only called the methods and checked flags).What else I looked at and left alone
getItemStatusinsrc/filter/statusFilter.tshas a dead-code branch that always returns"paused"whether the blocking context is dropped or paused. Looks like a latent bug, but the existing test explicitly pins the current behavior (tag-dropped->"paused"), so "fixing" it would be a semantics change, not a bug fix. Flagging here rather than changing.EntityDeduplicator.selectTasksToKeepdrops entire recurring groups when every instance is completed. Plausibly intentional and the class is not exported to library consumers, so I left it.parsePatchDescriptordoes a 2-way destructure onfileName.split("="), which is lossy if a filename ever contains more than one=. OmniFocus's format does not produce such names, so not actionable today.Test plan
npm run check(lint + typecheck + 35 vitest tests + build) passestests/additional-coverage.test.tsfail against the old template literal and pass against the fix