scroll icon indicating copy to clipboard operation
scroll copied to clipboard

Improve `class` aftertext directive

Open breck7 opened this issue 2 years ago • 0 comments

The class directive is confusing. I wanted to add 2 classes to a paragraph but I forgot how class works.

It has 2 behaviors:

  1. If only 1 word is present, adds that class to the parent element
  2. If 2+ words are present, uses word 2+ as a text selector and adds a span with the class around the matching text.

Behavior 2 was the original behavior but behavior 1 seems to be more useful. Should rethink the design of this, and all similar directives.

A test
 class bold padding

Expected:

<p class="bold padding">A test</p>

Actual:

<p class="scrollParagraph">A test</p>

breck7 avatar May 10 '23 20:05 breck7