1# Change Log 2All notable changes to this project will be documented in this file. 3Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) principles. 4 5## [Unreleased][unreleased] 6 7## [1.6.7] - 2022-01-13 8 9### Changed 10 11 - Added `ReturnTypeWillChange` attribute to prevent PHP 8.1 deprecation warnings (#785) 12 - Coerced punctuation counts to integers to ensure floats are never used 13 14## [1.6.6] - 2021-07-17 15 16### Fixed 17 18 - Fixed Mentions inside of links creating nested links against the spec's rules (#688) 19 20## [1.6.5] - 2021-06-26 21 22### Changed 23 24 - Simplified checks for thematic breaks 25 26### Fixed 27 28 - Fixed ExternalLinkProcessor not handling autolinks by adjusting its priority to -50 (#681) 29 30## [1.6.4] - 2021-06-19 31 32### Changed 33 34 - Optimized attribute parsing to avoid inspecting every space character (30% performance boost) 35 36## [1.6.3] - 2021-06-19 37 38### Fixed 39 40 - Fixed incorrect parsing of tilde-fenced code blocks with leading spaces (#676) 41 42## [1.6.2] - 2021-05-12 43 44### Fixed 45 46 - Fixed incorrect error level for deprecation notices 47 48## [1.6.1] - 2021-05-08 49 50### Fixed 51 52 - Fixed `HeadingPermalinkProcessor` skipping text contents from certain nodes (#615) 53 54## [1.6.0] - 2021-05-01 55 56### Added 57 58 - Added forward-compatibility for [configuration options which will be changing in 2.0](https://commonmark.thephpleague.com/1.6/upgrading/): 59 - `commonmark/enable_em` (currently `enable_em` in 1.x) 60 - `commonmark/enable_strong` (currently `enable_strong` in 1.x) 61 - `commonmark/use_asterisk` (currently `use_asterisk` in 1.x) 62 - `commonmark/use_underscore` (currently `use_underscore` in 1.x) 63 - `commonmark/unordered_list_markers` (currently `unordered_list_markers` in 1.x) 64 - `mentions/*/prefix` (currently `mentions/*/symbol` in 1.x) 65 - `mentions/*/pattern` (currently `mentions/*/regex` in 1.x) 66 - `max_nesting_level` (currently supports `int` and `float` values in 1.x; will only support `int` in 2.0) 67 - Added new `MarkdownConverter` class for creating converters with custom environments; this replaces the previously-deprecated `Converter` class 68 - Added new `RegexHelper::matchFirst()` method 69 - Added new `Configuration::exists()` method 70 71### Changed 72 73 - The `max_nesting_level` option now defaults to `PHP_INT_MAX` instead of `INF` 74 75### Deprecated 76 77 - Deprecated the [configuration options shown above](https://commonmark.thephpleague.com/1.6/upgrading/) 78 - Deprecated the ability to pass a custom `Environment` into the constructors of `CommonMarkConverter` and `GithubFlavoredMarkdownConverter`; use `MarkdownConverter` instead 79 - Deprecated `ConfigurableEnvironmentInterface::setConfig()`; use `mergeConfig()` instead 80 - Deprecated calling `ConfigurableEnvironmentInterface::mergeConfig()` without any parameters 81 - Deprecated calling `Configuration::get()` and `EnvironmentInterface::getConfig()` without any parameters 82 - Deprecated calling `Configuration::set()` without the second `$value` parameter 83 - Deprecated `RegexHelper::matchAll()`; use `RegexHelper::matchFirst()` instead 84 - Deprecated extending the `ArrayCollection` class; will be marked `final` in 2.0 85 86### Fixed 87 88 - Fixed missing check for empty arrays being passed into the `unordered_list_markers` configuration option 89 90## [1.5.8] - 2021-03-28 91 92### Fixed 93 94 - Fixed Table of Contents not rendering heading inlines properly (#587, #588) 95 - Fixed parsing of tables within list items (#590) 96 97## [1.5.7] - 2020-10-31 98 99### Fixed 100 101 - Fixed mentions not being parsed when appearing after non-word characters (#582) 102 103## [1.5.6] - 2020-10-17 104 105### Changed 106 107 - Blocks added outside of the parsing context now have their start/end line numbers defaulted to 0 to avoid type errors (#579) 108 109### Fixed 110 111 - Fixed replacement blocks not inheriting the start line number of the container they're replacing (#579) 112 - Fixed Table of Contents blocks not having correct start/end line numbers (#579) 113 114## [1.5.5] - 2020-09-13 115 116### Changed 117 118 - Bumped CommonMark spec compliance to 0.28.2 119 120### Fixed 121 122 - Fixed `textarea` elements not being treated as a type 1 HTML block (like `script`, `style`, or `pre`) 123 - Fixed autolink processor not handling other unmatched trailing parentheses 124 125## [1.5.4] - 2020-08-17 126 127### Fixed 128 129 - Fixed footnote ID configuration not taking effect (#524, #530) 130 - Fixed heading permalink slugs not being unique (#531, #534) 131 132## [1.5.3] - 2020-07-19 133 134### Fixed 135 136 - Fixed regression of multi-byte inline parser characters not being matched 137 138## [1.5.2] - 2020-07-19 139 140### Changed 141 142 - Significantly improved performance of the inline parser regex 143 144### Fixed 145 146 - Fixed parent class lookups for non-existent classes on PHP 8 (#517) 147 148## [1.5.1] - 2020-06-27 149 150### Fixed 151 152 - Fixed UTF-8 encoding not being checked in the `UrlEncoder` utility (#509) or the `Cursor` 153 154## [1.5.0] - 2020-06-21 155 156### Added 157 158 - Added new `AttributesExtension` based on <https://github.com/webuni/commonmark-attributes-extension> (#474) 159 - Added new `FootnoteExtension` based on <https://github.com/rezozero/commonmark-ext-footnotes> (#474) 160 - Added new `MentionExtension` to replace `InlineMentionParser` with more flexibility and customization 161 - Added the ability to render `TableOfContents` nodes anywhere in a document (given by a placeholder) 162 - Added the ability to properly clone `Node` objects 163 - Added options to customize the value of `rel` attributes set via the `ExternalLink` extension (#476) 164 - Added a new `heading_permalink/slug_normalizer` configuration option to allow custom slug generation (#460) 165 - Added a new `heading_permalink/symbol` configuration option to replace the now deprecated `heading_permalink/inner_contents` configuration option (#505) 166 - Added `SlugNormalizer` and `TextNormalizer` classes to make normalization reusable by extensions (#485) 167 - Added new classes: 168 - `TableOfContentsGenerator` 169 - `TableOfContentsGeneratorInterface` 170 - `TableOfContentsPlaceholder` 171 - `TableOfContentsPlaceholderParser` 172 - `TableOfContentsPlaceholderRenderer` 173 174### Changed 175 176 - "Moved" the `TableOfContents` class into a new `Node` sub-namespace (with backward-compatibility) 177 - Reference labels are now generated and stored in lower-case instead of upper-case 178 - Reference labels are no longer normalized inside the `Reference`, only the `ReferenceMap` 179 180### Fixed 181 182 - Fixed reference label case folding polyfill not being consistent between different PHP versions 183 184### Deprecated 185 186 - Deprecated the `CommonMarkConverter::VERSION` constant (#496) 187 - Deprecated `League\CommonMark\Extension\Autolink\InlineMentionParser` (use `League\CommonMark\Extension\Mention\MentionParser` instead) 188 - Deprecated everything under `League\CommonMark\Extension\HeadingPermalink\Slug` (use the classes under `League\CommonMark\Normalizer` instead) 189 - Deprecated `League\CommonMark\Extension\TableOfContents\TableOfContents` (use the one in the new `Node` sub-namespace instead) 190 - Deprecated the `STYLE_` and `NORMALIZE_` constants in `TableOfContentsBuilder` (use the ones in `TableOfContentsGenerator` instead) 191 - Deprecated the `\League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkRenderer::DEFAULT_INNER_CONTENTS` constant (#505) 192 - Deprecated the `heading_permalink/inner_contents` configuration option in the `HeadingPermalink` extension (use the new `heading_permalink/symbol` configuration option instead) (#505) 193 194## [1.4.3] - 2020-05-04 195 196### Fixed 197 198 - Fixed certain Unicode letters, numbers, and marks not being preserved when generating URL slugs (#467) 199 200## [1.4.2] - 2020-04-24 201 202### Fixed 203 204 - Fixed inline code blocks not be included within heading permalinks (#457) 205 206## [1.4.1] - 2020-04-20 207 208### Fixed 209 210 - Fixed BC break caused by ConverterInterface alias not being used by some DI containers (#454) 211 212## [1.4.0] - 2020-04-18 213 214### Added 215 216 - Added new [Heading Permalink extension](https://commonmark.thephpleague.com/extensions/heading-permalinks/) (#420) 217 - Added new [Table of Contents extension](https://commonmark.thephpleague.com/extensions/table-of-contents/) (#441) 218 - Added new `MarkdownConverterInterface` as a long-term replacement for `ConverterInterface` (#439) 219 - Added new `DocumentPreParsedEvent` event (#427, #359, #399) 220 - Added new `ListBlock::TYPE_BULLET` constant as a replacement for `ListBlock::TYPE_UNORDERED` 221 - Added new `MarkdownInput` class and `MarkdownInputInterface` to handle pre-parsing and allow listeners to replace Markdown contents 222 223### Changed 224 225 - Block & inline renderers will now render child classes automatically (#222, #209) 226 - The `ListBlock` constants now use fully-lowercased values instead of titlecased values 227 - Significantly improved typing 228 229### Fixed 230 231 - Fixed loose comparison when checking for table alignment 232 - Fixed `StaggeredDelimiterProcessor` returning from a `void` function 233 234### Deprecated 235 236 - The `Converter` class has been deprecated; use `CommonMarkConverter` instead (#438, #439) 237 - The `ConverterInterface` has been deprecated; use `MarkdownConverterInterface` instead (#438, #439) 238 - The `bin/commonmark` script has been deprecated 239 - The following methods of `ArrayCollection` have been deprecated: 240 - `add()` 241 - `set()` 242 - `get()` 243 - `remove()` 244 - `isEmpty()` 245 - `contains()` 246 - `indexOf()` 247 - `containsKey()` 248 - `replaceWith()` 249 - `removeGaps()` 250 - The `ListBlock::TYPE_UNORDERED` constant has been deprecated, use `ListBlock::TYPE_BULLET` instead 251 252## [1.3.4] - 2020-04-13 253 254### Fixed 255 256 - Fixed configuration/environment not being injected into event listeners when adding them via `[$instance, 'method']` callable syntax (#440) 257 258## [1.3.3] - 2020-04-05 259 260### Fixed 261 262 - Fixed event listeners not having the environment or configuration injected if they implemented the `EnvironmentAwareInterface` or `ConfigurationAwareInterface` (#423) 263 264## [1.3.2] - 2020-03-25 265 266### Fixed 267 268 - Optimized URL normalization in cases where URLs don't contain special characters (#417, #418) 269 270## [1.3.1] - 2020-02-28 271 272### Fixed 273 274 - Fixed return types of `Environment::createCommonMarkEnvironment()` and `Environment::createGFMEnvironment()` 275 276## [1.3.0] - 2020-02-08 277 278### Added 279 280 - Added (optional) **full GFM support!** (#409) 281 - Added check to ensure Markdown input is valid UTF-8 (#401, #405) 282 - Added new `unordered_list_markers` configuration option (#408, #411) 283 284### Changed 285 286 - Introduced several micro-optimizations for a 5-10% performance boost 287 288## [1.2.2] - 2020-01-15 289 290This release contains the same changes as 1.1.3: 291 292### Fixed 293 294 - Fixed link parsing edge case (#403) 295 296## [1.1.3] - 2020-01-15 297 298### Fixed 299 300 - Fixed link parsing edge case (#403) 301 302## [1.2.1] - 2020-01-14 303 304### Changed 305 306 - Introduced several micro-optimizations, reducing the parse time by 8% 307 308## [1.2.0] - 2020-01-09 309 310### Changed 311 312 - Removed URL decoding step before encoding (more performant and better matches the JS library) 313 - Removed redundant token from HTML tag regex 314 315## [1.1.2] - 2019-12-09 316 317### Fixed 318 319 - Fixed URL normalization not handling non-UTF-8 sequences properly (#395, #396) 320 321## [1.1.1] - 2019-11-11 322 323### Fixed 324 325 - Fixed handling of link destinations with unbalanced unescaped parens 326 - Fixed adding delimiters to stack which can neither open nor close a run 327 328## [1.1.0] - 2019-10-31 329 330### Added 331 332 - Added a new `Html5EntityDecoder` class (#387) 333 334### Changed 335 336 - Improved performance by 10% (#389) 337 - Made entity decoding less memory-intensive (#386, #387) 338 339### Fixed 340 341 - Fixed PHP 7.4 compatibility issues 342 343### Deprecated 344 345 - Deprecated the `Html5Entities` class - use `Html5EntityDecoder` instead (#387) 346 347## [1.0.0] - 2019-06-29 348 349No changes were made since 1.0.0-rc1. 350 351## [1.0.0-rc1] - 2019-06-19 352 353### Added 354 355 - Extracted a `ReferenceMapInterface` from the `ReferenceMap` class 356 - Added optional `ReferenceMapInterface` parameter to the `Document` constructor 357 358### Changed 359 360 - Replaced all references to `ReferenceMap` with `ReferenceMapInterface` 361 - `ReferenceMap::addReference()` no longer returns `$this` 362 363### Fixed 364 365 - Fixed bug where elements with content of `"0"` wouldn't be rendered (#376) 366 367## [1.0.0-beta4] - 2019-06-05 368 369### Added 370 371 - Added event dispatcher functionality (#359, #372) 372 373### Removed 374 375 - Removed `DocumentProcessorInterface` functionality in favor of event dispatching (#373) 376 377## [1.0.0-beta3] - 2019-05-27 378 379### Changed 380 381 - Made the `Delimiter` class final and extracted a new `DelimiterInterface` 382 - Modified most external usages to use this new interface 383 - Renamed three `Delimiter` methods: 384 - `getOrigDelims()` renamed to `getOriginalLength()` 385 - `getNumDelims()` renamed to `getLength()` 386 - `setNumDelims()` renamed to `setLength()` 387 - Made additional classes final: 388 - `DelimiterStack` 389 - `ReferenceMap` 390 - `ReferenceParser` 391 - Moved `ReferenceParser` into the `Reference` sub-namespace 392 393### Removed 394 395 - Removed unused `Delimiter` methods: 396 - `setCanOpen()` 397 - `setCanClose()` 398 - `setChar()` 399 - `setIndex()` 400 - `setInlineNode()` 401 - Removed fluent interface from `Delimiter` (setter methods now have no return values) 402 403## [1.0.0-beta2] - 2019-05-27 404 405### Changed 406 407 - `DelimiterProcessorInterface::process()` will accept any type of `AbstractStringContainer` now, not just `Text` nodes 408 - The `Delimiter` constructor, `getInlineNode()`, and `setInlineNode()` no longer accept generic `Node` elements - only `AbstractStringContainer`s 409 410 411### Removed 412 413 - Removed all deprecated functionality: 414 - The `safe` option (use `html_input` and `allow_unsafe_links` options instead) 415 - All deprecated `RegexHelper` constants 416 - `DocParser::getEnvironment()` (you should obtain it some other way) 417 - `AbstractInlineContainer` (use `AbstractInline` instead and make `isContainer()` return `true`) 418 419## [1.0.0-beta1] - 2019-05-26 420 421### Added 422 423 - Added proper support for delimiters, including custom delimiters 424 - `addDelimiterProcessor()` added to `ConfigurableEnvironmentInterface` and `Environment` 425 - Basic delimiters no longer need custom parsers - they'll be parsed automatically 426 - Added new methods: 427 - `AdjacentTextMerger::mergeTextNodesBetweenExclusive()` 428 - `CommonMarkConveter::getEnvironment()` 429 - `Configuration::set()` 430 - Extracted some new interfaces from base classes: 431 - `DocParserInterface` created from `DocParser` 432 - `ConfigurationInterface` created from `Configuration` 433 - `ReferenceInterface` created from `Reference` 434 435### Changed 436 437 - Renamed several methods of the `Configuration` class: 438 - `getConfig()` renamed to `get()` 439 - `mergeConfig()` renamed to `merge()` 440 - `setConfig()` renamed to `replace()` 441 - Changed `ConfigurationAwareInterface::setConfiguration()` to accept the new `ConfigurationInterface` instead of the concrete class 442 - Renamed the `AdjoiningTextCollapser` class to `AdjacentTextMerger` 443 - Replaced its `collapseTextNodes()` method with the new `mergeChildNodes()` method 444 - Made several classes `final`: 445 - `Configuration` 446 - `DocParser` 447 - `HtmlRenderer` 448 - `InlineParserEngine` 449 - `NodeWalker` 450 - `Reference` 451 - All of the block/inline parsers and renderers 452 - Reduced visibility of several internal methods to `private`: 453 - `DelimiterStack::findEarliest()` 454 - All `protected` methods in `InlineParserEngine` 455 - Marked some classes and methods as `@internal` 456 - `ElementRendererInterface` now requires a public `renderInline()` method; added this to `HtmlRenderer` 457 - Changed `InlineParserEngine::parse()` to require an `AbstractStringContainerBlock` instead of the generic `Node` class 458 - Un-deprecated the `CommonmarkConverter::VERSION` constant 459 - The `Converter` constructor now requires an instance of `DocParserInterface` instead of the concrete `DocParser` 460 - Changed `Emphasis`, `Strong`, and `AbstractWebResource` to directly extend `AbstractInline` instead of the (now-deprecated) intermediary `AbstractInlineContainer` class 461 462### Fixed 463 464 - Fixed null errors when inserting sibling `Node`s without parents 465 - Fixed `NodeWalkerEvent` not requiring a `Node` via its constructor 466 - Fixed `Reference::normalizeReference()` improperly converting to uppercase instead of performing proper Unicode case-folding 467 - Fixed strong emphasis delimiters not being preserved when `enable_strong` is set to `false` (it now works identically to `enable_em`) 468 469### Deprecated 470 471 - Deprecated `DocParser::getEnvironment()` (you should obtain it some other way) 472 - Deprecated `AbstractInlineContainer` (use `AbstractInline` instead and make `isContainer()` return `true`) 473 474### Removed 475 476 - Removed inline processor functionality now that we have proper delimiter support: 477 - Removed `addInlineProcessor()` from `ConfigurableEnvironmentInterface` and `Environment` 478 - Removed `getInlineProcessors()` from `EnvironmentInterface` and `Environment` 479 - Removed `EmphasisProcessor` 480 - Removed `InlineProcessorInterface` 481 - Removed `EmphasisParser` now that we have proper delimiter support 482 - Removed support for non-UTF-8-compatible encodings 483 - Removed `getEncoding()` from `ContextInterface` 484 - Removed `getEncoding()`, `setEncoding()`, and `$encoding` from `Context` 485 - Removed `getEncoding()` and the second `$encoding` constructor param from `Cursor` 486 - Removed now-unused methods 487 - Removed `DelimiterStack::getTop()` (no replacement) 488 - Removed `DelimiterStack::iterateByCharacters()` (use the new `processDelimiters()` method instead) 489 - Removed the protected `DelimiterStack::findMatchingOpener()` method 490 491[unreleased]: https://github.com/thephpleague/commonmark/compare/1.6.7...1.6 492[1.6.7]: https://github.com/thephpleague/commonmark/compare/1.6.6...1.6.7 493[1.6.6]: https://github.com/thephpleague/commonmark/compare/1.6.5...1.6.6 494[1.6.5]: https://github.com/thephpleague/commonmark/compare/1.6.4...1.6.5 495[1.6.4]: https://github.com/thephpleague/commonmark/compare/1.6.3...1.6.4 496[1.6.3]: https://github.com/thephpleague/commonmark/compare/1.6.2...1.6.3 497[1.6.2]: https://github.com/thephpleague/commonmark/compare/1.6.1...1.6.2 498[1.6.1]: https://github.com/thephpleague/commonmark/compare/1.6.0...1.6.1 499[1.6.0]: https://github.com/thephpleague/commonmark/compare/1.5.8...1.6.0 500[1.5.8]: https://github.com/thephpleague/commonmark/compare/1.5.7...1.5.8 501[1.5.7]: https://github.com/thephpleague/commonmark/compare/1.5.6...1.5.7 502[1.5.6]: https://github.com/thephpleague/commonmark/compare/1.5.5...1.5.6 503[1.5.5]: https://github.com/thephpleague/commonmark/compare/1.5.4...1.5.5 504[1.5.4]: https://github.com/thephpleague/commonmark/compare/1.5.3...1.5.4 505[1.5.3]: https://github.com/thephpleague/commonmark/compare/1.5.2...1.5.3 506[1.5.2]: https://github.com/thephpleague/commonmark/compare/1.5.1...1.5.2 507[1.5.1]: https://github.com/thephpleague/commonmark/compare/1.5.0...1.5.1 508[1.5.0]: https://github.com/thephpleague/commonmark/compare/1.4.3...1.5.0 509[1.4.3]: https://github.com/thephpleague/commonmark/compare/1.4.2...1.4.3 510[1.4.2]: https://github.com/thephpleague/commonmark/compare/1.4.1...1.4.2 511[1.4.1]: https://github.com/thephpleague/commonmark/compare/1.4.0...1.4.1 512[1.4.0]: https://github.com/thephpleague/commonmark/compare/1.3.4...1.4.0 513[1.3.4]: https://github.com/thephpleague/commonmark/compare/1.3.3...1.3.4 514[1.3.3]: https://github.com/thephpleague/commonmark/compare/1.3.2...1.3.3 515[1.3.2]: https://github.com/thephpleague/commonmark/compare/1.3.1...1.3.2 516[1.3.1]: https://github.com/thephpleague/commonmark/compare/1.3.0...1.3.1 517[1.3.0]: https://github.com/thephpleague/commonmark/compare/1.2.2...1.3.0 518[1.2.2]: https://github.com/thephpleague/commonmark/compare/1.2.1...1.2.2 519[1.2.1]: https://github.com/thephpleague/commonmark/compare/1.2.0...1.2.1 520[1.2.0]: https://github.com/thephpleague/commonmark/compare/1.1.2...1.2.0 521[1.1.3]: https://github.com/thephpleague/commonmark/compare/1.1.2...1.1.3 522[1.1.2]: https://github.com/thephpleague/commonmark/compare/1.1.1...1.1.2 523[1.1.1]: https://github.com/thephpleague/commonmark/compare/1.1.0...1.1.1 524[1.1.0]: https://github.com/thephpleague/commonmark/compare/1.0.0...1.1.0 525[1.0.0]: https://github.com/thephpleague/commonmark/compare/1.0.0-rc1...1.0.0 526[1.0.0-rc1]: https://github.com/thephpleague/commonmark/compare/1.0.0-beta4...1.0.0-rc1 527[1.0.0-beta4]: https://github.com/thephpleague/commonmark/compare/1.0.0-beta3...1.0.0-beta4 528[1.0.0-beta3]: https://github.com/thephpleague/commonmark/compare/1.0.0-beta2...1.0.0-beta3 529[1.0.0-beta2]: https://github.com/thephpleague/commonmark/compare/1.0.0-beta1...1.0.0-beta2 530[1.0.0-beta1]: https://github.com/thephpleague/commonmark/compare/0.19.2...1.0.0-beta1 531