Forum Academy Marketplace Showcase Pricing Features

Instantly Highlight/Style Text in an Input

I’m looking for a way to highlight text in a multi-line input that matches text in a list, or based on regex. I’ve tried all the existing highlight plugins and they do not actually style the text in the input, they only style text in a separate text field from the input.

Any ideas on how I might be able to do this with an input?

2 Likes

Exact same issue here, any luck aj11? :wave:

I wasn’t able to find any solution.

Dang, I’ll let you know if I get anywhere with it

1 Like

Please do, I would greatly like to implement this.

Ok, managed to find a hacky way to make this mostly work for me (good enough for what I need, which is similar functionality to Google Docs). I’ll explain the set-up below, may or may not be what you’re after :wave:t2:

Here’s the set-up:
A. Text selector plugin (Text Selection Plugin | Bubble) to capture highlighted text
B. Use rich text input (Rich Text Editor Plugin | Bubble), not multi-line, for the main text area
C. Autobind the rich text input so the source text is in the database and can be edited live
D. Repeating group for the ‘comments’ that typically sit on the right-hand side of a google doc

Workflow:

  1. User highlights string of words (A above)
  2. User selects call to action, triggering workflow that does:
    A. Saves the highlighted text as it’s own item in the database (A above)
    B. ‘Find & replace’ highlighted words with the same words + BBcode in the database (e.g. was this ’ Hello world’, and is changed to this ‘’ [color=rgb(65, 65, 191)][highlight=rgb(233, 229, 255)] Hello world [/highlight][/color].’) (B & C above)
  3. Using a repeating group on the right-hand side of the text, display the ‘highlighted text’ from (D above)

The main issue for me is finding a way to select the highlighted text from within the rich text editor, to scroll to the respective item in the repeating group, as an anchor link, like you would if you were using google docs. Also, the rich text formatting is quite limited.

1 Like