DocumentText.h header

#include <ew/app/DocumentText.h>

Namespace ew::app

Functions

QString ew::app::documentPlainText(const QString &body)

Reduces a stored document body to the plain prose text used for word/character/readability/ dialogue analytics. The desktop editor stores a body as a full HTML document (QTextDocument::toHtml()), while importers and programmatic documents store plain Markdown; counting either directly would count the markup – tags, the <head>/<style> block, entities – as words. This detects an editor-authored HTML body (by the leading <!DOCTYPE that toHtml() always emits) and reduces it to visible text – dropping the head/style/script blocks, stripping tags, decoding the common entities, and collapsing whitespace – while returning a plain (non-HTML) body unchanged, so a literal "<x>" in Markdown prose is never stripped.