cmark
My personal build of CMark ✏️
changelog.txt (54479B)
1 [0.29.0] 2 3 * Update spec to 0.29. 4 * Make rendering safe by default (#239, #273). 5 Adds `CMARK_OPT_UNSAFE` and make `CMARK_OPT_SAFE` a no-op (for API 6 compatibility). The new default behavior is to suppress raw HTML and 7 potentially dangerous links. The `CMARK_OPT_UNSAFE` option has to be set 8 explicitly to prevent this. 9 **NOTE:** This change will require modifications in bindings for cmark 10 and in most libraries and programs that use cmark. 11 Borrows heavily from @kivikakk's patch in github/cmark-gfm#123. 12 * Add sourcepos info for inlines (Yuki Izumi). 13 * Disallow more than 32 nested balanced parens in a link (Yuki Izumi). 14 * Resolve link references before creating setext header. 15 A setext header line after a link reference should not 16 create a header, according to the spec. 17 * commonmark renderer: improve escaping. 18 URL-escape special characters when escape mode is URL, and not otherwise. 19 Entity-escape control characters (< 0x20) in non-literal escape modes. 20 * render: only emit actual newline when escape mode is LITERAL. 21 For markdown content, e.g., in other contexts we want some 22 kind of escaping, not a literal newline. 23 * Update code span normalization to conform with spec change. 24 * Allow empty `<>` link destination in reference link. 25 * Remove leftover includes of `memory.h` (#290). 26 * A link destination can't start with `<` unless it is 27 an angle-bracket link that also ends with `>` (#289). 28 (If your URL really starts with `<`, URL-escape it.) 29 * Allow internal delimiter runs to match if both have lengths that are 30 multiples of 3. See commonmark/commonmark#528. 31 * Include `references.h` in `parser.h` (#287). 32 * Fix `[link](<foo\>)`. 33 * Use hand-rolled scanner for thematic break (see #284). 34 Keep track of the last position where a thematic break 35 failed to match on a line, to avoid rescanning unnecessarily. 36 * Rename `ends_with_blank_line` with `S_` prefix. 37 * Add `CMARK_NODE__LAST_LINE_CHECKED` flag (#284). 38 Use this to avoid unnecessary recursion in `ends_with_blank_line`. 39 * In `ends_with_blank_line`, call `S_set_last_line_blank` 40 to avoid unnecessary repetition (#284). Once we settle whether a list 41 item ends in a blank line, we don't need to revisit this in considering 42 parent list items. 43 * Disallow unescaped `(` in parenthesized link title. 44 * Copy line/col info straight from opener/closer (Ashe Connor). 45 We can't rely on anything in `subj` since it's been modified while parsing 46 the subject and could represent line info from a future line. This is 47 simple and works. 48 * `render.c`: reset `last_breakable` after cr. Fixes jgm/pandoc#5033. 49 * Fix a typo in `houdini_href_e.c` (Felix Yan). 50 * commonmark writer: use `~~~` fences if info string contains backtick. 51 This is needed for round-trip tests. 52 * Update scanners for new info string rules. 53 * Add XSLT stylesheet to convert cmark XML back to Commonmark 54 (Nick Wellnhofer, #264). Initial version of an XSLT stylesheet that 55 converts the XML format produced by `cmark -t xml` back to Commonmark. 56 * Check for whitespace before reference title (#263). 57 * Bump CMake to version 3 (Jonathan Müller). 58 * Build: Remove deprecated call to `add_compiler_export_flags()` 59 (Jonathan Müller). It is deprecated in CMake 3.0, the replacement is to 60 set the `CXX_VISIBILITY_PRESET` (or in our case `C_VISIBILITY_PRESET`) and 61 `VISIBILITY_INLINES_HIDDEN` properties of the target. We're already 62 setting them by setting the CMake variables anyway, so the call can be 63 removed. 64 * Build: only attempt to install MSVC system libraries on Windows 65 (Saleem Abdulrasool). Newer versions of CMake attempt to query the system 66 for information about the VS 2017 installation. Unfortunately, this query 67 fails on non-Windows systems when cross-compiling: 68 `cmake_host_system_information does not recognize <key> VS_15_DIR`. 69 CMake will not find these system libraries on non-Windows hosts anyways, 70 and we were silencing the warnings, so simply omit the installation when 71 cross-compiling to Windows. 72 * Simplify code normalization, in line with spec change. 73 * Implement code span spec changes. These affect both parsing and writing 74 commonmark. 75 * Add link parsing corner cases to regressions (Ashe Connor). 76 * Add `xml:space="preserve"` in XML output when appropriate 77 (Nguyễn Thái Ngọc Duy). 78 (For text, code, code_block, html_inline and html_block tags.) 79 * Removed meta from list of block tags. Added regression test. 80 See commonmark/CommonMark#527. 81 * `entity_tests.py` - omit noisy success output. 82 * `pathological_tests.py`: make tests run faster. 83 Commented out the (already ignored) "many references" test, which 84 times out. Reduced the iterations for a couple other tests. 85 * `pathological_tests.py`: added test for deeply nested lists. 86 * Optimize `S_find_first_nonspace`. We were needlessly redoing things we'd 87 already done. Now we skip the work if the first nonspace is greater than 88 the current offset. This fixes pathological slowdown with deeply nested 89 lists (#255). For N = 3000, the time goes from over 17s to about 0.7s. 90 Thanks to Martin Mitas for diagnosing the problem. 91 * Allow spaces in link destination delimited with pointy brackets. 92 * Adjust max length of decimal/numeric entities. 93 See commonmark/CommonMark#487. 94 * Fix inline raw HTML parsing. 95 This fixes a recently added failing spec test case. Previously spaces 96 were being allowed in unquoted attribute values; no we forbid them. 97 * Don't allow list markers to be indented >= 4 spaces. 98 See commonmark/CommonMark#497. 99 * Check for empty buffer when rendering (Phil Turnbull). 100 For empty documents, `->size` is zero so 101 `renderer.buffer->ptr[renderer.buffer->size - 1]` will cause an 102 out-of-bounds read. Empty buffers always point to the global 103 `cmark_strbuf__initbuf` buffer so we read `cmark_strbuf__initbuf[-1]`. 104 * Also run API tests with `CMARK_SHARED=OFF` (Nick Wellnhofer). 105 * Rename roundtrip and entity tests (Nick Wellnhofer). 106 Rename the tests to reflect that they use the library, not the 107 executable. 108 * Generate export header for static-only build (#247, Nick Wellnhofer). 109 * Fuzz width parameter too (Phil Turnbull). Allow the `width` parameter to 110 be generated too so we get better fuzz-coverage. 111 * Don't discard empty fuzz test-cases (Phil Turnbull). We currently discard 112 fuzz test-cases that are empty but empty inputs are valid markdown. This 113 improves the fuzzing coverage slightly. 114 * Fixed exit code for pathological tests. 115 * Add allowed failures to `pathological_tests.py`. 116 This allows us to include tests that we don't yet know how to pass. 117 * Add timeout to `pathological_tests.py`. 118 Tests must complete in 8 seconds or are errors. 119 * Add more pathological tests (Martin Mitas). 120 These tests target the issues #214, #218, #220. 121 * Use pledge(2) on OpenBSD (Ashe Connor). 122 * Update the Racket wrapper (Eli Barzilay). 123 * Makefile: For afl target, don't build tests. 124 125 [0.28.3] 126 127 * Include GNUInstallDirs in src/CMakeLists.txt (Nick Wellnhofer, #240). 128 This fixes build problems on some cmake versions (#241). 129 130 [0.28.2] 131 132 * Fixed regression in install dest for static library (#238). 133 Due to a mistake, 0.28.1 installed libcmark.a into include/. 134 135 [0.28.1] 136 137 * `--smart`: open quote can never occur right after `]` or `)` (#227). 138 * Fix quadratic behavior in `finalize` (Vicent Marti). 139 * Don't use `CMAKE_INSTALL_LIBDIR` to create `libcmark.pc` (#236). 140 This wasn't getting set in processing `libcmark.pc.in`, and we 141 were getting the wrong entry in `libcmark.pc`. 142 The new approach sets an internal `libdir` variable to 143 `lib${LIB_SUFFIX}`. This variable is used both to set the 144 install destination and in the libcmark.pc.in template. 145 * Update README.md, replace `make astyle` with `make format` 146 (Nguyễn Thái Ngọc Duy). 147 148 [0.28.0] 149 150 * Update spec. 151 * Use unsigned integer when shifting (Phil Turnbull). 152 Avoids a UBSAN warning which can be triggered when handling a 153 long sequence of backticks. 154 * Avoid memcpy'ing NULL pointers (Phil Turnbull). 155 Avoids a UBSAN warning when link title is empty string. 156 The length of the memcpy is zero so the NULL pointer is not 157 dereferenced but it is still undefined behaviour. 158 * DeMorgan simplification of some tests in emphasis parser. 159 This also brings the code into closer alignment with the wording 160 of the spec (see jgm/CommonMark#467). 161 * Fixed undefined shift in commonmark writer (#211). 162 Found by google/oss-fuzz: 163 <https://oss-fuzz.com/v2/testcase-detail/4686992824598528>. 164 * latex writer: fix memory overflow (#210). 165 We got an array overflow in enumerated lists nested more than 166 10 deep with start number =/= 1. 167 This commit also ensures that we don't try to set `enum_` counters 168 that aren't defined by LaTeX (generally up to enumv). 169 Found by google/oss-fuzz: 170 <https://oss-fuzz.com/v2/testcase-detail/5546760854306816>. 171 * Check for NULL pointer in get_link_type (Phil Turnbull). 172 `echo '[](xx:)' | ./build/src/cmark -t latex` gave a 173 segfault. 174 * Move fuzzing dictionary into single file (Phil Turnbull). 175 This allows AFL and libFuzzer to use the same dictionary 176 * Reset bytes after UTF8 proc (Yuki Izumi, #206). 177 * Don't scan past an EOL (Yuki Izumi). 178 The existing negated character classes (`[^…]`) are careful to 179 always include` \x00` in the characters excluded, but these `.` 180 catch-alls can scan right past the terminating NUL placed 181 at the end of the buffer by `_scan_at`. As such, buffer 182 overruns can occur. Also, don't scan past a newline in HTML 183 block end scanners. 184 * Document cases where `get_` functions return `NULL` (#155). 185 E.g. `cmark_node_get_url` on a non-link or image. 186 * Properly handle backslashes in link destinations (#192). 187 Only ascii punctuation characters are escapable, per the spec. 188 * Fixed `cmark_node_get_list_start` to return 0 for bullet lists, 189 as documented (#202). 190 * Use `CMARK_NO_DELIM` for bullet lists (#201). 191 * Fixed code for freeing delimiter stack (#189). 192 * Removed abort outside of conditional (typo). 193 * Removed coercion in error message when aborting from buffer. 194 * Print message to stderr when we abort due to memory demands (#188). 195 * `libcmark.pc`: use `CMAKE_INSTALL_LIBDIR` (#185, Jens Petersen). 196 Needed for multilib distros like Fedora. 197 * Fixed buffer overflow error in `S_parser_feed` (#184). 198 The overflow could occur in the following condition: 199 the buffer ends with `\r` and the next memory address 200 contains `\n`. 201 * Update emphasis parsing for spec change. 202 Strong now goes inside Emph rather than the reverse, 203 when both scopes are possible. The code is much simpler. 204 This also avoids a spec inconsistency that cmark had previously: 205 `***hi***` became Strong (Emph "hi")) but 206 `***hi****` became Emph (Strong "hi")) "*" 207 * Fixes for the LaTeX renderer (#182, Doeme) 208 + Don't double-output the link in latex-rendering. 209 + Prevent ligatures in dashes sensibly when rendering latex. 210 `\-` is a hyphenation, so it doesn't get displayed at all. 211 * Added a test for NULL when freeing `subj->last_delim`. 212 * Cleaned up setting of lower bounds for openers. 213 We now use a much smaller array. 214 * Fix #178, quadratic parsing bug. Add pathological test. 215 * Slight improvement of clarity of logic in emph matching. 216 * Fix "multiple of 3" determination in emph/strong parsing. 217 We need to store the length of the original delimiter run, 218 instead of using the length of the remaining delimiters 219 after some have been subtracted. Test case: 220 `a***b* c*`. Thanks to Raph Levin for reporting. 221 * Correctly initialize chunk in S_process_line (Nick Wellnhofer, #170). 222 The `alloc` member wasn't initialized. This also allows to add an 223 assertion in `chunk_rtrim` which doesn't work for alloced chunks. 224 * Added 'make newbench'. 225 * `scanners.c` generated with re2c 0.16 (68K smaller!). 226 * `scanners.re` - fixed warnings; use `*` for fallback. 227 * Fixed some warnings in `scanners.re`. 228 * Update CaseFolding to latest (Kevin Wojniak, #168). 229 * Allow balanced nested parens in link destinations (Yuki Izumi, #166) 230 * Allocate enough bytes for backticks array. 231 * Inlines: Ensure that the delimiter stack is freed in subject. 232 * Fixed pathological cases with backtick code spans: 233 234 - Removed recursion in scan_to_closing_backticks 235 - Added an array of pointers to potential backtick closers 236 to subject 237 - This array is used to avoid traversing the subject again 238 when we've already seen all the potential backtick closers. 239 - Added a max bound of 1000 for backtick code span delimiters. 240 - This helps with pathological cases like: 241 242 x 243 x ` 244 x `` 245 x ``` 246 x ```` 247 ... 248 249 - Added pathological test case. 250 251 Thanks to Martin Mitáš for identifying the problem and for 252 discussion of solutions. 253 * Remove redundant cmake_minimum_required (#163, @kainjow). 254 * Make shared and static libraries optional (Azamat H. Hackimov). 255 Now you can enable/disable compilation and installation targets for 256 shared and static libraries via `-DCMARK_SHARED=ON/OFF` and 257 `-DCMARK_STATIC=ON/OFF`. 258 * Added support for built-in `${LIB_SUFFIX}` feature (Azamat H. 259 Hackimov). Replaced `${LIB_INSTALL_DIR}` option with built-in 260 `${LIB_SUFFIX}` for installing for 32/64-bit systems. Normally, 261 CMake will set `${LIB_SUFFIX}` automatically for required enviroment. 262 If you have any issues with it, you can override this option with 263 `-DLIB_SUFFIX=64` or `-DLIB_SUFFIX=""` during configuration. 264 * Add Makefile target and harness to fuzz with libFuzzer (Phil Turnbull). 265 This can be run locally with `make libFuzzer` but the harness will be 266 integrated into oss-fuzz for large-scale fuzzing. 267 * Advertise `--validate-utf8` in usage information 268 (Nguyễn Thái Ngọc Duy). 269 * Makefile: use warnings with re2c. 270 * README: Add link to Python wrapper, prettify languages list 271 (Pavlo Kapyshin). 272 * README: Add link to cmark-scala (Tim Nieradzik, #196) 273 274 [0.27.1] 275 276 * Set policy for CMP0063 to avoid a warning (#162). 277 Put set_policy under cmake version test. 278 Otherwise we get errors in older versions of cmake. 279 * Use VERSION_GREATER to clean up cmake version test. 280 * Improve afl target. Use afl-clang by default. Set default for path. 281 282 [0.27.0] 283 284 * Update spec to 0.27. 285 * Fix warnings building with MSVC on Windows (#165, Hugh Bellamy). 286 * Fix `CMAKE_C_VISIBILITY_PRESET` for cmake versions greater than 1.8 287 (e.g. 3.6.2) (#162, Hugh Bellamy). This lets us build swift-cmark 288 on Windows, using clang-cl. 289 * Fix for non-matching entities (#161, Yuki Izumi). 290 * Modified `print_delimiters` (commented out) so it compiles again. 291 * `make format`: don't change order of includes. 292 * Changed logic for null/eol checks (#160). 293 + only check once for "not at end of line" 294 + check for null before we check for newline characters (the 295 previous patch would fail for NULL + CR) 296 * Fix by not advancing past both `\0` and `\n` (Yuki Izumi). 297 * Add test for NUL-LF sequence (Yuki Izumi). 298 * Fix memory leak in list parsing (Yuki Izumi). 299 * Use `cmark_mem` to free where used to alloc (Yuki Izumi). 300 * Allow a shortcut link before a `(` (jgm/CommonMark#427). 301 * Allow tabs after setext header line (jgm/commonmark.js#109). 302 * Don't let URI schemes start with spaces. 303 * Fixed h2..h6 HTML blocks (jgm/CommonMark#430). Added regression test. 304 * Autolink scheme can contain digits (Gábor Csárdi). 305 * Fix nullary function declarations in cmark.h (Nick Wellnhofer). 306 Fixes strict prototypes warnings. 307 * COPYING: Update file name and remove duplicate section and 308 (Peter Eisentraut). 309 * Fix typo (Pavlo Kapyshin). 310 311 [0.26.1] 312 313 * Removed unnecessary typedef that caused build failure on 314 some platforms. 315 * Use `$(MAKE)` in Makefile instead of hardcoded `make` (#146, 316 Tobias Kortkamp). 317 318 [0.26.0] 319 320 * Implement spec changes for list items: 321 - Empty list items cannot interrupt paragraphs. 322 - Ordered lists cannot interrupt paragraphs unless 323 they start with 1. 324 - Removed "two blank lines break out of a list" feature. 325 * Fix sourcepos for blockquotes (#142). 326 * Fix sourcepos for atx headers (#141). 327 * Fix ATX headers and thematic breaks to allow tabs as well as spaces. 328 * Fix `chunk_set_cstr` with suffix of current string (#139, 329 Nick Wellnhofer). It's possible that `cmark_chunk_set_cstr` is called 330 with a substring (suffix) of the current string. Delay freeing of the 331 chunk content to handle this case correctly. 332 * Export targets on installation (Jonathan Müller). 333 This allows using them in other cmake projects. 334 * Fix cmake warning about CMP0048 (Jonathan Müller). 335 * commonmark renderer: Ensure we don't have a blank line 336 before a code block when it's the first thing in a list 337 item. 338 * Change parsing of strong/emph in response to spec changes. 339 `process_emphasis` now gets better results in corner cases. 340 The change is this: when considering matches between an interior 341 delimiter run (one that can open and can close) and another delimiter 342 run, we require that the sum of the lengths of the two delimiter 343 runs mod 3 is not 0. 344 * Ported Robin Stocker's changes to link parsing in jgm/commonmark#101. 345 This uses a separate stack for brackets, instead of putting them on the 346 delimiter stack. This avoids the need for looking through the delimiter 347 stack for the next bracket. 348 * `cmark_reference_lookup`: Return NULL if reference is null string. 349 * Fix character type detection in `commonmark.c` (Nick Wellnhofer). 350 Fixes test failures on Windows and undefined behavior. 351 - Implement `cmark_isalpha`. 352 - Check for ASCII character before implicit cast to char. 353 - Use internal ctype functions in `commonmark.c`. 354 * Better documentation of memory-freeing responsibilities. 355 in `cmark.h` and its man page (#124). 356 * Use library functions to insert nodes in emphasis/link processing. 357 Previously we did this manually, which introduces many 358 places where errors can creep in. 359 * Correctly handle list marker followed only by spaces. 360 Previously when a list marker was followed only by spaces, 361 cmark expected the following content to be indented by 362 the same number of spaces. But in this case we should 363 treat the line just like a blank line and set list padding 364 accordingly. 365 * Fixed a number of issues relating to line wrapping. 366 - Extend `CMARK_OPT_NOBREAKS` to all renderers and add `--nobreaks`. 367 - Do not autowrap, regardless of width parameter, if 368 `CMARK_OPT_NOBREAKS` is set. 369 - Fixed `CMARK_OPT_HARDBREAKS` for LaTeX and man renderers. 370 - Ensure that no auto-wrapping occurs if 371 `CMARK_OPT_NOBREAKS` is enabled, or if output is CommonMark and 372 `CMARK_OPT_HARDBREAKS` is enabled. 373 * Set stdin to binary mode on Windows (Nick Wellnhofer, #113). 374 This fixes EOLs when reading from stdin. 375 * Add library option to render softbreaks as spaces (Pavlo 376 Kapyshin). Note that the `NOBREAKS` option is HTML-only 377 * renderer: `no_linebreaks` instead of `no_wrap`. 378 We generally want this option to prohibit any breaking 379 in things like headers (not just wraps, but softbreaks). 380 * Coerce `realurllen` to `int`. This is an alternate solution for pull 381 request #132, which introduced a new warning on the comparison 382 (Benedict Cohen). 383 * Remove unused variable `link_text` (Mathiew Duponchelle). 384 * Improved safety checks in buffer (Vicent Marti). 385 * Add new interface allowing specification of custom memory allocator 386 for nodes (Vicent Marti). Added `cmark_node_new_with_mem`, 387 `cmark_parser_new_with_mem`, `cmark_mem` to API. 388 * Reduce storage size for nodes by using bit flags instead of 389 separate booleans (Vicent Marti). 390 * config: Add `SSIZE_T` compat for Win32 (Vicent Marti). 391 * cmake: Global handler for OOM situations (Vicent Marti). 392 * Add tests for memory exhaustion (Vicent Marti). 393 * Document in man page and public header that one should use the same 394 memory allocator for every node in a tree. 395 * Fix ctypes in Python FFI calls (Nick Wellnhofer). This didn't cause 396 problems so far because all types are 32-bit on 32-bit systems and 397 arguments are passed in registers on x86-64. The wrong types could cause 398 crashes on other platforms, though. 399 * Remove spurious failures in roundtrip tests. In the commonmark writer we 400 separate lists, and lists and indented code, using a dummy HTML comment. 401 So in evaluating the round-trip tests, we now strip out 402 these comments. We also normalize HTML to avoid issues 403 having to do with line breaks. 404 * Add 2016 to copyright (Kevin Burke). 405 * Added `to_commonmark` in `test/cmark.py` (for round-trip tests). 406 * `spec_test.py` - parameterize `do_test` with converter. 407 * `spec_tests.py`: exit code is now sum of failures and errors. 408 This ensures that a failing exit code will be given when 409 there are errors, not just with failures. 410 * Fixed round trip tests. Previously they actually ran 411 `cmark` instead of the round-trip version, since there was a bug in 412 setting the ROUNDTRIP variable (#131). 413 * Added new `roundtrip_tests.py`. This replaces the old use of simple shell 414 scripts. It is much faster, and more flexible. (We will be able 415 to do custom normalization and skip certain tests.) 416 * Fix tests under MinGW (Nick Wellnhofer). 417 * Fix leak in `api_test` (Mathieu Duponchelle). 418 * Makefile: have leakcheck stop on first error instead of going through 419 all the formats and options and probably getting the same output. 420 * Add regression tests (Nick Wellnhofer). 421 422 [0.25.2] 423 424 * Open files in binary mode (#113, Nick Wellnhofer). Now that cmark 425 supports different line endings, files must be openend in binary mode 426 on Windows. 427 * Reset `partially_consumed_tab` on every new line (#114, Nick Wellnhofer). 428 * Handle buffer split across a CRLF line ending (#117). Adds an internal 429 field to the parser struct to keep track of `last_buffer_ended_with_cr`. 430 Added test. 431 432 [0.25.1] 433 434 * Release with no code changes. cmark version was mistakenly set to 435 0.25.1 in the 0.25.0 release (#112), so this release just 436 ensures that this will cause no confusion later. 437 438 [0.25.0] 439 440 * Fixed tabs in indentation (#101). This patch fixes S_advance_offset 441 so that it doesn't gobble a tab character when advancing less than the 442 width of a tab. 443 * Added partially_consumed_tab to parser. This keeps track of when we 444 have gotten partway through a tab when consuming initial indentation. 445 * Simplified add_line (only need parser parameter). 446 * Properly handle partially consumed tab. E.g. in 447 448 - foo 449 450 <TAB><TAB>bar 451 452 we should consume two spaces from the second tab, including two spaces 453 in the code block. 454 * Properly handle tabs with blockquotes and fenced blocks. 455 * Fixed handling of tabs in lists. 456 * Clarified logic in S_advance_offset. 457 * Use an assertion to check for in-range html_block_type. 458 It's a programming error if the type is out of range. 459 * Refactored S_processLines to make the logic easier to 460 understand, and added documentation (Mathieu Duponchelle). 461 * Removed unnecessary check for empty string_content. 462 * Factored out contains_inlines. 463 * Moved the cmake minimum version to top line of CMakeLists.txt 464 (tinysun212). 465 * Fix ctype(3) usage on NetBSD (Kamil Rytarowski). We need to cast value 466 passed to isspace(3) to unsigned char to explicitly prevent possibly 467 undefined behavior. 468 * Compile in plain C mode with MSVC 12.0 or newer (Nick Wellnhofer). 469 Under MSVC, we used to compile in C++ mode to get some C99 features 470 like mixing declarations and code. With newer MSVC versions, it's 471 possible to build in plain C mode. 472 * Switched from "inline" to "CMARK_INLINE" (Nick Wellnhofer). 473 Newer MSVC versions support enough of C99 to be able to compile cmark 474 in plain C mode. Only the "inline" keyword is still unsupported. 475 We have to use "__inline" instead. 476 * Added include guards to config.h 477 * config.h.in - added compatibility snprintf, vsnprintf for MSVC. 478 * Replaced sprintf with snprintf (Marco Benelli). 479 * config.h: include stdio.h for _vscprintf etc. 480 * Include starg.h when needed in config.h. 481 * Removed an unnecessary C99-ism in buffer.c. This helps compiling on 482 systems like luarocks that don't have all the cmake configuration 483 goodness (thanks to carlmartus). 484 * Don't use variable length arrays (Nick Wellnhofer). 485 They're not supported by MSVC. 486 * Test with multiple MSVC versions under Appveyor (Nick Wellnhofer). 487 * Fix installation dir of man-pages on NetBSD (Kamil Rytarowski). 488 * Fixed typo in cmark.h comments (Chris Eidhof). 489 * Clarify in man page that cmark_node_free frees a node's children too. 490 * Fixed documentation of --width in man page. 491 * Require re2c >= 1.14.2 (#102). 492 * Generated scanners.c with more recent re2c. 493 494 [0.24.1] 495 496 * Commonmark renderer: 497 + Use HTML comment, not two blank lines, to separate a list 498 item from a following code block or list. This makes the 499 output more portable, since the "two blank lines" rule is 500 unique to CommonMark. Also, it allows us to break out of 501 a sublist without breaking out of all levels of nesting. 502 + `is_autolink` - handle case where link has no children, 503 which previously caused a segfault. 504 + Use 4-space indent for bullet lists, for increased portability. 505 + Use 2-space + newline for line break for increased portability (#90). 506 + Improved punctuation escaping. Previously all `)` and 507 `.` characters after digits were escaped; now they are 508 only escaped if they are genuinely in a position where 509 they'd cause a list item. This is achieved by changes in 510 `render.c`: (a) `renderer->begin_content` is only set to 511 false after a string of digits at the beginning of the 512 line, and (b) we never break a line before a digit. 513 Also, `begin_content` is properly initialized to true. 514 * Handle NULL root in `consolidate_text_nodes`. 515 516 [0.24.0] 517 518 * [API change] Added `cmark_node_replace(oldnode, newnode)`. 519 * Updated spec.txt to 0.24. 520 * Fixed edge case with escaped parens in link destination (#97). 521 This was also checked against the #82 case with asan. 522 * Removed unnecessary check for `fenced` in `cmark_render_html`. 523 It's sufficient to check that the info string is empty. 524 Indeed, those who use the API may well create a code block 525 with an info string without explicitly setting `fenced`. 526 * Updated format of `test/smart_punct.txt`. 527 * Updated `test/spec.txt`, `test/smart_punct.txt`, and 528 `spec_tests.py` to new format. 529 * Fixed `get_containing_block` logic in `src/commonmark.c`. 530 This did not allow for the possibility that a node might have no 531 containing block, causing the commonmark renderer to segfault if 532 passed an inline node with no block parent. 533 * Fixed string representations of `CUSTOM_BLOCK`, 534 `CUSTOM_INLINE`. The old versions `raw_inline` and 535 `raw_block` were being used, and this led to incorrect xml output. 536 * Use default opts in python sample wrapper. 537 * Allow multiline setext header content, as per spec. 538 * Don't allow spaces in link destinations, even with pointy brackets. 539 Conforms to latest change in spec. 540 * Updated `scheme` scanner according to spec change. We no longer use 541 a whitelist of valid schemes. 542 * Allow any kind of nodes as children of `CUSTOM_BLOCK` (#96). 543 * `cmark.h`: moved typedefs for iterator into iterator section. 544 This just moves some code around so it makes more sense 545 to read, and in the man page. 546 * Fixed `make_man_page.py` so it includes typedefs again. 547 548 [0.23.0] 549 550 * [API change] Added `CUSTOM_BLOCK` and `CUSTOM_INLINE` node types. 551 They are never generated by the parser, and do not correspond 552 to CommonMark elements. They are designed to be inserted by 553 filters that postprocess the AST. For example, a filter might 554 convert specially marked code blocks to svg diagrams in HTML 555 and tikz diagrams in LaTeX, passing these through to the renderer 556 as a `CUSTOM_BLOCK`. These nodes can have children, but they 557 also have literal text to be printed by the renderer "on enter" 558 and "on exit." Added `cmark_node_get_on_enter`, 559 `cmark_node_set_on_enter`, `cmark_node_get_on_exit`, 560 `cmark_node_set_on_exit` to API. 561 * [API change] Rename `NODE_HTML` -> `NODE_HTML_BLOCK`, 562 `NODE_INLINE_HTML` -> `NODE_HTML_INLINE`. Define aliases 563 so the old names still work, for backwards compatibility. 564 * [API change] Rename `CMARK_NODE_HEADER` -> `CMARK_NODE_HEADING`. 565 Note that for backwards compatibility, we have defined aliases: 566 `CMARK_NODE_HEADER` = `CMARK_NODE_HEADING`, 567 `cmark_node_get_header_level` = `cmark_node_get_heading_level`, and 568 `cmark_node_set_header_level` = `cmark_node_set_heading_level`. 569 * [API change] Rename `CMARK_NODE_HRULE` -> `CMARK_NODE_THEMATIC_BREAK`. 570 Defined the former as the latter for backwards compatibility. 571 * Don't allow space between link text and link label in a reference link 572 (spec change). 573 * Separate parsing and rendering opts in `cmark.h` (#88). 574 This change also changes some of these constants' numerical values, 575 but nothing should change in the API if you use the constants 576 themselves. It should now be clear in the man page which 577 options affect parsing and which affect rendering. 578 * xml renderer - Added xmlns attribute to document node (jgm/CommonMark#87). 579 * Commonmark renderer: ensure html blocks surrounded by blanks. 580 Otherwise we get failures of roundtrip tests. 581 * Commonmark renderer: ensure that literal characters get escaped 582 when they're at the beginning of a block, e.g. `> \- foo`. 583 * LaTeX renderer - better handling of internal links. 584 Now we render `[foo](#bar)` as `\protect\hyperlink{bar}{foo}`. 585 * Check for NULL pointer in _scan_at (#81). 586 * `Makefile.nmake`: be more robust when cmake is missing. Previously, 587 when cmake was missing, the build dir would be created anyway, and 588 subsequent attempts (even with cmake) would fail, because cmake would 589 not be run. Depending on `build/CMakeFiles` is more robust -- this won't 590 be created unless cmake is run. Partially addresses #85. 591 * Fixed DOCTYPE in xml output. 592 * commonmark.c: fix `size_t` to `int`. This fixes an MSVC warning 593 "conversion from 'size_t' to 'int', possible loss of data" (Kevin Wojniak). 594 * Correct string length in `cmark_parse_document` example (Lee Jeffery). 595 * Fix non-ASCII end-of-line character check (andyuhnak). 596 * Fix "declaration shadows a local variable" (Kevin Wojniak). 597 * Install static library (jgm/CommonMark#381). 598 * Fix warnings about dropping const qualifier (Kevin Wojniak). 599 * Use full (unabbreviated) versions of constants (`CMARK_...`). 600 * Removed outdated targets from Makefile. 601 * Removed need for sudo in `make bench`. 602 * Improved benchmark. Use longer test, since `time` has limited resolution. 603 * Removed `bench.h` and timing calls in `main.c`. 604 * Updated API docs; getters return empty strings if not set 605 rather than NULL, as previously documented. 606 * Added api_tests for custom nodes. 607 * Made roundtrip test part of the test suite run by cmake. 608 * Regenerate `scanners.c` using re2c 0.15.3. 609 * Adjusted scanner for link url. This fixes a heap buffer overflow (#82). 610 * Added version number (1.0) to XML namespace. We don't guarantee 611 stability in this until 1.0 is actually released, however. 612 * Removed obsolete `TIMER` macro. 613 * Make `LIB_INSTALL_DIR` configurable (Mathieu Bridon, #79). 614 * Removed out-of-date luajit wrapper. 615 * Use `input`, not `parser->curline` to determine last line length. 616 * Small optimizations in `_scan_at`. 617 * Replaced hard-coded 4 with `TAB_STOP`. 618 * Have `make format` reformat api tests as well. 619 * Added api tests for man, latex, commonmark, and xml renderers (#51). 620 * render.c: added `begin_content` field. This is like `begin_line` except 621 that it doesn't trigger production of the prefix. So it can be set 622 after an initial prefix (say `> `) is printed by the renderer, and 623 consulted in determining whether to escape content that has a special 624 meaning at the beginning of a line. Used in the commonmark renderer. 625 * Python 3.5 compatibility: don't require HTMLParseError (Zhiming Wang). 626 HTMLParseError was removed in Python 3.5. Since it could never be thrown 627 in Python 3.5+, we simply define a placeholder when HTMLParseError 628 cannot be imported. 629 * Set `convert_charrefs=False` in `normalize.py` (#83). This defeats the 630 new default as of python 3.5, and allows the script to work with python 631 3.5. 632 633 [0.22.0] 634 635 * Removed `pre` from blocktags scanner. `pre` is handled separately 636 in rule 1 and needn't be handled in rule 6. 637 * Added `iframe` to list of blocktags, as per spec change. 638 * Fixed bug with `HRULE` after blank line. This previously caused cmark 639 to break out of a list, thinking it had two consecutive blanks. 640 * Check for empty string before trying to look at line ending. 641 * Make sure every line fed to `S_process_line` ends with `\n` (#72). 642 So `S_process_line` sees only unix style line endings. Ultimately we 643 probably want a better solution, allowing the line ending style of 644 the input file to be preserved. This solution forces output with newlines. 645 * Improved `cmark_strbuf_normalize_whitespace` (#73). Now all characters 646 that satisfy `cmark_isspace` are recognized as whitespace. Previously 647 `\r` and `\t` (and others) weren't included. 648 * Treat line ending with EOF as ending with newline (#71). 649 * Fixed `--hardbreaks` with `\r\n` line breaks (#68). 650 * Disallow list item starting with multiple blank lines (jgm/CommonMark#332). 651 * Allow tabs before closing `#`s in ATX header 652 * Removed `cmark_strbuf_printf` and `cmark_strbuf_vprintf`. 653 These are no longer needed, and cause complications for MSVC. 654 Also removed `HAVE_VA_COPY` and `HAVE_C99_SNPRINTF` feature tests. 655 * Added option to disable tests (Kevin Wojniak). 656 * Added `CMARK_INLINE` macro. 657 * Removed need to disable MSVC warnings 4267, 4244, 4800 658 (Kevin Wojniak). 659 * Fixed MSVC inline errors when cmark is included in sources that 660 don't have the same set of disabled warnings (Kevin Wojniak). 661 * Fix `FileNotFoundError` errors on tests when cmark is built from 662 another project via `add_subdirectory()` (Kevin Wojniak). 663 * Prefix `utf8proc` functions to avoid conflict with existing library 664 (Kevin Wojniak). 665 * Avoid name clash between Windows `.pdb` files (Nick Wellnhofer). 666 * Improved `smart_punct.txt` (see jgm/commonmark.js#61). 667 * Set `POSITION_INDEPENDENT_CODE` `ON` for static library (see #39). 668 * `make bench`: allow overriding `BENCHFILE`. Previously if you did 669 this, it would clopper `BENCHFILE` with the default bench file. 670 * `make bench`: Use -10 priority with renice. 671 * Improved `make_autolink`. Ensures that title is chunk with empty 672 string rather than NULL, as with other links. 673 * Added `clang-check` target. 674 * Travis: split `roundtrip_test` and `leakcheck` (OGINO Masanori). 675 * Use clang-format, llvm style, for formatting. Reformatted all source files. 676 Added `format` target to Makefile. Removed `astyle` target. 677 Updated `.editorconfig`. 678 679 [0.21.0] 680 681 * Updated to version 0.21 of spec. 682 * Added latex renderer (#31). New exported function in API: 683 `cmark_render_latex`. New source file: `src/latex.hs`. 684 * Updates for new HTML block spec. Removed old `html_block_tag` scanner. 685 Added new `html_block_start` and `html_block_start_7`, as well 686 as `html_block_end_n` for n = 1-5. Rewrote block parser for new HTML 687 block spec. 688 * We no longer preprocess tabs to spaces before parsing. 689 Instead, we keep track of both the byte offset and 690 the (virtual) column as we parse block starts. 691 This allows us to handle tabs without converting 692 to spaces first. Tabs are left as tabs in the output, as 693 per the revised spec. 694 * Removed utf8 validation by default. We now replace null characters 695 in the line splitting code. 696 * Added `CMARK_OPT_VALIDATE_UTF8` option and command-line option 697 `--validate-utf8`. This option causes cmark to check for valid 698 UTF-8, replacing invalid sequences with the replacement 699 character, U+FFFD. Previously this was done by default in 700 connection with tab expansion, but we no longer do it by 701 default with the new tab treatment. (Many applications will 702 know that the input is valid UTF-8, so validation will not 703 be necessary.) 704 * Added `CMARK_OPT_SAFE` option and `--safe` command-line flag. 705 + Added `CMARK_OPT_SAFE`. This option disables rendering of raw HTML 706 and potentially dangerous links. 707 + Added `--safe` option in command-line program. 708 + Updated `cmark.3` man page. 709 + Added `scan_dangerous_url` to scanners. 710 + In HTML, suppress rendering of raw HTML and potentially dangerous 711 links if `CMARK_OPT_SAFE`. Dangerous URLs are those that begin 712 with `javascript:`, `vbscript:`, `file:`, or `data:` (except for 713 `image/png`, `image/gif`, `image/jpeg`, or `image/webp` mime types). 714 + Added `api_test` for `OPT_CMARK_SAFE`. 715 + Rewrote `README.md` on security. 716 * Limit ordered list start to 9 digits, per spec. 717 * Added width parameter to `render_man` (API change). 718 * Extracted common renderer code from latex, man, and commonmark 719 renderers into a separate module, `renderer.[ch]` (#63). To write a 720 renderer now, you only need to write a character escaping function 721 and a node rendering function. You pass these to `cmark_render` 722 and it handles all the plumbing (including line wrapping) for you. 723 So far this is an internal module, but we might consider adding 724 it to the API in the future. 725 * commonmark writer: correctly handle email autolinks. 726 * commonmark writer: escape `!`. 727 * Fixed soft breaks in commonmark renderer. 728 * Fixed scanner for link url. re2c returns the longest match, so we 729 were getting bad results with `[link](foo\(and\(bar\)\))` 730 which it would parse as containing a bare `\` followed by 731 an in-parens chunk ending with the final paren. 732 * Allow non-initial hyphens in html tag names. This allows for 733 custom tags, see jgm/CommonMark#239. 734 * Updated `test/smart_punct.txt`. 735 * Implemented new treatment of hyphens with `--smart`, converting 736 sequences of hyphens to sequences of em and en dashes that contain no 737 hyphens. 738 * HTML renderer: properly split info on first space char (see 739 jgm/commonmark.js#54). 740 * Changed version variables to functions (#60, Andrius Bentkus). 741 This is easier to access using ffi, since some languages, like C# 742 like to use only function interfaces for accessing library 743 functionality. 744 * `process_emphasis`: Fixed setting lower bound to potential openers. 745 Renamed `potential_openers` -> `openers_bottom`. 746 Renamed `start_delim` -> `stack_bottom`. 747 * Added case for #59 to `pathological_test.py`. 748 * Fixed emphasis/link parsing bug (#59). 749 * Fixed off-by-one error in line splitting routine. 750 This caused certain NULLs not to be replaced. 751 * Don't rtrim in `subject_from_buffer`. This gives bad results in 752 parsing reference links, where we might have trailing blanks 753 (`finalize` removes the bytes parsed as a reference definition; 754 before this change, some blank bytes might remain on the line). 755 + Added `column` and `first_nonspace_column` fields to `parser`. 756 + Added utility function to advance the offset, computing 757 the virtual column too. Note that we don't need to deal with 758 UTF-8 here at all. Only ASCII occurs in block starts. 759 + Significant performance improvement due to the fact that 760 we're not doing UTF-8 validation. 761 * Fixed entity lookup table. The old one had many errors. 762 The new one is derived from the list in the npm entities package. 763 Since the sequences can now be longer (multi-code-point), we 764 have bumped the length limit from 4 to 8, which also affects 765 `houdini_html_u.c`. An example of the kind of error that was fixed: 766 `≧̸` should be rendered as "≧̸" (U+02267 U+00338), but it was 767 being rendered as "≧" (which is the same as `≧`). 768 * Replace gperf-based entity lookup with binary tree lookup. 769 The primary advantage is a big reduction in the size of 770 the compiled library and executable (> 100K). 771 There should be no measurable performance difference in 772 normal documents. I detected only a slight performance 773 hit in a file containing 1,000,000 entities. 774 + Removed `src/html_unescape.gperf` and `src/html_unescape.h`. 775 + Added `src/entities.h` (generated by `tools/make_entities_h.py`). 776 + Added binary tree lookup functions to `houdini_html_u.c`, and 777 use the data in `src/entities.h`. 778 * Renamed `entities.h` -> `entities.inc`, and 779 `tools/make_entities_h.py` -> `tools/make_entitis_inc.py`. 780 * Fixed cases like 781 ``` 782 [ref]: url 783 "title" ok 784 ``` 785 Here we should parse the first line as a reference. 786 * `inlines.c`: Added utility functions to skip spaces and line endings. 787 * Fixed backslashes in link destinations that are not part of escapes 788 (jgm/commonmark#45). 789 * `process_line`: Removed "add newline if line doesn't have one." 790 This isn't actually needed. 791 * Small logic fixes and a simplification in `process_emphasis`. 792 * Added more pathological tests: 793 + Many link closers with no openers. 794 + Many link openers with no closers. 795 + Many emph openers with no closers. 796 + Many closers with no openers. 797 + `"*a_ " * 20000`. 798 * Fixed `process_emphasis` to handle new pathological cases. 799 Now we have an array of pointers (`potential_openers`), 800 keyed to the delim char. When we've failed to match a potential opener 801 prior to point X in the delimiter stack, we reset `potential_openers` 802 for that opener type to X, and thus avoid having to look again through 803 all the openers we've already rejected. 804 * `process_inlines`: remove closers from delim stack when possible. 805 When they have no matching openers and cannot be openers themselves, 806 we can safely remove them. This helps with a performance case: 807 `"a_ " * 20000` (jgm/commonmark.js#43). 808 * Roll utf8proc_charlen into utf8proc_valid (Nick Wellnhofer). 809 Speeds up "make bench" by another percent. 810 * `spec_tests.py`: allow `→` for tab in HTML examples. 811 * `normalize.py`: don't collapse whitespace in pre contexts. 812 * Use utf-8 aware re2c. 813 * Makefile afl target: removed `-m none`, added `CMARK_OPTS`. 814 * README: added `make afl` instructions. 815 * Limit generated generated `cmark.3` to 72 character line width. 816 * Travis: switched to containerized build system. 817 * Removed `debug.h`. (It uses GNU extensions, and we don't need it anyway.) 818 * Removed sundown from benchmarks, because the reading was anomalous. 819 sundown had an arbitrary 16MB limit on buffers, and the benchmark 820 input exceeded that. So who knows what we were actually testing? 821 Added hoedown, sundown's successor, which is a better comparison. 822 823 [0.20.0] 824 825 * Fixed bug in list item parsing when items indented >= 4 spaces (#52). 826 * Don't allow link labels with no non-whitespace characters 827 (jgm/CommonMark#322). 828 * Fixed multiple issues with numeric entities (#33, Nick Wellnhofer). 829 * Support CR and CRLF line endings (Ben Trask). 830 * Added test for different line endings to `api_test`. 831 * Allow NULL value in string setters (Nick Wellnhofer). (NULL 832 produces a 0-length string value.) Internally, URL and 833 title are now stored as `cmark_chunk` rather than `char *`. 834 * Fixed memory leak in `cmark_consolidate_text_nodes` (#32). 835 * Fixed `is_autolink` in the CommonMark renderer (#50). Previously *any* 836 link with an absolute URL was treated as an autolink. 837 * Cope with broken `snprintf` on Windows (Nick Wellnhofer). On Windows, 838 `snprintf` returns -1 if the output was truncated. Fall back to 839 Windows-specific `_scprintf`. 840 * Switched length parameter on `cmark_markdown_to_html`, 841 `cmark_parser_feed`, and `cmark_parse_document` from `int` 842 to `size_t` (#53, Nick Wellnhofer). 843 * Use a custom type `bufsize_t` for all string sizes and indices. 844 This allows to switch to 64-bit string buffers by changing a single 845 typedef and a macro definition (Nick Wellnhofer). 846 * Hardened the `strbuf` code, checking for integer overflows and 847 adding range checks (Nick Wellnhofer). 848 * Removed unused function `cmark_strbuf_attach` (Nick Wellnhofer). 849 * Fixed all implicit 64-bit to 32-bit conversions that 850 `-Wshorten-64-to-32` warns about (Nick Wellnhofer). 851 * Added helper function `cmark_strbuf_safe_strlen` that converts 852 from `size_t` to `bufsize_t` and throws an error in case of 853 an overflow (Nick Wellnhofer). 854 * Abort on `strbuf` out of memory errors (Nick Wellnhofer). 855 Previously such errors were not being trapped. This involves 856 some internal changes to the `buffer` library that do not affect 857 the API. 858 * Factored out `S_find_first_nonspace` in `S_proces_line`. 859 Added fields `offset`, `first_nonspace`, `indent`, and `blank` 860 to `cmark_parser` struct. This just removes some repetition. 861 * Added Racket Racket (5.3+) wrapper (Eli Barzilay). 862 * Removed `-pg` from Debug build flags (#47). 863 * Added Ubsan build target, to check for undefined behavior. 864 * Improved `make leakcheck`. We now return an error status if anything 865 in the loop fails. We now check `--smart` and `--normalize` options. 866 * Removed `wrapper3.py`, made `wrapper.py` work with python 2 and 3. 867 Also improved the wrapper to work with Windows, and to use smart 868 punctuation (as an example). 869 * In `wrapper.rb`, added argument for options. 870 * Revised luajit wrapper. 871 * Added build status badges to README.md. 872 * Added links to go, perl, ruby, R, and Haskell bindings to README.md. 873 874 [0.19.0] 875 876 * Fixed `_` emphasis parsing to conform to spec (jgm/CommonMark#317). 877 * Updated `spec.txt`. 878 * Compile static library with `-DCMARK_STATIC_DEFINE` (Nick Wellnhofer). 879 * Suppress warnings about Windows runtime library files (Nick Wellnhofer). 880 Visual Studio Express editions do not include the redistributable files. 881 Set `CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS` to suppress warnings. 882 * Added appyeyor: Windows continuous integration (`appveyor.yml`). 883 * Use `os.path.join` in `test/cmark.py` for proper cross-platform paths. 884 * Fixed `Makefile.nmake`. 885 * Improved `make afl`: added `test/afl_dictionary`, increased timeout 886 for hangs. 887 * Improved README with a description of the library's strengths. 888 * Pass-through Unicode non-characters (Nick Wellnhofer). 889 Despite their name, Unicode non-characters are valid code points. They 890 should be passed through by a library like libcmark. 891 * Check return status of `utf8proc_iterate` (#27). 892 893 [0.18.3] 894 895 * Include patch level in soname (Nick Wellnhofer). Minor version is 896 tied to spec version, so this allows breaking the ABI between spec 897 releases. 898 * Install compiler-provided system runtime libraries (Changjiang Yang). 899 * Use `strbuf_printf` instead of `snprintf`. `snprintf` is not 900 available on some platforms (Visual Studio 2013 and earlier). 901 * Fixed memory access bug: "invalid read of size 1" on input `[link](<>)`. 902 903 [0.18.2] 904 905 * Added commonmark renderer: `cmark_render_commonmark`. In addition 906 to options, this takes a `width` parameter. A value of 0 disables 907 wrapping; a positive value wraps the document to the specified 908 width. Note that width is automatically set to 0 if the 909 `CMARK_OPT_HARDBREAKS` option is set. 910 * The `cmark` executable now allows `-t commonmark` for output as 911 CommonMark. A `--width` option has been added to specify wrapping 912 width. 913 * Added `roundtrip_test` Makefile target. This runs all the spec 914 through the commonmark renderer, and then through the commonmark 915 parser, and compares normalized HTML to the test. All tests pass 916 with the current parser and renderer, giving us some confidence that 917 the commonmark renderer is sufficiently robust. Eventually this 918 should be pythonized and put in the cmake test routine. 919 * Removed an unnecessary check in `blocks.c`. By the time we check 920 for a list start, we've already checked for a horizontal rule, so 921 we don't need to repeat that check here. Thanks to Robin Stocker for 922 pointing out a similar redundancy in commonmark.js. 923 * Fixed bug in `cmark_strbuf_unescape` (`buffer.c`). The old function 924 gave incorrect results on input like `\\*`, since the next backslash 925 would be treated as escaping the `*` instead of being escaped itself. 926 * `scanners.re`: added `_scan_scheme`, `scan_scheme`, used in the 927 commonmark renderer. 928 * Check for `CMAKE_C_COMPILER` (not `CC_COMPILER`) when setting C flags. 929 * Update code examples in documentation, adding new parser option 930 argument, and using `CMARK_OPT_DEFAULT` (Nick Wellnhofer). 931 * Added options parameter to `cmark_markdown_to_html`. 932 * Removed obsolete reference to `CMARK_NODE_LINK_LABEL`. 933 * `make leakcheck` now checks all output formats. 934 * `test/cmark.py`: set default options for `markdown_to_html`. 935 * Warn about buggy re2c versions (Nick Wellnhofer). 936 937 [0.18.1] 938 939 * Build static version of library in default build (#11). 940 * `cmark.h`: Add missing argument to `cmark_parser_new` (#12). 941 942 [0.18] 943 944 * Switch to 2-clause BSD license, with agreement of contributors. 945 * Added Profile build type, `make prof` target. 946 * Fixed autolink scanner to conform to the spec. Backslash escapes 947 not allowed in autolinks. 948 * Don't rely on strnlen being available (Nick Wellnhofer). 949 * Updated scanners for new whitespace definition. 950 * Added `CMARK_OPT_SMART` and `--smart` option, `smart.c`, `smart.h`. 951 * Added test for `--smart` option. 952 * Fixed segfault with --normalize (closes #7). 953 * Moved normalization step from XML renderer to `cmark_parser_finish`. 954 * Added options parameter to `cmark_parse_document`, `cmark_parse_file`. 955 * Fixed man renderer's escaping for unicode characters. 956 * Don't require python3 to make `cmark.3` man page. 957 * Use ASCII escapes for punctuation characters for portability. 958 * Made `options` an int rather than a long, for consistency. 959 * Packed `cmark_node` struct to fit into 128 bytes. 960 This gives a small performance boost and lowers memory usage. 961 * Repacked `delimiter` struct to avoid hole. 962 * Fixed use-after-free bug, which arose when a paragraph containing 963 only reference links and blank space was finalized (#9). 964 Avoid using `parser->current` in the loop that creates new 965 blocks, since `finalize` in `add_child` may have removed 966 the current parser (if it contains only reference definitions). 967 This isn't a great solution; in the long run we need to rewrite 968 to make the logic clearer and to make it harder to make 969 mistakes like this one. 970 * Added 'Asan' build type. `make asan` will link against ASan; the 971 resulting executable will do checks for memory access issues. 972 Thanks @JordanMilne for the suggestion. 973 * Add Makefile target to fuzz with AFL (Nick Wellnhofer) 974 The variable `$AFL_PATH` must point to the directory containing the AFL 975 binaries. It can be set as an environment variable or passed to make on 976 the command line. 977 978 [0.17] 979 980 * Stripped out all JavaScript related code and documentation, moving 981 it to a separate repository (<https://github.com/jgm/commonmark.js>). 982 * Improved Makefile targets, so that `cmake` is run again only when 983 necessary (Nick Wellnhofer). 984 * Added `INSTALL_PREFIX` to the Makefile, allowing installation to a 985 location other than `/usr/local` without invoking `cmake` 986 manually (Nick Wellnhofer). 987 * `make test` now guarantees that the project will 988 be rebuilt before tests are run (Nick Wellnhofer). 989 * Prohibited overriding of some Makefile variables (Nick Wellnhofer). 990 * Provide version number and string, both as macros 991 (`CMARK_VERSION`, `CMARK_VERSION_STRING`) and as symbols 992 (`cmark_version`, `cmark_version_string`) (Nick Wellnhofer). All of 993 these come from `cmark_version.h`, which is constructed from a 994 template `cmark_version.h.in` and data in `CMakeLists.txt`. 995 * Avoid calling `free` on null pointer. 996 * Added an accessor for an iterator's root node (`cmark_iter_get_root`). 997 * Added user data field for nodes (Nick Wellnhofer). This is 998 intended mainly for use in bindings for dynamic languages, where 999 it could store a pointer to a target language object (#287). But 1000 it can be used for anything. 1001 * Man renderer: properly escape multiline strings. 1002 * Added assertion to raise error if finalize is called on a closed block. 1003 * Implemented the new spec rule for emphasis and strong emphasis with `_`. 1004 * Moved the check for fence-close with the other checks for end-of-block. 1005 * Fixed a bug with loose list detection with items containings 1006 fenced code blocks (#285). 1007 * Removed recursive algorithm in `ends_with_blank_line` (#286). 1008 * Minor code reformatting: renamed parameters. 1009 1010 [0.16] 1011 1012 * Added xml renderer (XML representation of the CommonMark AST, 1013 which is described in `CommonMark.dtd`). 1014 * Reduced size of gperf entity table (Nick Wellnhofer). 1015 * Reworked iterators to allow deletion of nodes during iteration 1016 (Nick Wellnhofer). 1017 * Optimized `S_is_leaf`. 1018 * Added `cmark_iter_reset` to iterator API. 1019 * Added `cmark_consolidate_text_nodes` to API to combine adjacent 1020 text nodes. 1021 * Added `CMARK_OPT_NORMALIZE` to options (this combines adjacent 1022 text nodes). 1023 * Added `--normalize` option to command-line program. 1024 * Improved regex for HTML comments in inline parsing. 1025 * Python is no longer required for a basic build from the 1026 repository.