-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feature to preserve at most n empty lines between elements #172
Comments
Hi @niwred Thanks for being a user of PrettyXML and taking the time to raise a request.
|
Hi @pmahend1 PrettyXML does precisely what I need when it comes to formatting elements on one or multiple lines. However, I often need to write XML based configurations where I would like to have empty lines between some elements for grouping/clarity. My requirements would be met if PrettyXML could preserve empty lines between elements. Better yet, if there would be an option to specify the maximum of empty lines between elements. This way, files that have two or more empty lines between elements would be normalized to one empty line. A typical .xml config file that I have to manually maintain looks like this: <query xmlns="http://............../query.xsd"
object="SoftwareSignature"
from="Machine"
multidelete="true"
tooltiptables="Machine,SoftwareSignature,SoftwareCategory,SoftwarePackage,MachineSoftwareSignature"
web="true"
guid="{32B8E0E3-982C-4EA9-9759-14466A676C59}">
<description>
<p>Show software signatues installed on a specific machine.</p>
</description>
<links>
<link object="Machine" id="MachineID" />
<link object="SoftwareSignature" id="SoftwareSignatureID" />
<link object="SoftwarePackage" id="SoftwarePackageID" />
<link object="SoftwarePublisher" id="SoftwarePublisherID" />
</links>
<weblinks>
<link object="Machine" column="Machine" id="MachineGuid" />
<link object="SoftwarePackage" column="SoftwarePackage" id="SoftwarePackageGuid" />
<link object="SoftwarePublisher" column="SoftwarePublisher" id="SoftwarePublisherGuid" />
<link object="SoftwareSignature" column="Signature" id="SoftwareSignatureGuid" />
</weblinks>
<initially>
<property name="condition" value="" />
</initially>
<dialog>
<input name="x" type="label" value="${machine.printablename}" align="left" />
<input name="unassigned" type="checkbox" value="false" title="Include unassigned signatures" align="left" />
</dialog>
<finally>
<property name="jointype" value="inner"/>
<property name="jointype" value="left outer" select-if="${dialog_unassigned}" />
</finally>
.....
</query> IMHO the empty lines help structure the file for easier reading/maintaining. Kind regards Erwin |
Thanks for the clarification. How about a setting to include an empty line between all elements except root element? |
I often add an empty line between some elements in XML-based code files to improve readability. It would be nice if the formatter could preserve up to n empty lines.
That is, if the option was set to 1, the formatter would preserve one empty line but would normalize two or more consecutive empty lines into one empty line. Maybe with an additional option to add an exception list with element names where empty lines between child elements are not allowed.
Kind Regards
Erwin
The text was updated successfully, but these errors were encountered: