Closed christopherparo closed 2 years ago
@ChristopherParo try to use this https://froala.com/wysiwyg-editor/docs/methods/#html.get or https://froala.com/wysiwyg-editor/docs/methods/#html.getSelected
@ChristopherParo You can use the selection.text
method:
https://froala.com/wysiwyg-editor/docs/methods/#selection.text
https://jsfiddle.net/dejan_m/og0hxf2t/4170/
any update on this? the solutions proposed above are not really the answers. I also just want to grab the plain text, with no html tags included.
@Licarte97 selection.text() does not return the HTML tags. Can you test this demo and let me know the result: https://github.com/froala/react-froala-wysiwyg/issues/229#issuecomment-674850795?
it does, but It only extracts the highlighted/selected text. I want to get the plain text without selecting the actual text.
Ohhh okay, I just saw your jsfiddle code. I just need to select all the text before extracting. thanks!
You can choose one of the following approaches: To highlight the part you want to export: https://jsfiddle.net/dejan_m/og0hxf2t/4804/ To export all without selecting anything: https://jsfiddle.net/dejan_m/og0hxf2t/4803/
I've been trying to grab just the plain text from the editor but I can't seem to find the exposed getText method that is offered in the base api.
I've found the method here but it doesn't seem this is included in the editor object. https://froala.com/wysiwyg-editor/v1-2/docs/methods/#getText