Skip to content

Drop space before slash in empty elements #11

@infotexture

Description

@infotexture

Currently, the plug-in enforces a space before the closing slash in empty elements when xmlSelfClosingTags is true, normalizing <foo></foo> and <foo/> to <foo />.

Some projects prefer the tighter <foo/> syntax, so if an option already exists to configure empty tag handling, perhaps a third value could be added to support this convention, like:

  • true (no space) – <foo/>
  • false<foo></foo>
  • space (current behavior) – <foo />

If so, this setting could also be applied to the XML declaration, to permit

<?xml version="1.0" encoding="UTF-8"?>

instead of rewriting to insert an extra space before the closing ?> as noted in #3:

<?xml version="1.0" encoding="UTF-8" ?>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions