-
Notifications
You must be signed in to change notification settings - Fork 2
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
New Rule: attributeCasing #25
Comments
UpdateApplying the logic for this beautification rule. The finalized schema and accepted options are as follows:
Finalised ChangesThe |
Finalised ShipmentThis will conclude the new ruleset of Input<div {% if %}DATA-{{ x }}-FOO{% else %}ID="BAR"{% endif %}></div> Output -
|
Solved in 0.3.0.beta |
Description
This directly pertains to #24 and covers the introduction of a new
markup
beautification rule (option). I will not bring support for uppercase structures, that is a code smell and frowned upon. Only preservation and/or conversion for lowercase will be provided.Goals
The goal with this rule is allow users to choose how they would like Prettify to handle their input when it comes to attribute casing. In some projects, folks might like a strict lowercase enforcement be applied whereas other project might require the complete opposite, ie: case preservation. This new rule will not effect Liquid attributes used in markup tokens, it only relates to HTML attributes.
Ruleset
This option will be a multiselect type which defaults to
preserved
:preserve
lowercase
lowercase-keys
lowercase-values
Definition
The option will be available to
markup
and can be defined as followed:Examples
The below examples showcase how the different formatting styles will output attribute casing
Preserve (default)
The
preserve
option will leave HTML attribute casing intact.Before Formatting
After Formatting
Lowercase
The
lowercase
option will convert all attribute keys and values to lowercaseBefore Formatting
After Formatting
Lowercase Keys
The
lowercase-keys
option will convert all attribute keys to lowercaseBefore Formatting
After Formatting
Lowercase Values
The
lowercase-keys
option will convert all attribute keys to lowercaseBefore Formatting
After Formatting
The text was updated successfully, but these errors were encountered: