fix: don't leak HTML comment content into pasted paragraph text#1221
Merged
Conversation
_parseDeltaElement's fallback branch called child.text on any non-Element DOM node, including dom.Comment (whose .text getter aliases its raw data). This let real HTML comments -- e.g. the internal tracking marker Google's AI Overview panel injects when you copy its answer text -- surface as visible garbage in the editor. Skip non-Text nodes here, matching the dom.Text check _parseElement already does one level up.
|
|
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
Cherry-pick of the fix already merged to
mainvia #1220, ontofix/korean_imesince AppFlowy-Premium'spubspec.yamlpinsappflowy_editorto this branch (it carries commits not yet onmain)._parseDeltaElement's fallback branch calledchild.texton any non-ElementDOM node, includingdom.Comment(whose.textgetter aliases its rawdata). A real HTML comment embedded inline in pasted content — e.g. the internal tracking marker Google's Search AI Overview panel injects when you copy its answer text — would surface as visible garbage text in the editor instead of being silently dropped._parseElementalready uses one level up: only extract text fromdom.Textnodes; other node types are skipped.main(bb99582), no conflicts — only one other commit on this branch touches the same file and it edits an unrelated region.Test plan
flutter test test/customer/html_document_test.dart— new regression test passestest/render/image/image_upload_widget_test.dartpre-exists onfix/korean_imeeven without this commit (unrelated pre-existing issue, not a regression from this change)🤖 Generated with Claude Code
https://claude.ai/code/session_014Nps55LWFpd6VBJkPX5cap