prettier / plugin-xml

Prettier XML plugin
MIT License
235 stars 33 forks source link

Fails on XML files with Steam markup inside of them #422

Closed Zamiell closed 2 years ago

Zamiell commented 2 years ago

xmlWhitespaceSensitivity

ignore

Input XML

<?xml version="1.0" encoding="UTF-8" ?>
<metadata>
  <name>Forgotten Fables</name>
  <directory>forgottenfables</directory>
  <id>2595379777</id>
  <description>
[img]https://i.imgur.com/ctauvxx.gif[/img]

Forgotten Fables is a large content mod that will come out in 5 Fables for [i]The Binding of Isaac: Repentance[/i].

[h1]Warning[/h1]
This mod requires [url=https://steamcommunity.com/workshop/filedetails/?id=1348031964]StageAPI[/url] to work. Get it [url=https://steamcommunity.com/workshop/filedetails/?id=1348031964]here[/url].

[h1]The Binding of Isaac: Forgotten Fables[/h1]
[i]The walls of the basement have always been hollow. One, however, seems a bit more so than usual.[/i]

[h1]Features[/h1]
[list]
    [*] Over [b]60[/b] new monsters to fight, equally distributed across the different floors!
    [*] [b]43[/b] items + [b]30[/b] unlockables
    [*] [b]9[/b] trinkets + [b]6[/b] unlockables
    [*] [b]1[/b] new character with a Tainted version
    [*] [b]4[/b] unlockable challenges
    [*] More than [b]10,000[/b] new rooms
    [*] New consumables
    [*] New music
[/list]

[h1]Mod Interactions[/h1]
[list]
    [*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=836319872]External Item Descriptions[/url] compatibility
    [*] Full [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2376005362]Encyclopedia[/url] compatibility
    [*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2635267643]And[/url] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2490515687]a[/url] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2612124457]lot[/url] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2622137368]of[/url] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2527902558]other[/url] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2612456876]miscellaneous[/url] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2622137368]mod[/url] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2575911103]compatibility[/url]!
[/list]

[h1]Credits[/h1]
[list]
    [*] Programmers - Kyojo, Crinfarr, Blipp, Ethereal
    [*] Artists - Firework, Cometz
    [*] Designers - Firework,
    [*] Sound and Music - TODO
    [*] Other - Andre Doruk, Paltham
    [*] Testers - TODO
