You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue with the Trix editor and would like to discuss and understand it better.
Issue Details:
When pasting content with markup from a PDF document into the Trix editor at https://trix-editor.org/, there is no leading <br> or . However, when pasting the same content into a minimal demo (same version) or in any of my applications using Trix, I observe a leading break.
Findings:
I have discovered that the difference in behavior is related to the CSS applied to the root selector. Below is the relevant CSS for the Trix editor at https://trix-editor.org/:
By removing the margin: 0 rule and pasting the content, an extra break is added. Conversely, pasting with the margin: 0 rule does not add the extra break.
Screenshots:
Here are two screenshots to illustrate the difference:
(No leading break, with default CSS)
(Leading break present and breaks added)
Could somebody please help explain why this difference occurs and suggest any possible solutions to ensure consistent behavior across different environments?
My clipboard content used for this issue:
Thanks in advance!
Steps to Reproduce
Copy content from a pdf
visit https://trix-editor.org/ and paste, see no extra leading space in the html for the trix instance.
reload page, disable the margin:0 style for the root * element.
paste and see a leading <br> in the editor and for the html in the trix editor.
Details
Trix version: v2.1.3
Browser name and version: tested latest Chrome, Safari and FireFox.
Operating system: macOS
The text was updated successfully, but these errors were encountered:
I'm encountering an issue with the Trix editor and would like to discuss and understand it better.
Issue Details:
When pasting content with markup from a PDF document into the Trix editor at https://trix-editor.org/, there is no leading
<br>
or
. However, when pasting the same content into a minimal demo (same version) or in any of my applications using Trix, I observe a leading break.Findings:
I have discovered that the difference in behavior is related to the CSS applied to the root selector. Below is the relevant CSS for the Trix editor at https://trix-editor.org/:
By removing the
margin: 0
rule and pasting the content, an extra break is added. Conversely, pasting with the margin: 0 rule does not add the extra break.Screenshots:
Here are two screenshots to illustrate the difference:
(No leading break, with default CSS)
(Leading break present and breaks added)
Could somebody please help explain why this difference occurs and suggest any possible solutions to ensure consistent behavior across different environments?
My clipboard content used for this issue:
Thanks in advance!
Steps to Reproduce
margin:0
style for the root*
element.<br>
in the editor and for the html in the trix editor.Details
The text was updated successfully, but these errors were encountered: