p4ulypops / jquery-clean

Automatically exported from code.google.com/p/jquery-clean
0 stars 0 forks source link

Tag replace not working #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i'm building a sort of client manager where the user can insert text content 
through a content-editable div. i want to limit the heading only to H2 so if 
the client pastes a H1 or a H3 then it must become a H2.

For that purpose i use the tag replace option, which strips the headings thar 
aren't H2, but then the H2 tag is not applied. 

Example:

replace:[["h1", "h3"], "h2"]

thanks!

Original issue reported on code.google.com by tt.coe...@gmail.com on 5 Nov 2012 at 2:42

GoogleCodeExporter commented 9 years ago
thank you for letting me know
there was an issue, but also the replace option is an array of arrays
this allows you to make many replacements

e.g. replace: [[["h1", "h3"], "h2"]]

note the extra surrounding brackets

e.g. replace: [[["h2", "h3"], "h1"], [["h5", "h6"], "h4"]]

Original comment by antixsof...@gmail.com on 25 Feb 2013 at 1:58