You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

522 lines
20 KiB

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