I have a solution to this using the toolbox plugin.
The video explaining the plugin in here: https://youtu.be/9jVEzPLRebI
In my case the html I am working with is the html from tweet content.

  • install the toolbox plugin
  • add the Javascript to Bubble element to your page
  • I named mine ‘javascript html to text’
  • fill in the function name within the element. I called mine ‘text’ which results in a function called ‘bubble_fn_text’
  • Enable the Publish value checkbox
  • Specify the Value type as text

In your workflow

  • define the first action as the one that gets the html you are working with, so you can referencing this is the next action. In my case this is step 1 [ alternatively you could reference any other source and update the script accordingly]

  • Add another action to ‘Run Javascript’

  • paste in this javascript below

    const span = document.createElement(‘span’);
    span.innerHTML = Result of step 1 (Twitter - Embed T…)'s body html:formatted as JSON-safe;
    const result = span.textContent || span.innerText;
    bubble_fn_text(result)

Note:

  • the formatting as json-safe is required to correctly manage the escaping of quotes

screenshots
image
image

result:

6 Likes