0
votes

i am using tinymce 4.0.6,when i copy data from word document all the styles,classes and unwanted html tags are generatin in tinymce.for eg:

    <p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph;
    mso-layout-grid-align:none;text-autospace:none"><b><span style="color:#1F497D;
    mso-bidi-font-style:italic">About Us </span></b></p>

i wanted to clean all unnecessary tags,classes and styles...i want to clean it to below output

    <p>
   <strong>About Us </strong>
  </p>

in short i want to clean html tags,so that only few html tags work,i only need to keep

    <h>,<p>,<br>,<li>,<ul>...etc

such important tags only how can i do it in tinymce 4.0.6

plz help me thanks in advance

2
I guess that should be it, but cannot test: tinymce.com/wiki.php/configuration:valid_elementsMister Henson
@MisterHenson thank yousarincm99

2 Answers

1
votes

You can use the valid_elements property

For example

`valid_elements: "@[id|class|style|title"],h1,h2,h3,h4,h5,h6,hr[size|noshade]`

Will allow id|class|style|title attributes on all tags and the allowed tags will be only h1-6 and hr

0
votes

i found the best solution ,there is a plugin:paste in tinymce,it is also helpful to remove unwanted things when we copy data from document to tinymce,it maybe helpful for somebody