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

Improve PreserveText - v0.7.0 (beta 1) #65

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

Improve PreserveText - v0.7.0 (beta 1) #65

panoply opened this issue May 14, 2024 · 0 comments
Labels
HTML HTML Language Liquid Liquid Language

Comments

@panoply
Copy link
Owner

panoply commented May 14, 2024

Description

Related to the markup formatting rule preserveText. Currently, this rule has little effect given the last few version iteration and large charges to the lexing algorithm.

Goals

The preserveText accepts a boolean type, defaulting to false. When enabled (true) all text content should be excluded from formatting, treating regions of text as if they were to being ignored, however when false, text content occurrences will adhere to the structures imposed in accordance with other defined rules.

Example with wrap: 0

Example using the defaults withwrap set to 0, when wrap limit is using the default, newlines within text content are respected. All extraneous whitespace occurrences will be equalized when the rule is disabled (false) whereas when the rule is enabled true text content is left intact.

Before Formatting

<div>
<section>
<p>
Lorem     ipsum dolor sit amet,                 consectetur adipisicing     elit.       Ipsum alias iste   accusamus, 
                          culpa         itaque nulla quisquam         distinctio eveniet odio, 
        sit exercitationem perferendis!                       Beatae nostrum non a labore impedit expedita hic?
</p>
</section>
</div>

After Formatting true

<div>
  <section>
    <p>
       Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsum alias iste accusamus, 
       culpa itaque nulla quisquam distinctio eveniet odio, 
       sit exercitationem perferendis! Beatae nostrum non a labore impedit expedita hic?
    </p>
  </section>
</div>

After Formatting false

<div>
  <section>
    <p>
Lorem     ipsum dolor sit amet,                 consectetur adipisicing     elit.       Ipsum alias iste   accusamus, 
                          culpa         itaque nulla quisquam         distinctio eveniet odio, 
        sit exercitationem perferendis!                       Beatae nostrum non a labore impedit expedita hic?
    </p>
  </section>
</div>

Example with wrap: 50

Example using the defaults withwrap set to 50 (or whatever wordWrap limit defined). The newlines within text content will be stripped and aligned to the wrap limit imposed. All extraneous whitespace occurrences will be equalized.

Before Formatting

<div>
<section>
<p>
Lorem     ipsum dolor sit amet,                 consectetur adipisicing     elit.       Ipsum alias iste   accusamus, 
                          culpa         itaque nulla quisquam         distinctio eveniet odio, 
        sit exercitationem perferendis!                       Beatae nostrum non a labore impedit expedita hic?
</p>
</section>
</div>

After Formatting true

<div>
  <section>
    <p>
       Lorem ipsum dolor sit amet, consectetur adipisicing elit. 
       Ipsum alias iste accusamus, culpa itaque nulla quisquam 
       distinctio eveniet odio, sit exercitationem perferendis! Beatae 
       nostrum non a labore impedit expedita hic?
    </p>
  </section>
</div>

After Formatting false

<div>
  <section>
    <p>
Lorem     ipsum dolor sit amet,                 consectetur adipisicing     elit.       Ipsum alias iste   accusamus, 
                          culpa         itaque nulla quisquam         distinctio eveniet odio, 
        sit exercitationem perferendis!                       Beatae nostrum non a labore impedit expedita hic?
    </p>
  </section>
</div>
@panoply panoply added HTML HTML Language Liquid Liquid Language labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTML HTML Language Liquid Liquid Language
Projects
None yet
Development

No branches or pull requests

1 participant