I integrated the editor with Html-Tidy. This program cleans the code and can remove all the Word formatting. As an added bonus it format the look of my saved html.
It is part of my php code so I do not know if it could be integrated. I use an external file for the tidy settings. The settings need to be correct so that messages are disabled and force output is enabled.
If the formatting files for whatever reason $tidy_html will be null.
if ($CleanCode==1) { $tempinput = "/tmp/".$DomainName."_output.html"; if ($fd=fopen($tempinput,"w")) { $FormattedContent=stripslashes($_POST[Content]); fwrite($fd,$FormattedContent,strlen($FormattedContent)); fclose($fd); $tidy_command="/usr/sbin/tidy -config ./tidy/tidy_config.txt $tempinput"; $tidy_html = shell_exec($tidy_command); if ($tidy_html) $FormattedHtml=addslashes($tidy_html); unlink($tempinput); $status = "<B>Output Code Formatted</B><br><br>"; }
RE: cleanup Word HTML
I integrated the editor with Html-Tidy. This program cleans the code and can remove all the Word formatting. As an added bonus it format the look of my saved html.
http://tidy.sourceforge.net
RE: cleanup Word HTML
If you send me your code I can integrate it in a future version of the editor.
Is it language dependent? (Probably yes)
Thanks in advance,
FredCK
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
RE: cleanup Word HTML
If the formatting files for whatever reason $tidy_html will be null.
if ($CleanCode==1) {
$tempinput = "/tmp/".$DomainName."_output.html";
if ($fd=fopen($tempinput,"w")) {
$FormattedContent=stripslashes($_POST[Content]);
fwrite($fd,$FormattedContent,strlen($FormattedContent));
fclose($fd);
$tidy_command="/usr/sbin/tidy -config ./tidy/tidy_config.txt $tempinput";
$tidy_html = shell_exec($tidy_command);
if ($tidy_html)
$FormattedHtml=addslashes($tidy_html);
unlink($tempinput);
$status = "<B>Output Code Formatted</B><br><br>";
}
RE: cleanup Word HTML
I am just anticipating a release. I like the work you did... good job with your editor
RE: cleanup Word HTML
RE: cleanup Word HTML
RE: cleanup Word HTML
Remove Word tags
Remove all <span> tags
Remove all "class=" attributes
Remove all "style=" attributes
Remove all <div> tags (including positioned layers)
Remove all <font> tags (including color and size settings)
Remove font "face=" attributes
Remove all links and named anchors
and i also add some function,just about prewiew,new file,and insert template,etc...
now i am working about insert flash or other file and insert form element.
but i have some problem about it...and no one can help me,oh.....
RE: cleanup Word HTML
success...
now it is how to insert a flash file..
RE: cleanup Word HTML
can you post the code so others can take advantage of your hard work...