Bug: Cannot paste google doc indented paragraph correctly
Lexical version: 0.11.3
Steps To Reproduce
- Type a paragraph and indent the first word via tab (or you can use this google doc sample )
- Copy and paste to playground
Link to code example:
The current behavior
The first paragraph looks different, the indent apply to whole paragraph instead of first sentence.
The expected behavior
The indent should only apply to first sentence.
Perhaps using text-indent to determine indent of paragraph node is not align to what text-indent in css means?
The paste event datatransfer.
Details
<html>
<head>
<meta charset="utf-8" />
<meta charset="utf-8" />
</head>
<body>
<b
style="font-weight: normal"
id="docs-internal-guid-c40ed73b-7fff-b512-40cf-442d94bf8d51"
><p
dir="ltr"
style="
line-height: 1.38;
text-indent: 36pt;
margin-top: 0pt;
margin-bottom: 0pt;
"
>
<span
style="
font-size: 11pt;
font-family: Arial, sans-serif;
color: #000000;
background-color: transparent;
font-weight: 400;
font-style: normal;
font-variant: normal;
text-decoration: none;
vertical-align: baseline;
white-space: pre;
white-space: pre-wrap;
"
>I'm baby bushwick jean shorts non wayfarers mixtape cornhole vape
dolor sunt bespoke aesthetic solarpunk sus. Pork belly crucifix next
level gochujang marfa +1 tempor man braid hashtag sed taxidermy shaman
officia fingerstache. Fam la croix pariatur, knausgaard PBR&B etsy
in eu kombucha gluten-free tousled swag ethical brunch. Reprehenderit
sus humblebrag hot chicken, taxidermy flannel fixie meditation taiyaki
cred excepteur.</span
>
</p>
<p
dir="ltr"
style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt"
>
<span
style="
font-size: 11pt;
font-family: Arial, sans-serif;
color: #000000;
background-color: transparent;
font-weight: 400;
font-style: normal;
font-variant: normal;
text-decoration: none;
vertical-align: baseline;
white-space: pre;
white-space: pre-wrap;
"
>Tacos meggings cred id mumblecore art party cupidatat tattooed YOLO
post-ironic aliquip. Cardigan sustainable green juice cloud bread tonx
lomo quis knausgaard adipisicing aliquip. Consectetur fam marxism air
plant solarpunk cronut tote bag chambray reprehenderit man braid.
Ipsum aliquip bitters, godard edison bulb keffiyeh consectetur pickled
kale chips bushwick velit swag asymmetrical intelligentsia tbh. Non
lomo nostrud enim cupidatat aute. Iceland yr pabst af.</span
>
</p>
<p
dir="ltr"
style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt"
>
<span
style="
font-size: 11pt;
font-family: Arial, sans-serif;
color: #000000;
background-color: transparent;
font-weight: 400;
font-style: normal;
font-variant: normal;
text-decoration: none;
vertical-align: baseline;
white-space: pre;
white-space: pre-wrap;
"
>Tumblr drinking vinegar meh mollit photo booth organic unicorn four
dollar toast butcher fixie. Neutra coloring book mukbang bruh
fingerstache ipsum. Edison bulb solarpunk palo santo grailed crucifix
unicorn scenester in shoreditch. Mlkshk qui 90's la croix beard ad
gorpcore. Dolor do tumeric elit, readymade skateboard crucifix neutral
milk hotel you probably haven't heard of them.</span
>
</p>
<p
dir="ltr"
style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt"
>
<span
style="
font-size: 11pt;
font-family: Arial, sans-serif;
color: #000000;
background-color: transparent;
font-weight: 400;
font-style: normal;
font-variant: normal;
text-decoration: none;
vertical-align: baseline;
white-space: pre;
white-space: pre-wrap;
"
>Narwhal tacos williamsburg pickled JOMO elit cold-pressed jawn
activated charcoal green juice kombucha VHS selvage glossier la croix.
Sed tousled solarpunk offal, ex velit sint dolor mollit kogi portland
fam occupy. Reprehenderit YOLO poke in live-edge health goth esse.
Cardigan twee biodiesel eu letterpress, ramps meh sus ullamco tousled
flexitarian. Retro direct trade pug cronut schlitz in JOMO etsy
waistcoat 3 wolf moon. Organic pabst tonx, ipsum kitsch pour-over
portland readymade semiotics tofu. Craft beer bruh labore next
level.</span
>
</p>
<br
/></b>
</body>
</html>
Perhaps using text-indent to determine indent of paragraph node is not align to what text-indent in css means?
This is 100% true - I've always known we were using that CSS property incorrectly, but I think it's mostly there for compatibility with other editors. I'm honestly not sure how we should deal with this, as we don't have the concept of semantically indenting the first line - I think we'd just add whitespace there.
Perhaps using text-indent to determine indent of paragraph node is not align to what text-indent in css means?
This is 100% true - I've always known we were using that CSS property incorrectly, but I think it's mostly there for compatibility with other editors. I'm honestly not sure how we should deal with this, as we don't have the concept of semantically indenting the first line - I think we'd just add whitespace there.
This problem still there.
Using padding as indentation is completely wrong. If that were truly a valid solution, the "text-indent" property wouldn’t even exist in CSS. That’s the property that should be used instead of padding. Alternatively, a parameter could be added to the plugin to allow this choice.