-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix showing wrongly formatted text #374
Fix showing wrongly formatted text #374
Conversation
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 think it may be easier to just change the condition in src/web/parserUtils.ts
(L206) to check if the firstChild of our input has the class root
. If not it should regenerate the input content, meaning creating the span & parsing the content with ExpensiMark - this will remove any additional styles.
if (!rootSpan || !rootSpan.classList.contains('root') || rootSpan.innerHTML !== dom.innerHTML)
@BartoszGrajdek I agree this solution is much more clear but it leaves unwanted behaviour connected to placeholder. Screen.Recording.2024-06-25.at.12.55.50.movScreen.Recording.2024-06-25.at.12.56.20.mov |
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.
LGTM
We'll merge it after a version bump in E/App. To make sure in case of any regressions we don't have to add testing steps for this PR as well |
Details
When typing text with
command + b
orcommand + i
orcommand + u
effect was applied to inputted text, which was unwanted.Also connected issue: when text was pasted to an empty filed, it was in the colour of placeholder.
In these cases instead of
<span>
object with text,<b>, <i>, <u>....
was being created.My proposal is to change the created object when it's not
<span>