redhat-developer / redhat-developer/vscode-xml

formatOnPaste is broken when pasting inside a DOCTYPE section

Open
#264 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug formatting
Dominant language
TypeScript
Stars
328
Forks
101
Avg merge
1d 17h
Merged PRs (30d)
7

Description

With "editor.formatOnPaste": true, when pasting <!ENTITY foo "bar"> inside the DOCTYPE section of:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE article [

]>
<article></article>

the block is formatted as

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE article [
<null>
]>
<article></article>

instead of

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE article [
  <!ENTITY foo "bar">
]>
<article></article>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VS Code with editor.formatOnPaste enabled and the XML DOCTYPE sample from the report. Trace the format-on-paste path for DOCTYPE content and verify that the completed output preserves the !ENTITY declaration and indentation instead of producing a null element.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.