Skip to content

Releases: GDKsoftware/Markdown4D

Markdown4D 2.1.0

Choose a tag to compare

@cmgeuze cmgeuze released this 03 Sep 14:27

Raw HTML in the viewer

A markdown document leans on HTML for the things markdown cannot express:
centred images, <details> sections, <br>, <kbd>. The viewer used to paint
that markup as plain text, tags and all. It now renders the allowed subset by
translating it to markdown and sending it through the ordinary path, so images,
links, emphasis, headings, lists and <pre> reach the reader.

<script>, <style>, <head>, <iframe> and <object> are dropped with
their content. Any other tag disappears while its content stays.

Copy out of the viewer

A selection can be copied with the keyboard and from a right-click menu.

Demo assets rendered from source

tools\Make-Demo.ps1 builds the screenshots, the social preview card and the
animation in the README by driving the real components rather than capturing
a screen, so they can be rebuilt after any theme or layout change.

Fixes

  • The FMX editor context menu is given the scene it needs to size itself.

Conformance

All 652 CommonMark 0.31.2 examples, the GFM corpora, and 983 unit tests pass.

Downloads

Markdown4DStudioVCL-2.1.0-win64.zip is a portable build of the editor
example, code-signed for GDK Software B.V. Unzip and run
Markdown4DStudioVCL.exe; tools\Install-Markdown4DStudio.ps1 registers it
as the handler for .md files.

Markdown4D 2.0.1

Choose a tag to compare

@cmgeuze cmgeuze released this 31 Aug 12:39

Markdown4D 2.0.1 collects the fixes and small features landed since 2.0.0.

Library

  • The editor rebuilds its scroll mapping whenever the linked preview lays out
    again, so two-way scroll sync works from the moment a document opens and
    stays correct through resizes, arriving images and upgrading diagrams. The
    viewers expose the LayoutCount counter this is built on.
  • The viewers pass the mouse wheel to their parent when their content already
    fits, so viewers stacked inside a scroll box scroll the list they sit in.
  • The FMX viewer and editor draw a draggable overlay scrollbar; FMX has no
    native window scrollbar the way the VCL controls have.
  • Mermaid flowcharts widen the gap between ranks to fit edge labels, so a
    labelled edge keeps a visible line and its caption no longer overlaps the
    nodes.

Examples

  • The example forms are designed in the IDE: components, events and published
    properties live in the DFM and FMX files.
  • The chat demos start streaming on launch and scroll wherever the cursor
    hovers.
  • Opening a document while the pad is already running hands it to the running
    instance as a new tab instead of starting a second window.
  • The streaming demo's sample image comes from this repository instead of an
    external service.

Full list of changes: v2.0.0...v2.0.1

Markdown4D 2.0.0

Choose a tag to compare

@cmgeuze cmgeuze released this 31 Aug 08:48

The first tagged release of Markdown4D: a native Delphi CommonMark / GFM markdown library with a public AST, an incremental streaming parser, an HTML renderer, a lossless markdown writer, and custom-drawn VCL & FMX viewer and editor components. Delphi 12 Athens and Delphi 13, RTL-only, MIT licensed.

Highlights

  • Full CommonMark 0.31.2 conformance: all 652 official examples pass, plus the GFM extension corpora (tables, task list items, strikethrough, extended autolinks, tag filter).
  • A public typed AST with visitor, source spans and a fluent document builder, plus a lossless round-trip markdown writer.
  • An incremental / streaming parser built for editors and token-by-token LLM output; AppendMarkdown marshals to the UI thread for you.
  • Custom-drawn TMarkdownViewer and TMarkdownEditor for VCL and FMX: theming, selection, search, syntax-highlighted code, async images and design-time preview.
  • Native chart (chart code blocks) and mermaid (flowchart / sequence / pie) rendering, drawn by the library's own anti-aliased rasterizer and SVG engine, without a browser or third-party code.

Breaking change: safe rendering by default

TMarkdown.ToHtml now renders safely: raw HTML is omitted and scripting destinations (javascript:, vbscript:, file: and non-image data: schemes) are emptied. For byte-for-byte specification output on input you trust, use TMarkdown.ToUnsafeHtml, or configure a pipeline with UnsafeHtml / UnsafeLinks.

The viewer components route every remote image request, including each hop of a redirect chain, past the host's image settings and the OnRemoteImageRequest event.

See SECURITY.md for the exact promises and docs/API.md for the full public surface.

Installation

Source-only: add Source\Core (and, for the components, Source\Layout plus Source\Vcl or Source\Fmx) to the project search path. For a component-palette install, build the packages in packages\; see packages/INSTALL.md.