Skip to content
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 Markup Rule: stripTextWrapLines #68

Open
panoply opened this issue May 21, 2024 · 0 comments
Open

New Markup Rule: stripTextWrapLines #68

panoply opened this issue May 21, 2024 · 0 comments
Labels
Enhancement New feature or request HTML HTML Language Liquid Liquid Language

Comments

@panoply
Copy link
Owner

panoply commented May 21, 2024

Description

Introducing the stripTextWrapLines rule, which can be used to either preserve or remove newlines containing within text content regions. By default, this rule is set to false meaning newlines will be preserved in accordance with the global preserveLine rule.

stripTextWrapLines

Whether or not Æsthetic should strip newline occurrences when applying word-wrap on text content. This rule will only take effect if a word wrap limit has been defined via wrap option. When enabled, Æsthetic will remove newline occurrences from text identified content and produce a strictly formed wrap. By default, this rule is false and Æsthetic will preserve newlines within text content, ensuring that newline occurrences adhere to the preserveLine limit regardless of whether or not a wrap limit has been set. Setting this to true will override preserveLine within text specific content and instead refer to the wrap limitation.

NOTE
If you have set preserveText to true this rule will be ignored, as preserveText take precedence and will override all text content related formatting options.

Example

Let's say we have set wrap to 50 and we have the following text content.

Lorem ipsum, dolor sit amet consectetur adipisicing elit. 

Facilis quasi corrupti ipsam impedit nostrum odio, 

If the stripTextWrapLines is true

Lorem ipsum, dolor sit amet consectetur 
adipisicing elit. Facilis quasi corrupti 
ipsam impedit nostrum odio, 
@panoply panoply added Enhancement New feature or request HTML HTML Language Liquid Liquid Language labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request HTML HTML Language Liquid Liquid Language
Projects
None yet
Development

No branches or pull requests

1 participant