Log

Author Commit Date CI Message
Martin Mitas 4933a893 2024-01-25T20:28:54 md2html: Add <meta charset="UTF-8"> with output with --full-html. Fixes #231.
Martin Mitas f46000c7 2024-01-24T09:49:59 Use UTF-8 in copyright notes.
Martin Mitas 533b8331 2024-01-24T09:48:53 md2html/cmdline.[ch]: Update from upstream.
Martin Mitas 2cb4f23f 2024-01-22T09:14:58 md_collect_marks: Improve pre-test for '.'.
Martin Mitas 23e7929b 2024-01-22T09:10:25 md_analyze_permissive_autolink: Check left boundary asap.
Martin Mitas 610bfdb5 2024-01-21T16:19:31 Migrate from codecov bash uploader to github action.
Martin Mitas 798b0bf2 2024-01-21T16:30:02 codecov.yml: Remove the file. We used it to exclude code coverage stats for md2html, but there's no reason to do so anymore.
Martin Mitas 12df389a 2024-01-21T16:28:48 ci-build.yml: Explicitly name the checkout step.
Martin Mitas fcd3ca13 2024-01-21T15:20:49 Fix source indentation.
Martin Mitas a3c510ac 2024-01-21T14:11:47 Improve coverage testing of UTF-8 routines.
Martin Mitas cd7c326f 2024-01-21T13:20:38 Add code coverage test for MD_FLAG_COLLAPSEWHITESPACE.
Martin Mitas 83e093fb 2024-01-21T11:50:18 md_opener_stack: Mark the default branch of switch as unreachable. We were returning NULL previously, but that would lead to a crash anyway; all callsites expect to get their respective stack anyway and anything else would mean we are internally broken.
Martin Mitas 0672f27c 2024-01-21T11:45:02 md_process_table_row: Remove not needed freeing of ptr_stack. This is already handled universally in md_process_normal_block_contents() which is called from md_process_table_row() via md_process_table_cell().
Martin Mitas faf39849 2024-01-21T11:42:30 md_is_html_cdata: Remove not needed max_end shrinking. md_scan_for_html_closer() handles that internally.
Martin Mitas dec252d4 2024-01-21T10:39:06 Bump version 0.5.1 and update CHANGELOG.md.
Martin Mitas 65957f53 2024-01-19T10:37:33 Limit number of table columns to prevent explosion of output... with the input pattern in the form of geneated by this one-liner: $ python3 -c 'N=1000; print("x|" * N + "\n" + "-|" * N + "\n" + "x\n" * N)' Here the amount of HTML otput grows with N^2.
Martin Mitas 70b247cf 2024-01-19T13:59:45 md_analyze_permissive_autolink: Accept path ending with '/'. Fixes #226.
Martin Mitas bbb43fe0 2024-01-18T17:30:44 Rename PUSH_MARK() to ADD_MARK(). This is to pevent confusion with opener stack operations.
Martin Mitáš 246e105d 2024-01-18T17:22:54 Refactor mark chains. (#224) * Rename MD_MARKCHAIN to MD_MARKSTACK to indicate its semantics much clearer. * Simplify its implementation (single-linked list instead of double-linked one). * Where it was reused (misused?) for other, unrelated stuff, with other semantics, it's now done explicitly. (i.e. got rid of TABLECELLBOUNDARIES). * PTR_CHAIN still uses the stack (we don't care about order there), but it got separated from the array of ordinary opener stacks at least.
Martin Mitas 601ff053 2024-01-18T16:28:16 Fix handling new line at beginning/end of a code span. Fixes #223.
Martin Mitas c076698a 2024-01-18T16:10:46 md_collect_marks: Get rid of helper vars line_beg, line_end.
Martin Mitas 23b14168 2024-01-18T15:11:22 pathological-tests.py: Fix output if a test unit ends with non-zero exit code.
Martin Mitas 08728831 2024-01-18T13:39:48 md_rollback: Update outdated comment.
Martin Mitas d40458b5 2024-01-18T12:39:36 md_rollback: Simplify the function. We assume the provided opener_index and closer_index do not cross boundaries of already resolved ranges. Previously the function tried deal with such situation but this code should not be needed, it was very complex and, most importantly, broken anyway.
Martin Mitas a08f6a05 2024-01-18T12:29:31 Improve/fix latex math extension. To mitigate false positives: * We accept $ and $$ as a potential opener only if it's not preceded with alnum char. * Similarly closer cannot be followed with alnum char. * We now also match closer with last preceding pontential opener, not the first one. (And to avoid nesting, any previous openers are ignored.) * Also revert an unintended change in 3fc207affaba313cc1f4ef3b4e9e57df89b0e028 which allowed keeping nested resolved marks in it.
Martin Mitas 3fc207af 2024-01-18T10:56:12 Handle e-mail autolinks in a safer way. For standard e-mail autolinks <user@host> we internally transformed '<' into '@' (permissive e-mail autolink) to unify handling of missing "mailto:" needed into the destination attribute. This is now not true anymore and we handle that specially. It is actually what has bitten us in https://oss-fuzz.com/testcase-detail/4815193402048512. Even though this isn't the root cause of the issue, this change makes the code safer and easier to understand.
Martin Mitas 4728cd98 2024-01-17T16:04:14 md_analyze_tilde: Pop from chain tail like other emphasis. The function incorrectly used header from the head, leading to wrong result (incompatible with e.. GFM) but even worse to bad internal state md_rollback() is then potentially unable to solve. Fixes #222.
Martin Mitas 006611b9 2024-01-17T15:03:00 md_analyze_dollar: Call md_rollback() only when resolving. Fixes #221.
Martin Mitas 2ba5e2c6 2024-01-17T14:48:57 Make --replay-fuzz friendlier to work with in debugger. We make effectively input zero-terminated so debugger doesn't attempt to write more than what's really provided.
Martin Mitas f45dd442 2024-01-17T02:58:12 Add regression test for #213. As it's now possible to add tests with multiple cmdline options easily.
Martin Mitáš d955c495 2024-01-17T02:48:57 Rework permissive autolinks. (#220) * We have now dedicated run over the inline marks for them. * We check more throughly whether it really looks as an URL or e-mail address. The old implementation recognized even heavily broken ones. * This allows us to be much more careful in order not to cross already resolved marks. * Share substantial parts of the code between all three types of the permissive autolinks (URL, WWW, e-mail). * Merge their tests into one file, spec-permissive-autolinks.txt. * Add one pathological case which triggered quadratic behavior in the old implementation.
Martin Mitas a715b884 2024-01-16T15:29:35 Rename many files in test dir for better organization.
Martin Mitas 4b9e4d7c 2024-01-16T15:32:21 Move one more forgotten regression test to regressions.txt.
Martin Mitas 20cb7445 2024-01-16T15:10:57 Merge branch 'test_opts'
Martin Mitas 6685df9c 2024-01-16T15:09:33 Move all regression tests into new tests/regressions.txt. (And update scripts/run-tests.sh accordingly.)
Martin Mitas 74e5f7a9 2024-01-16T14:56:09 Tests: Specify md2html command line options for each example as needed. Previously the caller (or the script scripts/run_tests.sh) needed to know what options to specify.
Martin Mitas 359406bf 2024-01-16T14:25:46 Test: Add support for per-example command line options. (We also removed direct call support into the library. It was inherited from cmark as the testsuite was originally taken from there, but it actually was never updated to work with MD4C.)
Martin Mitas 0ac9f35d 2024-01-16T09:53:41 md_analyze_marks: Skip analyzing marks if... they fall into range of previously analyzed mark. That can happen if the previous mark has been expanded. That typically happens for permissive auto-links. This fixes one case of pathologic input leading to quadratic behavior.
Martin Mitas b6777d78 2024-01-16T01:30:59 Wiki-links extension: Search for '|' only outside resolved ranges.
Martin Mitas afeece29 2024-01-15T23:03:21 Fix line indentation calculation when interrupting list... due the "list item cannot begin with two blank lines" rule.
Martin Mitas 481230f4 2024-01-15T08:34:21 Bump version to 0.5.0.
Martin Mitas 4b5dd10e 2024-01-13T15:04:31 README.md: Add imgui_md to Software using MD4C. (And sort the items alphabetically.)
Martin Mitas 716da8b0 2024-01-13T11:44:27 CHANGELOG.md: Fix typo.
Martin Mitas cf1226dd 2024-01-13T03:14:13 Update CHANGELOG.md.
Martin Mitas 78829427 2024-01-13T02:59:35 Fix some emphasis parsing issues. * We incorrectly applied the infamous rule of three only to asterisk-encoded emphasis, it has to be applied to underscore as well. * We incorrectly applied the rule of three only if the opener and/or closer was inside a word. It has also to be applied if the mark is both preceded and followed by punctuation. Fixes #217.
Martin Mitas 5592352f 2024-01-13T00:30:08 HTML declaration doesn't require whitespace before the closer. Fixes #216.
Martin Mitas 7497ea92 2024-01-13T00:17:08 Allow tabs after setext header underline. Fixes #215.
Martin Mitas 2750d9fa 2024-01-13T00:02:12 Add tags <h2>...<h6> as triggers for HTML block type 6. Fixes #214.
Martin Mitas 0d10b60b 2024-01-12T22:44:31 Move test/fuzz-input/ to test/fuzzers/seed-corpus/.
Martin Mitas 4a64fee2 2024-01-11T13:12:55 Bump copyright years.
Martin Mitas 5204c30d 2024-01-11T12:41:40 md_is_html_block_end_condition: Fix return value.
Martin Mitas f32a861e 2024-01-11T12:20:23 md_end_current_block: Fix EOL handling.
Martin Mitas 76abc636 2024-01-11T12:09:22 md_is_html_block_end_condition: Fix EOF handling.
Martin Mitas 4a7246de 2024-01-11T11:55:38 md_is_inline_link_spec: Fix EOL checking.
Martin Mitas af96a3f4 2024-01-11T10:57:02 ci-fuzz.yml: Reenable "Upload Sarif" step. See https://github.com/google/oss-fuzz/issues/10915.
Martin Mitas 3e576b49 2024-01-11T10:49:05 Rename the fuzz test workflow.
Martin Mitas 407b107e 2024-01-11T10:42:27 ci-fuzz.yml: .yml cannot have multiple "if" in one step.
Martin Mitas 59330842 2024-01-11T10:39:52 ci-fuzz.yml: Disable step "Upload Sarif". (It got in from the oss-fuzz's example cifuzz.yml, but IDK even what it is so hopefully we can live without it.)
Martin Mitas 85b971a3 2024-01-11T10:01:00 Try to fix ci-fuzz.yml by fixing indentation.
Martin Mitas 722cacad 2024-01-11T09:56:07 Try to fix ci-fuzz.yml by removing permissions {}. cmark doesn't have that line either.
Martin Mitas 87d4f063 2024-01-11T09:50:58 Enable CI fuzzing via oss-fuzz project. Should perform some initial 10 min fuzz testing on pull requests.
Martin Mitas e25ea3d1 2024-01-11T03:34:24 Update list of named entities.
Martin Mitas 35ca9b0b 2024-01-11T01:09:35 Wording improvements in README.md.
Martin Mitas 3209f970 2024-01-11T01:06:59 Update CHANGELOG.md.
Martin Mitas c6535ff3 2024-01-10T21:39:24 Fix eof handling in a middle of task list item.
Martin Mitas ebbb12e5 2024-01-10T20:29:02 Revert most of PR #168 i.e of the commit f436c3029850c138e54a0de055d61db45130409e. It added bunch of checks all over the place, but most of them shouldn't be needed: If they are true, our internal state is already broken. In other words, those checks are hiding real bugs and making debugging harder. Hopefully the underlying bugs are already fixed in some of previous commits addressing some fuzzing issues, like these: * d775b5103ee130edbd808e21d1da6ca75f76a558 * c6942ef03ed46a67bd9b3af8ce1eefd781622777
Martin Mitas d775b510 2024-01-10T18:33:32 More fixes of TABLECELLBOUNDARIES chain handling. Fixes #213.
Martin Mitas 821477b1 2024-01-10T17:35:46 Fix typo in fuzz-mdhtml.c, preventing oss-fuzz from working.
Martin Mitas c6942ef0 2024-01-10T17:31:55 Treat TABLECELLBOUNDARIES chain as special one. It's not an ordinary openers chain as (most of) the others, and md_rollback() must not touch it. Fixes #212.
Martin Mitas 338e0bb2 2024-01-10T17:30:51 md2html: Add undoc'ed debug option --replay-fuzz. This helps to reproduce issues found by oss-fuzz project.
Martin Mitas ca169a92 2024-01-10T12:22:04 Fix HTML renderer to handle neted images correctly. Fixes #210.
Andreas Baumann 47a2ad3d 2024-01-09T11:34:40 added options --html-title and --html-css (#188)
Jens Alfke efcfd7e7 2024-01-09T02:32:17 Added MD_SPAN_A_DETAIL.is_autolink (#181) This allows the processor to tell whether an <A> tag is the result of an autolink, and customize its output. For example, I want to emit an autolink of an image URL as an <IMG> tag, and an autolink of a YouTube URL as a video embed.
Dylan Deng ecce1715 2024-01-09T18:30:01 add build option for md2html executable (#184) Fixes build error for iOS, you can set BUILD_MD2HTML_EXECUTABLE as OFF Signed-off-by: Dylan <2894220@gmail.com> Co-authored-by: Martin Mitáš <mity@morous.org>
Martin Mitas 61949ee9 2024-01-09T02:08:48 Update to Unicode 15.1.
Martin Mitas 38303af3 2024-01-09T00:01:35 Make md_is_html_block_end_condition() reuse the same data... ... as md_is_html_block_start_condition() for the type 1 so we make all tags are used consistently there. Fixes #207.
Martin Mitas 8699cd5d 2024-01-08T21:58:26 test/hard-soft-breaks.txt: Fix wording.
Martin Mitas 319631f6 2024-01-08T21:52:30 Don't merge multiple HTML blocks together. Fixes #202.
l-m 6ef3be6e 2024-01-08T20:09:57 `MD_FLAG_HARD_SOFT_BREAKS` (#193)
Erich Erstu 4e5a6e6f 2024-01-08T21:57:40 Update README.md (#198) Added MarkDown Monolith Assembler to the list of software that uses md4c.
step f554bf11 2024-01-08T20:55:54 Don't trim HTML block lines (MD_LINE_HTML) (#206) Markdown 0.30 doesn't mandate right-trimming the contents of HTML lines. Doing so is more work and breaks output compatibility with cmark, tested with https://github.com/commonmark/cmark/commit/9393560.
Martin Mitas 4d2f8a2e 2024-01-08T19:35:53 Add test for issue #201. Seems the issue got fixed by combination of previous commits. Fixes #201.
Martin Mitas 132c29dc 2024-01-08T19:31:37 Allow indented code block to follow any block except paragraph without a blank line. Fixes #200.
Martin Mitas 601c8ab7 2024-01-08T19:06:04 Restore parent's block indentation when interruping a list item with double blank line. Fixes #190.
Martin Mitas bf2e7d30 2024-01-08T18:19:26 Require CMake 3.5 or newer. The recent versions of CMake started to warn about compatibility with older CMake versions than 3.5.
Martin Mitas 28f253d7 2024-01-08T18:18:51 Fix some gcc warnings with -pedantic. Fixes #187.
Martin Mitas 8c5e1906 2023-12-12T19:56:56 Fix windows-32 build.
Martin Mitas a9b0b457 2023-12-12T19:44:04 Migrate CI from Travis and Appveyor to Github Workflows.
Martin Mitas a27f8dc0 2023-12-12T19:31:30 test/fuzzers.fuzz-mdhtml.c: Remove stale comment.
Martin Mitas e9ff661f 2022-01-14T17:34:01 CHANGELOG.md: Link OSS-Fuzz.
Martin Mitas 7d439d49 2022-01-14T17:32:27 CHANGELOG.md: Fix a typo.
Martin Mitas d3c1c0bb 2022-01-14T17:27:05 fuzz-mdhtml.c: Cleanup of the code.
Martin Mitas f7c8db75 2022-01-14T11:04:02 md_rollback: Fix dummization of virtual closers. Fixes #173.
Martin Mitas 6abb7789 2022-01-14T10:13:28 Remove debug messages left by mistake in the previous commit.
Martin Mitas 62b60979 2022-01-14T10:00:09 Reset TABLECELLBOUNDARIES with ordinary opener chains. This is needed because special handling of '|' is now done also if the wiki-links extension is enabled so the chain is populated even with that extension. Fixes #174.
Martin Mitas a470fbf8 2022-01-13T20:34:47 md2html: Change interpretation of --github and --commonmark options. Previously these assigned a set of parser flags with an operator '='. Now '|=' is used so that any preceding options affecting what extensions to allow are not ignored.
Martin Mitas db9ab417 2022-01-12T16:16:00 Improve wiki-link parsing. * md_rollback: Restore dummy marks changed to virtual zero-length closers. * md_analyze_links: Be more careful in how we rollback contents of a full wiki link (`[[destination|label]]`). The destination has to be rollbacked completely (MD_ROLBACK_ALL) while the label only with MD_ROLLBACK_CROSSING. Fixes #173.
Martin Mitas 8dd35762 2022-01-11T20:53:04 md_analyze_dollar: Simplify the function.
Martin Mitas 4358c40a 2022-01-11T10:28:06 md_lookup_line: Advance to the next line even if the offset... falls into a gap between two lines, instead of returning NULL. Fixes NULL dereference in md_is_link_reference(). This was a regression in 2e9b13cc512b5984b010a7934253702a6763f4f7.
Martin Mitas c058e82c 2022-01-10T12:34:57 md_is_table_underline: Fix detection by the end of file. This was a regression in a8bb4d3020eb1cfa07f01241c2aa668d91011cb5.