fix: sometimes the html live doc goes into an inconsistant state #2572
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.



Before: Used lookup result as key for deletion
After: Correctly uses the key string returned by _documentKey()
This fix ensures LiveHTMLDocuments are actually removed from the cache when
closed, preventing memory leaks and stale references.
Key change: Now detects when an editor has no marks and allows marking even when fullBuild = false
The logic now:
This solves the core issue where switching editor panes or reopening documents would
leave the new editor without marks.
Added a safety net that:
How This Fixes the Issue
The error "couldn't find existing mark for tagID" occurred because:
Now: