esthetic icon indicating copy to clipboard operation
esthetic copied to clipboard

Improve PreserveText - v0.7.0 (beta 1)

Open panoply opened this issue 1 year ago • 0 comments

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 avatar May 14 '24 06:05 panoply