syntax: keep highlighting after spaced XML empty tags - #4218
Open
justadityaraj wants to merge 1 commit into
Open
syntax: keep highlighting after spaced XML empty tags#4218justadityaraj wants to merge 1 commit into
justadityaraj wants to merge 1 commit into
Conversation
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.
Context
The XML syntax started an attribute identifier on every literal space and then waited for an equals sign. A space before
/>therefore opened an identifier region that never ended, causing its highlighting state to carry into following lines.Changes
NameStartCharafter spaces or tabs before starting an attribute identifier.User impact
XML documents using the common
<tag attr="value" />form retain correct syntax highlighting on the rest of the document. Attribute names separated with tabs are recognized as well.Verification
master— failed with the following line highlighted asidentifier.go test ./runtime -run TestXMLEmptyTagWithSpace -count=10— passed.go test ./...— passed.go generate ./runtime— passed with no tracked output changes.go build ./cmd/micro— passed.git diff --check— passed.go vet ./...— retains the existing unkeyed-literal and copied-lock warnings reproduced on cleanmaster.Fixes #4213