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

ra-input-rich-text breaks when using special characters #3073

Closed
JakobRobijns opened this issue Mar 31, 2019 · 5 comments · Fixed by #3099
Closed

ra-input-rich-text breaks when using special characters #3073

JakobRobijns opened this issue Mar 31, 2019 · 5 comments · Fixed by #3099
Labels

Comments

@JakobRobijns
Copy link

JakobRobijns commented Mar 31, 2019

What you were expecting:

I wanted to use RichTextInput from 'ra-input-rich-text' like normal use.

What happened instead:

When trying to insert some Spanish content text ("ARTÍCULO 1.- El presente reglamento es de observancia obligatoria"), and make the "ARTÍCULO" bold (or another action), it keeps creating paragrafs.
After searching why, it's the 'Í' that breaks it. (It's a variant of the normal 'I' used in Spanish.

Edit: It's not only the 'I', other characters also break it.

Steps to reproduce:

-Create an react-admin application and use RichTextInput from 'ra-input-rich-text'.
-Try inserting content with the letter 'Í'.
-Make it bold/italic/...

Related code:

import RichTextInput from 'ra-input-rich-text';
<RichTextInput source="description" />

Other information:

GIF of the bug

Environment

  • React-admin version: 2.8.4
  • Last version that did not exhibit the issue (if applicable): /
  • React version: 16.8.5
  • Browser: Firefox & Chrome
  • Stack trace (in case of a JS error):
@Kmaschta
Copy link
Contributor

Kmaschta commented Apr 1, 2019

We are using the latest version of quill@1.3.6 for this rich text component.
Mind you check that this bug is related to their code or to our implementation of the rich text?

Thanks

@fzaninotto
Copy link
Member

Bug confirmed and reproduced

@fzaninotto fzaninotto added the bug label Apr 1, 2019
@fzaninotto
Copy link
Member

fzaninotto commented Apr 1, 2019

I believe it's a Quill bug, did you look for a similar issue in their bug tracker?

Edit: I can't reproduce the bug on the Quill demo. So it's easier a bug that was fixed in the recent past, or a bug due to our own integration of Quill.

@JakobRobijns
Copy link
Author

@fzaninotto Tnx. I also tried it on other quill plugins (React-Quill Demo - https://codepen.io/alexkrolick/pen/xgyOXQ) & (https://github.com/zenoamaro/react-quill) And I can't reproduce it.

@roychoo
Copy link

roychoo commented Apr 5, 2019

@JakobRobijns @fzaninotto i think this is due to the integration of Quill,
mainly 2 issues i think,

  1. after conversion of text to delta, quill seems to add p tag for sentences that has special characters
  2. due to that, and the way that it is checking whether it is required to update the component, it goes into an infinite loop of adding p tags.

i have made a fix but i am not sure if that is the best way.

#3099

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

Successfully merging a pull request may close this issue.

4 participants