-
Notifications
You must be signed in to change notification settings - Fork 3.4k
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Does quill support getting index of specific word or sentence? #2698
Comments
if you want one word use function: String#indexof('myWord').
however, I'm working in building find & replace module, and this is how I did it:
you also better save the indices array to remove the style later. |
Thank you so much for your help. |
yes, getText() return a string that content only the text, for images/videos try and see but about line break, there is no line break in Quill as I know, lines constructed by divs, inspect it and see for yourself. |
after testing, you are right, inserting images will make the indices inaccurate, however, if you look at getText():
this line means return only text, so I change it to:
this line: means return also the images also,
means when you return the image, name it as 'i' (instead of the full name of the image). so, if you have words then image then words then image, the output of getText() will be like this:
and the indices is accurate :) but, if you want only the text.. we need to separate it to another API called getTextWithImages() image:
updatefor future visitors, no need to change getText();
|
@MuhammedAlkhudiry Many thanks! |
you are welcome, one last thing, you don't have to change getText();
|
Hello I'm new to Quill I was wondering if there's a way to manipulate urls generated by Quill, for example checking if the link given by the user is a valid one, and it's only https provided is there a way to do that? |
For anyone who might be interested. You could first check whether there are embeds in the editor before looping through the contents ops array. |
Hi all,
I'm not sure if quill supports getting index of specific word or sentence. e.g. I have several images and videos in the editor with several paragraphs as well. Is there any way, I could find out all the words "music" in it, and highlight them with my customized quill class? Seems I can not do it with existing quill apis.
Thanks.
The text was updated successfully, but these errors were encountered: