compose-rich-editor
compose-rich-editor copied to clipboard
Padding after html tag
I'm making an epub reader app. Where people can change lineHeight. But it doesn't work after "</p>".
Is it bag or I can fix it?
//BasicRichTextEditor
textStyle = TextStyle.Default.copy(
fontSize = model.fontSize * 20.sp,
textAlign = TextAlign.Center,
lineHeight = 20.sp * model.fontSize * model.height,
lineBreak = LineBreak.Simple,
color = fontColor,
fontFamily = fontFamily
)
Hi, Thanks for opening this issue, it looks like Compose is only adding the line height between lines of the same paragraph but not between paragraphs. Can you send me an html sample?
@MohamedRejeb Hi! I think you are absolutely right
only adding the line height between lines of the same paragraph but not between paragraphs.
Attached a file: peacen'war.zip
Yes we also noticed this. Seems to be reported here: https://issuetracker.google.com/issues/301126824
This is actually a pretty annoying usability issue for a rich text editor. I'm pretty sure users will be adding extra new lines to get the blank line in between paragraphs. Which will result in <p>Line 1</p><br><p>Line 2</p>
.
@ChrisTitos should I close this issue? (I'm newbie GitHub)
Let's keep it open for now.
@MohamedRejeb do you have any ideas on how we can best tackle this issue. I'm referring to the editor use case specifically, but I guess it also applies for the reported case.
To reiterate, the main problem for us is going to be that users will add extra blank lines after paragraphs, as well as no blank lines appearing for texts that were already submitted.
I was thinking perhaps we can automatically add a <br>
after each </p>
or something, and then strip those out again when we submit the text to our API. You think that could work ? Or is there perhaps something that can be done on the library side