Skip to content

v1.6.0

Latest

Choose a tag to compare

@BenjaminHoegh BenjaminHoegh released this 27 Apr 15:14
· 35 commits to 1.x since this release

Added

  • Support for Parsedown 1.8

    • Compatible with Parsedown 1.7.4+ and 1.8.x
    • Minimum required version remains 1.7.4
  • New anchor_prefix option

    • Prepends a string to all generated anchor IDs
    • Default: ''
    • Set via setTocAnchorPrefix(string $prefix)

Changed

Renamed options (with deprecations)

The following option keys have been renamed for clarity. Old keys still work via setOptions() but trigger E_USER_DEPRECATED.

Deprecated New
blacklist reserved_ids
url base_url
limit max_anchor_length

Renamed methods (with deprecations)

The following methods are deprecated and will be removed in a future release:

Deprecated method Replacement
setTocBlacklist(array $blacklist) setTocReservedIds(array $reservedIds)
setTocUrl(string $url) setTocBaseUrl(string $url)
setTocLimit(?int $limit) setTocMaxAnchorLength(?int $length)

All deprecated methods trigger E_USER_DEPRECATED and internally delegate to their replacements.


Fixed

  • Empty anchor IDs for symbol-only headings

    • Headings like ### --- or ### © no longer produce empty IDs
    • Fallback now uses section, with deduplication (section-1, section-2, ...)
  • Invalid limit values

    • setTocLimit() now throws InvalidArgumentException for 0 or negative values
    • Prevents unintended empty anchor IDs
  • Duplicate anchor suffix delimiter

    • Now respects configured delimiter instead of always using -
  • Incorrect error location in contentsList()

    • Error messages now correctly reference the caller
    • Backtrace limited to relevant frames
  • Empty headings in ToC

    • Anchor IDs are no longer generated for completely empty headings

Deprecations

  • Old option keys and methods are deprecated
  • They will be removed in a future release
  • Update to the new names to avoid E_USER_DEPRECATED notices