Added
-
Support for Parsedown 1.8
- Compatible with Parsedown
1.7.4+and1.8.x - Minimum required version remains
1.7.4
- Compatible with Parsedown
-
New
anchor_prefixoption- 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, ...)
- Headings like
-
Invalid
limitvaluessetTocLimit()now throwsInvalidArgumentExceptionfor0or negative values- Prevents unintended empty anchor IDs
-
Duplicate anchor suffix delimiter
- Now respects configured
delimiterinstead of always using-
- Now respects configured
-
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_DEPRECATEDnotices