Closed sssutd closed 7 months ago
Thanks for reporting. I will fix them later today.
Also, it would be nice if the option "Add Space Before Self Closing Tag" affected the <?xml ... ?> line and inserted a space before the closing ?>
Those are not really attributes, so that setting wont affect declaration. If you prefer to format this way, I can add a setting just for that.
Many thanks for the lost comments fix. It works.
Also, it would be nice if the option "Add Space Before Self Closing Tag" affected the line and inserted a space before the closing ?>
Those are not really attributes, so that setting wont affect declaration. If you prefer to format this way, I can add a setting just for that.
I'm not sure what you mean by "attributes" here. The option name refers to "Closing Tag", not attributes.
And stylistically the closing ?>
looks similar to a closing tag />
Compare:
<a version="1.0"/> # no space
<a version="1.0" /> # has space
<?xml version="1.0"?> # no space
<?xml version="1.0" ?> # has space
Anyway, it is a very minor issue.
<?xml version="1.0"?>
is XML declaration, version here is version of XML.
<a version="1.0"/>
is an element. version
here is an attribute. XML declaration and Element formatting have different rules for formatting.
I do however understand what you are expecting. I can add a separate setting so that you can set to formatting XML declaration as <?xml version="1.0" ?>
(space before ending of declaration), it does not have to overlap with addSpaceBeforeSelfClosingTag
setting. Some people may want to format XML declaration without space. Making declaration wrapping with space may be unwanted for some where they only expect it for elements.
Hence I can add a setting add space before XML declaration end
to facilitate your needs.
Let me know if that works.
Thanks. As I said, the issue is very minor. So I am happy with any solution you find appropriate.
Source doc:
Format Document result:
The first and the last comments are lost.
\ # Also, it would be nice if the option "Add Space Before Self Closing Tag" affected the
<?xml ... ?>
line and inserted a space before the closing?>