How to edit HTML formatted text programatically with javascript without dealing with tags and HTML manually -
i want able edit html formatted text if plain text without losing formatting. example let's have html:
<div> <b> <span style="color: rgb(68, 68, 68);">gmail available <i>wherever</i> are, device - desktop, laptop, phone or tablet. download app or go to </span><a href="https://www.gmail.com/">gmail.com</a><span style="color: rgb(68, 68, 68); font-family: arial, sans-serif; line-height: 18.1875px;"> on mobile device started. </span> </b> <br> </div>
i able like:
trimmed = gettexttoedit(); tokens = trimmed.split(' '); replacement = "+"; (var i=0; i<tokens.length; i++) { t = tokens[i].tolowercase(); if (t == "gmail") t = replacement; }
and have t, still formatted.
is there way can edit text without manually dealing html tags , still keeping formatting? ok using library this.
thanks!
i think need html-parsing javascript.
Comments
Post a Comment