I am trying out if I can use WpTools 6 as simple wysiwyg html editor.
Look at the following sample input file:
Code
<h1>Title 1 header</h1><p>This the first paragraph.</p><ul><li>Unordered list item 1</li><li>Unordered list item 2</li><li>Unordered list item 3</li><li>Unordered list item 4</li></ul><h2>Title 2 header</h2><p>Paragraph in title 2 </p><ol><li>Ordered list item 1</li><li>Ordered list item 2</li><li>Ordered list item 3</li></ol><a href='http://www.sitestepper.com' rel='external'>Website of Sitestepper</a>
Loaded into WpTools with the line:
and back with the line:
Code
EasyEdit.Lines.Text := wprt.AsANSIString('HTML-OnlyHTMLBody,DontWriteFontParams,ignorefonts,nostyles,nocharstyles,nonumstyles');
Produces the following html-code:
HTML
<html>
<head></head><body style="margin-left:1.31in;margin-right:1.31in;margin-top:1.00in;margin-bottom:1.00in">
<div style="font-size:24.00pt;font-weight:bold;margin:0.05in 0.00in 0.00in 0.00in;">Title 1 header</div>
<p style="font-size:9.00pt;margin:0.00in 0.00in 0.10in 0.00in;">This the first paragraph (modified).</p>
<ul style="list-style-type:bullet;"><li>Unordered list item 1</li>
<li>Unordered list item 2</li>
<li>Unordered list item 3</li>
<li>Unordered list item 4</li>
</ul><h2 style="font-size:18.00pt;font-weight:bold;margin:0.05in 0.00in;">Title 2 header</h2>
<p style="font-size:9.00pt;margin:0.00in 0.00in 0.10in 0.00in;">Paragraph in title 2</p>
<ol type="1"><li>Ordered list item 1</li>
<li>Ordered list item 2</li>
<li>Ordered list item 3</li>
</ol><div><a href="http://www.sitestepper.com">Website of Sitestepper</a> </div>
</body></html>
Alles anzeigen
Not too bad, but:
The <h1> line is removed (while other <h2> lines are kept (if I put a paragraph above the <h1> line, the <h1> too is kept.
A lot of code (font-size and margins) is added on the <p> <h2> and <ul>/<ol> lines.
The <h1> which is removed is clearly a bug, no ?
Is there a way to make sure no font and margin style parameters are added by WpTools.