-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add bold, italic, and underline for copyFormatting #16193
Conversation
htmlBuilder << ";"; | ||
htmlBuilder << "font-style:"; | ||
htmlBuilder << textProps.IsItalic(); | ||
htmlBuilder << ";"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm somewhat doubtful that this works correctly, because these 3 CSS properties don't accept true/false as their arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that the textProps
variable doesn't seem to be filled in with anything, and we'd need to be tracking the changes to these styles, the same way we're tracking changes to the colors, so we're only writing out a new span when necessary.
htmlBuilder << ";"; | ||
htmlBuilder << "font-style:"; | ||
htmlBuilder << textProps.IsItalic(); | ||
htmlBuilder << ";"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that the textProps
variable doesn't seem to be filled in with anything, and we'd need to be tracking the changes to these styles, the same way we're tracking changes to the colors, so we're only writing out a new span when necessary.
bool TextAttribute::IsBold() const noexcept | ||
{ | ||
return WI_IsFlagSet(_attrs, CharacterAttributes::Bold); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition is unnecessary. The "bold" state can already be determined by the IsIntense
method. But in terms of what we put in the HTML output, it should probably only be triggering a bold font if the IntenseIsBold
mode is also set.
Not the right solution. |
Summary of the Pull Request
copyFormatting was broken when pasting into Word.
References and Relevant Issues
#16191
Detailed Description of the Pull Request / Additional comments
Fixes formatting issues with text.
Validation Steps Performed
PR Checklist