Create a javascript function

In Progress Posted Aug 13, 2014 Paid on delivery
In Progress Paid on delivery

Need a routine written in pure Javascript (please no jquery or other addons).

No reliance on server side processing, all in browser please.

Remove all duplicate and extra tags.

Handle attributes as well as tags.

Adjust an array of character positions after tag removal.

In this text, character position 50 is the H in Hello

Character position 100 is the T in There.

Example of functions usage:

var messyhtmlstring = "<font face='arial'><b><b><font face='times'><i><b>Hello</b></b></i><i><font face='arial'></font><b> There</b></i></font><font face='times'>.<br></font></b></font>"

var posadjust = [ 50, 100 ];

var cleanedhtmlstring = StrHTMLClean(messyhtmlstring, posadjust);

Clean result should be:

"<b><font face='times'><i>Hello There</i>.<br></font></b>"

Adjusted positions should be:

posadjust = [ 25, 31 ]

var posadjust is the position of the text Hello and There.

So that would be needed for each word in the html output.

It must be quick since it's going to be constantly called during editing.

JavaScript

Project ID: #6316819

About the project

10 proposals Remote project Active Aug 13, 2014

Awarded to:

rubytopcoders

Hello, I am expert with Javascript and i am very interesting this project! Hope to work with you! Best regards, LEO

£55 GBP in 3 days
(1 Review)
2.2

10 freelancers are bidding on average £127 for this job

sheikhabuzer

I have been working as a Web Developer... I have created differnt websites using HTML5,CSS3,Javascript,Jquery,BootStrap,AngularJS,PHP,Wordpress etc... I can do this quickly... Here are few projects... https://w More

£23 GBP in 0 days
(76 Reviews)
7.6
samitXI

Hi Sir, I am ready to work for you.I have 9 years of experience in C/C++, python , java, PHP, Javascript and, MySQL. please see some of my works also check my reviews you will get better idea about my skill.I deliver More

£222 GBP in 5 days
(23 Reviews)
6.2
TrickyWebtech

HI,Me as web expert.I have expertise in javascript and jquery.I understood your requirement and if you allow me then I can work on your project and complete today.

£92 GBP in 0 days
(43 Reviews)
6.1
audelk

im expert in javascript. i can do this without a glitch. ------------------------------------------------------------------------ thank you audel

£66 GBP in 5 days
(22 Reviews)
5.7
lucentinnovation

Greeting from Lucent Innovation...!!! Hello there, I am Javascript dev here. you can hire us with good out put. We can discuss more on this. Many Thanks Nitesh Lucent Innovation

£184 GBP in 3 days
(10 Reviews)
3.7
sujoymondal87

A proposal has not yet been provided

£116 GBP in 2 days
(6 Reviews)
3.2