fix: unset underline style rule - #686
Open
abnormal749 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CONTRIBUTING.md.Summary
Fix
Style.UnsetUnderline()so it actually removes the underline style rule instead of setting underline tofalse.Problem
UnsetUnderline()currently callsUnderline(false). That makes rendered text stop using underline, but internally it still leaves the underline property marked as explicitly set.That matters when using
Inherit(): inherited values are only copied when the child style has not already set that property.Before this change, a style that called
UnsetUnderline()could not inherit underline from a parent style.Example
Expected: child inherits underline from parent.
Before this fix: child does not inherit underline, because UnsetUnderline() leaves an explicit "underline off" rule behind.
Fix
UnsetUnderline() now clears the underline property directly and resets the stored underline value to UnderlineNone.
This keeps UnsetUnderline() consistent with other unset methods such as UnsetBold(), UnsetItalic(), and UnsetStrikethrough().
Tests
Added a focused test covering the difference between:
Validation