# MD4C Change Log ## Version 0.5.3 Changes: * Avoid repeated prefix `language-` in code block language specification if the input already explicitly includes the prefix. Contributed by [Zach Newton](https://github.com/znewt99). * Permissive autolink extensions (`MD_FLAG_PERMISSIVExxxAUTOLINKS`) are now tiny bit more permissive, allowing `+` and `-` characters to be anywhere in the path portion of the URL. This also improves compatibility with GFM. * Make Unicode-specific code compliant to Unicode 18.0. Fixes: * [#236](https://github.com/mity/md4c/issues/236): Fix quadratic time behavior caused by one-by-one walking over block lines instead of calling `md_lookup_line()`. * [#238](https://github.com/mity/md4c/issues/238): Fix quadratic time and output size behavior caused by malicious misuse of link reference definitions. * [#242](https://github.com/mity/md4c/issues/242): The strike-through extension (with flag `MD_FLAG_STRIKETHROUGH`) now follows same logic as other emphasis spans in respect to punctuation character and word boundaries. * [#248](https://github.com/mity/md4c/issues/248): Fix handling tab when removing trailing whitespace, especially in connection with ATX headers. * [#266](https://github.com/mity/md4c/issues/266): We now correctly abort the parser when a callback returns non-zero. (Previously it worked correctly only for negative values, values greater than zero were causing strange and inconsistent behavior.) * [#271](https://github.com/mity/md4c/issues/271): Fix handling a code span whose closer is on the next line and yet another text follows. In the case we erroneously outputted the closer code span mark as part of the text. * [#275](https://github.com/mity/md4c/issues/275): Fix `md_decode_utf16le_before__()`. (Only affected MD4C builds built with `-MD4C_USE_UTF16` on Windows.) * [#278](https://github.com/mity/md4c/issues/278), [#294](https://github.com/mity/md4c/issues/294): Do not try to interpret characters in a link URL as Markdown syntax characters. * [#292](https://github.com/mity/md4c/issues/292): Fix detection of closing code block fence if it has a trailing tabulator. * [#299](https://github.com/mity/md4c/issues/299): Fix invalid `free()` in an error path. ## Version 0.5.2 Changes: * Changes mandated by CommonMark specification 0.31: - The specification expands set of Unicode characters seen by Markdown parser as a punctuation. Namely all Unicode general categories P (punctuation) and S (symbols) are now seen as such. - The definition of HTML comment has been changed so that `` and `` are also recognized as HTML comments. - HTML tags recognized as HTML block starting condition of type 4 has been updated, namely a tag `` has been removed, whereas `` added. Refer to [CommonMark 0.31.2](https://spec.commonmark.org/0.31.2/) for full specification. Fixes: * [#230](https://github.com/mity/md4c/issues/230): The fix [#223](https://github.com/mity/md4c/issues/223) in 0.5.1 release was incomplete and one corner case remained unfixed. This is now addressed. * [#231](https://github.com/mity/md4c/issues/231): `md2html --full-html` now emits `` in the HTML header. ## Version 0.5.1 Changes: * LaTeX math extension (`MD_FLAG_LATEXMATHSPANS`) now requires that opener mark is not immediately preceded with alpha-numeric character and similarly that closer mark is not immediately followed with alpha-numeric character. So for example `foo$ x + y = z $` is not recognized as LaTeX equation anymore because there is no space between `foo` and the opening `$`. * Table extension (`MD_FLAG_TABLES`) now recognizes only tables with no more than 128 columns. This limit has been imposed to prevent a pathological case of quadratic output size explosion which could be used as DoS attack vector. * We are now more strict with `MD_FLAG_PERMISSIVExxxAUTOLINKS` family of extensions with respect to non-alphanumeric characters, with the aim to mitigate false positive detections. Only relatively few selected non-alphanumeric are now allowed in permissive e-mail auto-links (`MD_FLAG_PERMISSIVEEMAILAUTOLINKS`): - `.`, `-`, `_`, `+` in user name part of e-mail address; and - `.`, `-`, `_` in host part of the e-mail address. Similarly for URL and e-mail auto-links (`MD_FLAG_PERMISSIVEURLAUTOLINKS` and `MD_FLAG_PERMISSIVEWWWAUTOLINKS`): - `.`, `-`, `_` in host part of the URL; - `/`, `.`, `-`, `_` in path part of the URL; - `&`, `.`, `-`, `+`, `_`, `=`, `(`, `)` in the query part of the URL (additionally, if present, `(` and `)` must form balanced pairs); and - `.`, `-`, `+`, `_` in the fragment part of the URL. Furthermore these characters (with some exceptions like where they serve as delimiter characters, e.g. `/` for paths) are generally accepted only when an alphanumeric character both precedes and follows them (i.e. these cannot be "stacked" together). Fixes: * Fix several bugs where we haven't properly respected already resolved spans of higher precedence level in handling of permissive auto-links extensions (family of `MD_FLAG_PERMISSIVExxxAUTOLINKS` flags), LaTeX math extension (`MD_FLAG_LATEXMATHSPANS`) and wiki-links extension (`MD_FLAG_WIKILINKS`) of the form `[[label|text]]` (with pipe `|`). In some complex cases this could lead to invalid internal parser state and memory corruption. Identified with [OSS-Fuzz](https://github.com/google/oss-fuzz). * [#222](https://github.com/mity/md4c/issues/222): Fix strike-through extension (`MD_FLAG_STRIKETHROUGH`) which did not respect same rules for pairing opener and closer marks as other emphasis spans. * [#223](https://github.com/mity/md4c/issues/223): Fix incorrect handling of new-line character just at the beginning and/or end of a code span where we were not following CommonMark specification requirements correctly. ## Version 0.5.0 Changes: * Changes mandated by CommonMark specification 0.30. Actually there are only very minor changes to recognition of HTML blocks: - The tag `