For Delphi developers, web deployment often brings a major headache: handling rich text. Users expect to paste content from Microsoft Word, Outlook, or web browsers directly into your application, complete with bolding, colors, tables, and custom fonts. However, HTML generated by these platforms is notoriously messy, bloated, and full of proprietary tags that break web layouts.
If you are building web applications using Delphi frameworks like uniGUI, TMS WEB Core, or IntraWeb, ensuring this text renders cleanly and securely is a massive challenge.
Enter ScroogeXHTML by Gnostice—a powerful, lightweight Delphi component designed specifically to sanitize, convert, and embed clean rich text into web applications. Here is how it works and why it is an essential tool for your Delphi web development stack. The Problem: The “Dirty HTML” Nightmare
When a user copies text from Microsoft Word and pastes it into a standard web rich-text editor, the clipboard does not just copy the words. It copies thousands of lines of hidden XML, inline CSS overrides, and non-standard tags (like ).
If you store this raw HTML in your database and try to render it on a web page, several problems occur:
Layout Breakage: Messy inline styles can override your web app’s global CSS, breaking your responsive design.
Database Bloat: A single paragraph of text from Word can easily balloon into tens of kilobytes of useless styling data.
Security Risks: Raw HTML inputs leave your web application vulnerable to Cross-Site Scripting (XSS) attacks if malicious scripts are embedded in the code. The Solution: What is ScroogeXHTML?
ScroogeXHTML is a native Delphi library that acts as a strict filter and converter for rich text. It takes RTF (Rich Text Format) or messy HTML inputs and strips away the noise, leaving behind pure, lean, valid XHTML or HTML5.
Because it is written natively in Delphi, it integrates seamlessly into your backend server code, allowing you to clean data on the fly before it ever touches your database or reaches the end-user’s browser. Key Features for Web Developers 1. Advanced RTF-to-HTML Conversion
Many legacy Delphi desktop applications store formatting in RTF blobs. If you are migrating these applications to the web, ScroogeXHTML can automatically convert those legacy RTF fields into clean, web-ready HTML5 on your backend server. 2. Strict Style Sanitization
ScroogeXHTML strips out heavy inline styles and proprietary Microsoft tags. It replaces them with clean, standardized CSS or basic semantic HTML tags (like , , and
Leave a Reply