Expand text into empty XML tags
If you write any text and hit tab webstrom will make it a full XML tag. For example: AnyText becomes <AnyText></AnyText>
However, more often I actually need an empty tag: <AnyText/>. Can i setup webstorm to produce empty tags instead of full tags on TAB key (or some other key sequence) ?
Please sign in to leave a comment.
Hi there,
>AnyText becomes <AnyText></AnyText>
That's Emmet in action .. and AFAIK that's how it works -- I do not see any options for empty tag style.
If you know what tags you will be creating in advance -- you can always create custom Live Template for that (same expand key (Tab) can be used).
If such tags are rather random (editing different XML files with different sets of tags) then 2 options:
Is it possible to have a live template that will expand AnyText/ => <AnyText /> ? Mind the slash after AnyText.
Nope ... as Live Template needs to have an abbreviation (name of live template that it used to for expanding) .. otherwise -- how system should know what live template to use?
P.S.
You can always submit Feature Request ticket to the Issue Tracker at https://youtrack.jetbrains.com/issues/WEB
Submitted here: https://youtrack.jetbrains.com/issue/WEB-24502