Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Minor modification to support removeModifier in SpanParser - #231

Open
williameggers wants to merge 1 commit into
php-tui:mainfrom
williameggers:main
Open

Minor modification to support removeModifier in SpanParser#231
williameggers wants to merge 1 commit into
php-tui:mainfrom
williameggers:main

Conversation

@williameggers

Copy link
Copy Markdown

This minor change adds support for removing style modifiers in the options attribute by prefixing them with a tilde (~).
With this change, you can now explicitly remove a modifier by writing something like ~italic, which makes it easier to override modifiers in nested tag situations when required.

The implementation just checks if an option starts with ~, and if so, strips that off and removes the corresponding modifier from the style instead of adding it.

That said, I'm not totally sure if you're happy with the use of ~ for this. If you’d prefer a different character (like -), or even a separate attribute for removed modifiers, I’m totally open to changing the approach based on your preference!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant