Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML notation diff does not parse correctly. #928

Open
3 of 5 tasks
Xilophor opened this issue Feb 12, 2025 · 0 comments
Open
3 of 5 tasks

XML notation diff does not parse correctly. #928

Xilophor opened this issue Feb 12, 2025 · 0 comments

Comments

@Xilophor
Copy link

Xilophor commented Feb 12, 2025

Validations

Describe the bug

In XML formatting, git removals ([!code --]) are not displayed correctly.

Technical Problem:

In the transformerNotationDiff transformer, removals are notated with [!code --] inside of a comment. In XML, comments cannot have -- in them due to compatibility reasons, as described here:

https://www.w3.org/TR/REC-xml/#sec-comments

[Definition: Comments may appear anywhere in a document outside other markup; in addition, they may appear within the document type declaration at places allowed by the grammar. They are not part of the document's character data; an XML processor MAY, but need not, make it possible for an application to retrieve the text of comments. For compatibility, the string " -- " (double-hyphen) MUST NOT occur within comments.] Parameter entity references MUST NOT be recognized within comments.

Reproduction

<Reference Include="Assembly-CSharp" HintPath="...\Assembly-CSharp.dll" /> <!-- [!code --] -->

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
Xilophor added a commit to LethalCompanyCommunity/ModdingWiki that referenced this issue Feb 12, 2025
Xilophor added a commit to LethalCompanyCommunity/ModdingWiki that referenced this issue Feb 12, 2025
* Fix incorrect commenting on XML code blocks for shiki transformers

* Add another example for publicizing assemblies

* Added a temporary shiki transformer for XML removal diffs

Issue here: shikijs/shiki#928

* Change `--` to the new temp. transformer (`rm`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant