ScroogeXHTML 11.1 for Object Pascal is out today. ScroogeXHTML converts RTF to HTML5 and XHTML in Delphi 2009 and later and in Free Pascal / Lazarus, with full source code included.
11.1 is a maintenance release: dozens of conversion fixes, no API changes and no changed defaults. Install it, recompile, and your HTML gets better without code changes.
What’s new
Tables
- Tables with merged cells, or with rows of different widths, now give valid HTML. The column grid follows the HTML table model, and every expected-output file in our test suite passes the Nu HTML Checker without errors.
- Tables collapse their cell borders, so neighbouring cells share one line, as in your word processor. You no longer need your own
border-collapsestyle rule. - Cell padding from
\trpaddland\trpaddr. - Paragraphs that follow
{\par\pard}inside a cell no longer fall out of the table.
Links
- One hyperlink field becomes exactly one
<a>, even when it has several formatted runs or spans table cells.
Paragraphs and lists
- Paragraph borders keep their width, line style and colour, also on single sides and for wide borders.
- List items keep their text direction, background and border.
Text
- A tab keeps the font of the text around it.
- A paragraph of nothing but spaces counts as an empty paragraph.
- Non-breaking hyphens, em and en spaces, and zero-width joiners become the right characters.
- Documents without a font table get the default font.
- Pictures inside Word shapes are no longer lost.
- Plain-text output contains no
<img>tags.
Smaller executables
- The optional picture adapter now has its own Base64 encoder and no longer links Indy. That saves about 155 KB in applications that embed pictures.
In step with the Java edition
- Many of these fixes were also made in the ScroogeXHTML RTF Converter for Java, so both editions now give the same HTML for the same RTF in far more cases.
Safer with untrusted RTF
- New output limits:
OptionsSecurity.MaxNodeCountandMaxOutputCharscap the number of elements and the size of the generated document. They complement the input limits, the URL scheme allow-list and strict mode. - A link whose target isn’t on the allow-list (
javascript:,file:and the like) is now written as plain text, not as an<a>without anhref. - XHTML 1.0 Strict output is valid, and values in the document head are escaped.
- Malformed picture data is logged once, with control bytes escaped.
Upgrading from 11.0
11.1 is a drop-in update: no API changes, no changed defaults. Some output differs because it’s now correct, for example the table column grid, link markup and border styles. The migration guide lists each change, in case your own code or tests compare against the old output.
Availability
The installer and source zip are available from the ScroogeXHTML for Object Pascal page. The download includes the Getting Started guide, the API reference with the full release notes, the migration guide and the security policy.
Coming next: nested tables (tables inside table cells) are the headline of 11.2.