Releases: php-collective/djot-php
0.1.26
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
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
New Features
-
Add
data-djot-srcattribute for visual editor round-trip support - #154- Standalone code blocks now include the attribute in round-trip mode
- CodeGroupExtension preserves
::: code-groupsyntax - TabsExtension preserves
:::: tabssyntax 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
Breaking Changes
SoftBreakModeis now independent ofsignificantNewlines- #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, );
- Users relying on
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:
HeadingShiftTransformfor shifting heading levelsInlineFootnotesToParenthesesTransformfor non-HTML renderers
- Add
roundTripModefor perfect Djot→HTML→Djot round-tripsThis is needed for WYSIWYG editors and "text mode fallback"$converter = new DjotConverter(roundTripMode: true);
- 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
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-StartedFeatures:
- 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 toHtmlRendererfor extension use
Full Changelog: 0.1.21...0.1.22
0.1.21
Improvements
- Add
CodeGroupExtensionfor tabbed code block interfaces - ideal for showing code in multiple languages or installation methods - #132 - Add
HeadingLevelShiftExtensionfor shifting heading levels (h1→h2, h2→h3, etc.) - useful when h1 is reserved for page title - #128 - Add
TabsExtensionfor tabbed content interfaces with CSS-only and ARIA modes - #130 - Add
MermaidExtensionfor rendering Mermaid.js diagrams from code blocks - #131 - Add
AdmonitionExtensionfor 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
New Features
- Add
FrontmatterExtensionfor parsing YAML/TOML/JSON frontmatter at document start - #122 + #124 - Add
softBreakModeparameter to separate (soft break) rendering behavior fromsignificantNewlinesparsing - #126
Fixes
- Fix inconsistent blank line handling in
significantNewlinesnested 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:
: termwith indented definition
Full Changelog: 0.1.19...0.1.20
0.1.19
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
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
- @danielledeleo made their first contribution in #105
Full Changelog: 0.1.17...0.1.18
0.1.17
Improvements
- Make heading IDs CSS-safe while preserving Unicode text - #92
Full Changelog: 0.1.16...0.1.17