[/list]
(A more detailed list can be found on our [url=https://forgottenfables.fandom.com/wiki/Developers]wiki[/url]).

[h1]Official Links[/h1]
[list]
    [*] Join our community [url=https://discord.com/invite/MnUzKqEEeQ]Discord server[/url]!
    [*] Check out our [url=https://twitter.com/FablesTeam]Twitter[/url]!
    [*] Read more at [url=https://forgottenfables.fandom.com]the Forgotten Fables Wiki[/url]!
    [*] Listen to [url=https://soundcloud.com/mischievoussv/sets/tboi-forgotten-fables-official]the soundtrack[/url]!
[/list]

[h1]Beta[/h1]
This is the development release, which is avalable only to developers and beta testers. If you are neither of those, you should not have access to this. Please report this to a developer on [url=https://discord.gg/seej2KURJp]the official Discord server[/url].
  </description>
  <version>0.4</version>
  <visibility>Private</visibility>
  <tag id="Items" />
  <tag id="Trinkets" />
  <tag id="Player Characters" />
  <tag id="Familiars" />
  <tag id="Rooms" />
  <tag id="Floors" />
  <tag id="Enemies" />
  <tag id="Bosses" />
</metadata>

If you use this tool multiple times on the aforementioned input, it will continue to change the output over and over. (e.g. the tool isn't being idempotent)

kddnewton commented 2 years ago

Can you share how it's changing? I'm currently unable to reproduce this issue.

Zamiell commented 2 years ago

It changes to this:

<?xml version="1.0" encoding="UTF-8" ?>
<metadata>
  <name>Forgotten Fables</name>
  <directory>forgottenfables</directory>
  <id>2595379777</id>
  <description>
    [img]https://i.imgur.com/ctauvxx.gif[/img]

Forgotten Fables is a large content mod that will come out in 5 Fables for
    [i]The Binding of Isaac: Repentance[/i].

[h1]Warning[/h1]
This mod requires

    [url=https://steamcommunity.com/workshop/filedetails/?id=1348031964]StageAPI[/url]
    to work. Get it

    [url=https://steamcommunity.com/workshop/filedetails/?id=1348031964]here[/url].

[h1]The Binding of Isaac: Forgotten Fables[/h1]
[i]The walls of the basement have always been hollow. One, however, seems a bit
    more so than usual.[/i]

[h1]Features[/h1]
[list]
    [*] Over [b]60[/b] new monsters to fight, equally distributed across the
    different floors!
    [*] [b]43[/b] items + [b]30[/b] unlockables
    [*] [b]9[/b] trinkets + [b]6[/b] unlockables
    [*] [b]1[/b] new character with a Tainted version
    [*] [b]4[/b] unlockable challenges
    [*] More than [b]10,000[/b] new rooms
    [*] New consumables
    [*] New music
[/list]

[h1]Mod Interactions[/h1]
[list]
    [*]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=836319872]External
    Item Descriptions[/url] compatibility
    [*] Full

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2376005362]Encyclopedia[/url]
    compatibility
    [*]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2635267643]And[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2490515687]a[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2612124457]lot[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2622137368]of[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2527902558]other[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2612456876]miscellaneous[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2622137368]mod[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2575911103]compatibility[/url]!
[/list]

[h1]Credits[/h1]
[list]
    [*] Programmers - Kyojo, Crinfarr, Blipp, Ethereal
    [*] Artists - Firework, Cometz
    [*] Designers - Firework,
    [*] Sound and Music - TODO
    [*] Other - Andre Doruk, Paltham
    [*] Testers - TODO
[/list]
(A more detailed list can be found on our
    [url=https://forgottenfables.fandom.com/wiki/Developers]wiki[/url]).

[h1]Official Links[/h1]
[list]
    [*] Join our community [url=https://discord.com/invite/MnUzKqEEeQ]Discord
    server[/url]!
    [*] Check out our [url=https://twitter.com/FablesTeam]Twitter[/url]!
    [*] Read more at [url=https://forgottenfables.fandom.com]the Forgotten
    Fables Wiki[/url]!
    [*] Listen to

    [url=https://soundcloud.com/mischievoussv/sets/tboi-forgotten-fables-official]the
    soundtrack[/url]!
[/list]

[h1]Beta[/h1]
This is the development release, which is avalable only to developers and beta
    testers. If you are neither of those, you should not have access to this.
    Please report this to a developer on [url=https://discord.gg/seej2KURJp]the
    official Discord server[/url].
  </description>
  <version>0.4</version>
  <visibility>Private</visibility>
  <tag id="Items" />
  <tag id="Trinkets" />
  <tag id="Player Characters" />
  <tag id="Familiars" />
  <tag id="Rooms" />
  <tag id="Floors" />
  <tag id="Enemies" />
  <tag id="Bosses" />
</metadata>

And then to this:

<?xml version="1.0" encoding="UTF-8" ?>
<metadata>
  <name>Forgotten Fables</name>
  <directory>forgottenfables</directory>
  <id>2595379777</id>
  <description>
    [img]https://i.imgur.com/ctauvxx.gif[/img]

Forgotten Fables is a large content mod that will come out in 5 Fables for
    [i]The Binding of Isaac: Repentance[/i].

[h1]Warning[/h1]
This mod requires

    [url=https://steamcommunity.com/workshop/filedetails/?id=1348031964]StageAPI[/url]
    to work. Get it

    [url=https://steamcommunity.com/workshop/filedetails/?id=1348031964]here[/url].

[h1]The Binding of Isaac: Forgotten Fables[/h1]
[i]The walls of the basement have always been hollow. One, however, seems a bit
    more so than usual.[/i]

[h1]Features[/h1]
[list]
    [*] Over [b]60[/b] new monsters to fight, equally distributed across the
    different floors!
    [*] [b]43[/b] items + [b]30[/b] unlockables
    [*] [b]9[/b] trinkets + [b]6[/b] unlockables
    [*] [b]1[/b] new character with a Tainted version
    [*] [b]4[/b] unlockable challenges
    [*] More than [b]10,000[/b] new rooms
    [*] New consumables
    [*] New music
[/list]

[h1]Mod Interactions[/h1]
[list]
    [*]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=836319872]External
    Item Descriptions[/url] compatibility
    [*] Full

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2376005362]Encyclopedia[/url]
    compatibility
    [*]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2635267643]And[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2490515687]a[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2612124457]lot[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2622137368]of[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2527902558]other[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2612456876]miscellaneous[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2622137368]mod[/url]

    [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2575911103]compatibility[/url]!
[/list]

[h1]Credits[/h1]
[list]
    [*] Programmers - Kyojo, Crinfarr, Blipp, Ethereal
    [*] Artists - Firework, Cometz
    [*] Designers - Firework,
    [*] Sound and Music - TODO
    [*] Other - Andre Doruk, Paltham
    [*] Testers - TODO
[/list]
(A more detailed list can be found on our
    [url=https://forgottenfables.fandom.com/wiki/Developers]wiki[/url]).

[h1]Official Links[/h1]
[list]
    [*] Join our community [url=https://discord.com/invite/MnUzKqEEeQ]Discord
    server[/url]!
    [*] Check out our [url=https://twitter.com/FablesTeam]Twitter[/url]!
    [*] Read more at [url=https://forgottenfables.fandom.com]the Forgotten
    Fables Wiki[/url]!
    [*] Listen to

    [url=https://soundcloud.com/mischievoussv/sets/tboi-forgotten-fables-official]the
    soundtrack[/url]!
[/list]

[h1]Beta[/h1]
This is the development release, which is avalable only to developers and beta
    testers. If you are neither of those, you should not have access to this.
    Please report this to a developer on [url=https://discord.gg/seej2KURJp]the
    official Discord server[/url].
  </description>
  <version>0.4</version>
  <visibility>Private</visibility>
  <tag id="Items" />
  <tag id="Trinkets" />
  <tag id="Player Characters" />
  <tag id="Familiars" />
  <tag id="Rooms" />
  <tag id="Floors" />
  <tag id="Enemies" />
  <tag id="Bosses" />
</metadata>

And so on.