Skip to content
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

Provide option to keep the leading space when setting html #388

Open
kotlinc0der opened this issue Oct 3, 2024 · 1 comment
Open

Provide option to keep the leading space when setting html #388

kotlinc0der opened this issue Oct 3, 2024 · 1 comment

Comments

@kotlinc0der
Copy link

kotlinc0der commented Oct 3, 2024

I have a RichText component acting as a preview for a RichTextEditor.

There are 3 issues:

  • when saving changes in RichTextEditor and passing it to the RichText, the encode function called when setHTML is used remove all leading spaces in a paragraph.

  • calling tab reflects as a single space in the RichTextEditor. I can probably detect the tab insert and replace it with 4 spaces; it's still a minor bug.

  • using ParagraphStyle with TextIndent allows you to define the indent for the first line and the rest of the lines; but the html accounts only for the first indent so if you save the html text and load it again the text indent of the first line will apply to the entire paragraph.

Screen Shot 2024-10-04 at 12 37 15 AM
Screen Shot 2024-10-04 at 12 35 50 AM
Screen Shot 2024-10-04 at 8 39 02 PM
Screen Shot 2024-10-04 at 8 38 49 PM

@MohamedRejeb
Copy link
Owner

Thanks for reporting this. I will check it.
Currently spaces are being ignored because that's the expected behavior of HTML, but you are right the spaces from the editor shouldn't be ignored. I will be changing spaces to   when converting rich text to HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants