Skip to content

Releases: php-collective/djot-php

0.1.26

13 Apr 20:56
d176668

Choose a tag to compare

Fixes

  • Fix unindented paragraph being absorbed as list item continuation when a list item contains a nested block followed by a blank line (#177).

Full Changelog: 0.1.25...0.1.26

0.1.25

02 Apr 02:20
f3f6a70

Choose a tag to compare

Fixes

  • Fix O(n²) performance issue with single quote smart quote matching (#172)
  • Fix HtmlToDjot container and list block serialization (#173)
  • Preserve unsupported figures as raw HTML blocks (#171)
  • Fix SemanticSpanExtension samp and var rendering (#170)
  • Fix HtmlToDjot inline quote escaping (#169)
  • Fix HtmlToDjot multiline attribution and captions (#167)
  • Fix HtmlToDjot MathML extraction edge cases (#166)
  • Fix HtmlToDjot block structure edge cases (#164)
  • Fix HtmlToDjot edge cases for divs, titles, and nested tables (#163)
  • Normalize configured schemes and fix XHTML footnotes (#162)
  • Fix protocol-relative link policy handling and heading ID deduplication (#161)

Improvements

  • Add semantic HTML element support to HtmlToDjot (kbd, dfn, abbr, samp, var, q) (#168)
  • Add HTML→Djot enhancements: attribution, wrapper unwrap, MathML (#165)
  • Add extended round-trip support for reference links, autolinks, custom heading IDs, mentions, tables, and inline code (#157)
  • Add footnote and admonition round-trip support with data attributes (#157)
  • Add line block and raw inline round-trip support (#158)
  • Add abbreviation and escaped character round-trip support (#159)

Full Changelog: 0.1.24...0.1.25

0.1.24

31 Mar 04:41
ad98aff

Choose a tag to compare

New Features

  • Add data-djot-src attribute for visual editor round-trip support - #154

    • Standalone code blocks now include the attribute in round-trip mode
    • CodeGroupExtension preserves ::: code-group syntax
    • TabsExtension preserves :::: tabs syntax with content
    • MermaidExtension preserves ``` mermaid blocks

    This enables WYSIWYG editors to accurately reconstruct Djot source when users switch between visual and text modes.

Fixes

  • Fix MermaidExtension XSS vulnerability - escape < and & while preserving > for arrow syntax
  • Fix code fence selection to use findSafeCodeFence() throughout, preventing conflicts with backticks in content
  • Fix TabsExtension to preserve wrapper and tab attributes during round-trip
  • Fix TabsExtension to handle inline formatting (Strong, Emphasis, Link, Image, BlockQuote) in tab content

Full Changelog: 0.1.23...0.1.24

0.1.23

30 Mar 09:04
375c6ae

Choose a tag to compare

Breaking Changes

  • SoftBreakMode is now independent of significantNewlines - #141
    • Users relying on withSignificantNewlines() to render soft breaks as <br> need to explicitly set the mode:
      // Before (implicit)
      $converter = DjotConverter::withSignificantNewlines();
      
      // After (explicit)
      $converter = DjotConverter::withSignificantNewlines(
          softBreakMode: SoftBreakMode::Break,
      );

Since this are not DJOT default, but compatibility, no direct major just yet.
There is also a clear upgrade guide, and the BC restore is trivial.

New Features

  • Add explicit AST transforms - #149:
    • HeadingShiftTransform for shifting heading levels
    • InlineFootnotesToParenthesesTransform for non-HTML renderers
  • Add roundTripMode for perfect Djot→HTML→Djot round-trips
    $converter = new DjotConverter(roundTripMode: true);
    This is needed for WYSIWYG editors and "text mode fallback"
  • Extension syntax preserved in round-trip mode - #150

Fixes

  • Fix alphabetic list continuation with ambiguous markers
  • Fix display math round-trip in MarkdownToDjot converter
  • Fix task list checkbox handling in HtmlToDjot converter
  • Fix tabs rendering state leaks and heading refs - #144
  • Fix TabsExtension breaking TableOfContentsExtension - #140

Improvements

  • Default code block tab width changed to 4 spaces - #142
  • Refactor HtmlRenderer state into explicit render context - #145
  • Add composition API for clean parser/renderer separation - #143

Full Changelog: 0.1.22...0.1.23

0.1.22

28 Mar 19:40
5b6b08f

Choose a tag to compare

New Extensions

InlineFootnotesExtension

Converts [content]{.fn} spans to inline footnotes, allowing footnote content to be written inline with the text.

$converter = new DjotConverter();
$converter->addExtension(new InlineFootnotesExtension());

$html = $converter->convert('Text[An inline footnote]{.fn} here.');
  • Integrates seamlessly with regular footnotes (shared numbering)
  • Supports full inline formatting in footnote content
  • Uses span-with-class syntax to avoid conflicts with djot's superscript syntax

HeadingReferenceExtension

Resolves [[Heading Text]] references to headings in the current document.

$converter = new DjotConverter();
$converter->addExtension(new HeadingReferenceExtension());

$html = $converter->convert(<<<'DJOT'
See [[Getting Started]] for details.

# Getting Started
DJOT);
// Links to #Getting-Started

Features:

  • Custom display text: [[Heading Text|click here]]
  • Uses explicit heading IDs when available
  • Smart quote normalization for reliable matching
  • Falls back to literal [[...]] text for missing/duplicate headings

Note: Cannot be used together with WikilinksExtension (both parse [[...]] syntax).

Fixes

  • Fixed div fence class merging with attribute block classes - #137
  • Fixed TabsExtension breaking TableOfContentsExtension - #140

Improvements

  • Added registerInlineFootnote() method to HtmlRenderer for extension use

Full Changelog: 0.1.21...0.1.22

0.1.21

27 Mar 19:29
ea1d99e

Choose a tag to compare

Improvements

  • Add CodeGroupExtension for tabbed code block interfaces - ideal for showing code in multiple languages or installation methods - #132
  • Add HeadingLevelShiftExtension for shifting heading levels (h1→h2, h2→h3, etc.) - useful when h1 is reserved for page title - #128
  • Add TabsExtension for tabbed content interfaces with CSS-only and ARIA modes - #130
  • Add MermaidExtension for rendering Mermaid.js diagrams from code blocks - #131
  • Add AdmonitionExtension for semantic admonition markup (note, tip, warning, danger, info, success) with ARIA roles, icons and collapsible support - #129 #134
  • Add progress bar rendering support

Bug Fixes

  • Fix div fence class being replaced instead of merged with attribute block classes - #137

Full Changelog: 0.1.20...0.1.21

0.1.20

25 Mar 16:46

Choose a tag to compare

New Features

  • Add FrontmatterExtension for parsing YAML/TOML/JSON frontmatter at document start - #122 + #124
  • Add softBreakMode parameter to separate (soft break) rendering behavior from significantNewlines parsing - #126

Fixes

  • Fix inconsistent blank line handling in significantNewlines nested lists - #126
  • Remove Markdown-style definition list parsing (term followed by : definition) - #123
    • This syntax was incorrectly parsed as a definition list
    • Now correctly treated as a paragraph (matching djot.js reference implementation)
    • Use proper Djot syntax instead: : term with indented definition

Full Changelog: 0.1.19...0.1.20

0.1.19

23 Mar 22:08
68bd7ce

Choose a tag to compare

Fixes

  • Handle comments in AttributeParser - #108
  • Fix percent sign in quoted attribute values being treated as comment - #109
  • Fix attribute parsing edge cases for curly braces, colons, and escapes - #110
  • Support multiple consecutive attribute blocks - #111
  • Add support for trailing attributes on autolinks - #112
  • Preserve attribute source order in output - #113
  • Fix inline {% %} comments not preserving content after closing - #114
  • Strip leading whitespace from paragraph content - #115
  • Fix SafeMode URL sanitization whitespace bypass - #116
  • Block style attribute in SafeMode::strict() - #117
  • Fix HTML attribute escaping in renderer - #118
  • Fix extension render idempotence - #119
  • Fix profile state for file conversions - #120

Full Changelog: 0.1.18...0.1.19

0.1.18

23 Mar 05:28
b89fc1b

Choose a tag to compare

Fixes

  • Fix Figure rendering in AnsiRenderer to add newline after image - #101
  • Fix .class and #id matching inside quoted attribute values by @danielledeleo in #105

New Contributors

Full Changelog: 0.1.17...0.1.18

0.1.17

10 Mar 13:15
f8f1a4c

Choose a tag to compare

Improvements

  • Make heading IDs CSS-safe while preserving Unicode text - #92

Full Changelog: 0.1.16...0.1.17