fix: Rename both tags when one is being edited#3925
fix: Rename both tags when one is being edited#3925Nishthajain7 wants to merge 2 commits intoprocessing:develop-codemirror-v6from
Conversation
|
The overall approach looks solid and CM6-native |
|
Looks good but for instance where I have not provided a closing tag and I'll rename the current tag then won't it affect the next closing tag. If not please show the demo. |
|
I made a new commit to handle the no closing tag case Screencast.from.2026-02-23.22-47-44.webm |
| import { HTMLHint } from 'htmlhint'; | ||
| import { CSSLint } from 'csslint'; | ||
| import { emmetConfig } from '@emmetio/codemirror6-plugin'; | ||
| import { syntaxTree } from '@codemirror/language'; |
There was a problem hiding this comment.
import { syntaxTree } from '@codemirror/language' and import { Annotation } from '@codemirror/state' are already available through the existing package imports so please add them there instead of introducing new ones.
| if (!oldCloseTag) return; | ||
|
|
||
| let parentHasCloseTag = false; | ||
| let pc = oldParentElement?.firstChild; |
There was a problem hiding this comment.
Undescriptive variable name pc, better to use parentChild
Issue:
Fixes #3873
Demo:
Screencast.from.2026-02-22.21-24-21.webm
Changes:
I used syntaxTree from codemirror to traverse through an html tree and find the corresponding closing tag of the opening tag that is being edited.
I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #123