ExportPaths.h header

#include <ew/app/ExportPaths.h>

Namespace ew::app

Functions

bool ew::app::isPackageableAssetPath(const QString &src)

True when src (an image/asset reference lifted from exported HTML or Markdown) is a plain project-relative file path that may safely be resolved against the project folder and then read, copied, or packaged into an export. Returns false for anything that could reach a file outside the project folder, or that is not a local file at all:

  • an external URL or data URI – any scheme: prefix (http:, https:, data:, file:, javascript:);
  • a Windows drive-absolute path (C:\..., C:/...; also caught as a scheme: colon);
  • a POSIX-absolute path (leading /) or a Windows root / UNC path (leading \\endiskip);
  • any parent-directory traversal (a .. segment, on either the / or \\endiskip separator). This is the allowlist the website- and EPUB-image collectors apply so a hostile manuscript body such as ![x](C:/Windows/System32/...) or ![x](../../secret) cannot exfiltrate a file into a shared export, nor overwrite or delete a file outside the project when a site or book is written. App-authored asset paths are always of the form assets/<file> (see AssetImport), so no legitimate reference is rejected.