# Getting Selected/Highlighted Text within the Rich Text Editor

**URL:** <https://forum.bubble.io/t/getting-selected-highlighted-text-within-the-rich-text-editor/217276>\
**Category:** Plugins\
**Created:** [July 27, 2022, 10:03am UTC](https://forum.bubble.io/t/getting-selected-highlighted-text-within-the-rich-text-editor/217276 "2022-07-27T10:03:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anticode](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/anticode/32/33270_2.png) [@Anticode](https://forum.bubble.io/u/Anticode)\
**Post date:** [July 27, 2022, 10:03am UTC](https://forum.bubble.io/t/getting-selected-highlighted-text-within-the-rich-text-editor/217276/1 "2022-07-27T10:03:49Z")

</div>

Hey everyone,

we are using Bubbles Rich Text Editor Plugin: [Rich Text Editor Plugin | Bubble](https://bubble.io/plugin/rich-text-editor-1580238841425x582072028873097200)

The Goal is to get the highlighted selected text of the user within this editor. So basically if a user uses his mouse cursor to select/highlight a text **within** the editor, we need that value returned.

We tried getting the highlighted text by using the standard javascript function “window.getSelection().toString()” and also using plugins such as: [Text Selection Plugin | Bubble](https://bubble.io/plugin/text-selection-1531353308799x534459804237692900)

Both did not work, as the number of line breaks returned is incorrect.

For example if I highlight a text within the text input like this:

```
This is Test A

This is Test B

```

The plugin returns the text:

```
This is Test A

This is Test B

```

which makes it unusable for us to work with. We need the correct number of line breaks

Here is a demo showcasing the functionality:[https://customstatesappstartingpoint.bubbleapps.io/version-test/d?debug\_mode=true](https://customstatesappstartingpoint.bubbleapps.io/version-test/d?debug_mode=true)

Can someone help us with this? We are happy to **pay** for anyone that will built us a custom plugin for this usecase!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [October 5, 2022, 10:04am UTC](https://forum.bubble.io/t/getting-selected-highlighted-text-within-the-rich-text-editor/217276/2 "2022-10-05T10:04:42Z")

</div>

Closed on October 5, 2022, 10:04am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
