You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delimiters may be deleted, so we store delimiter positions instead of
pointers. This also allows us to optimize searches within the stack,
avoiding quadratic behavior when parsing emphasis.
See github/cmark-gfm@75008f1
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6-1
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,9 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
18
18
-`[` and `]` are no longer added as `Delimiter` objects on the stack; a new `Bracket` type with its own stack is used instead
19
19
-`UrlAutolinkParser` no longer parses URLs with more than 127 subdomains
20
20
- Expanded reference links can no longer exceed 100kb, or the size of the input document (whichever is greater)
21
+
- Delimiters should always provide a non-null value via `DelimiterInterface::getIndex()`
22
+
- We'll attempt to infer the index based on surrounding delimiters where possible
23
+
- The `DelimiterStack` now accepts integer positions for any `$stackBottom` argument
21
24
- Several small performance optimizations
22
25
23
26
## [2.5.3] - 2024-08-16
@@ -95,14 +98,16 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
95
98
96
99
- Returning dynamic values from `DelimiterProcessorInterface::getDelimiterUse()` is deprecated
97
100
- You should instead implement `CacheableDelimiterProcessorInterface` to help the engine perform caching to avoid performance issues.
101
+
- Failing to set a delimiter's index (or returning `null` from `DelimiterInterface::getIndex()`) is deprecated and will not be supported in 3.0
98
102
- Deprecated `DelimiterInterface::isActive()` and `DelimiterInterface::setActive()`, as these are no longer used by the engine
99
103
- Deprecated `DelimiterStack::removeEarlierMatches()` and `DelimiterStack::searchByCharacter()`, as these are no longer used by the engine
104
+
- Passing a `DelimiterInterface` as the `$stackBottom` argument to `DelimiterStack::processDelimiters()` or `::removeAll()` is deprecated and will not be supported in 3.0; pass the integer position instead.
100
105
101
106
### Fixed
102
107
103
108
- Fixed NUL characters not being replaced in the input
- Fixed quadratic complexity finding the bottom opener for emphasis and strikethrough delimiters
110
+
- Fixed quadratic complexity parsing emphasis and strikethrough delimiters
106
111
- Fixed issue where having 500,000+ delimiters could trigger a [known segmentation fault issue in PHP's garbage collection](https://bugs.php.net/bug.php?id=68606)
107
112
- Fixed quadratic complexity deactivating link openers
108
113
- Fixed catastrophic backtracking when parsing link labels/titles
// No index was defined on this delimiter, and none could be guesstimated based on the stack.
398
+
thrownewLogicException('No index was defined on this delimiter, and none could be guessed based on the stack. Ensure you are passing the index when instantiating the Delimiter.');
0 commit comments