summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-09-05build: only attempt to install MSVC system libraries on WindowsSaleem Abdulrasool
Newer versions of CMake attempt to query the system for information about the VS 2017 installation. Unfortunately, this query fails on non-Windows systems when cross-compiling: cmake_host_system_information does not recognize <key> VS_15_DIR CMake will not find these system libraries on non-Windows hosts anyways, and we were silencing the warnings, so simply omit the installation when cross-compiling to Windows.
2018-08-26Simplify code normalization, in line with spec change.John MacFarlane
2018-08-25Code span spec changes.John MacFarlane
These affect both parsing and writing commonmark.
2018-06-11Removed meta from list of block tags.John MacFarlane
Added regression test. See commonmark/CommonMark#527.
2018-04-14Optimize S_find_first_nonspace.John MacFarlane
We were needlessly redoing things we'd already done. Now we skip the work if the first nonspace is greater than the current offset. This fixes pathological slowdown with deeply nested lists (#255). For N = 3000, the time goes from over 17s to about 0.7s. Thanks to @mity for diagnosing the problem.
2018-03-25Allow spaces in link destination delimited with pointy brackets.John MacFarlane
To conform to recent spec change.
2018-03-25Adjust max length of decimal/numeric entities.John MacFarlane
See commonmark/CommonMark#487.
2018-03-25Fix inline raw HTML parsing.John MacFarlane
This fixes a recently added failing spec test case. Previously spaces were being allowed in unquoted attribute values; no we forbid them.
2018-03-25Don't allow list markers to be indented >= 4 spaces.John MacFarlane
See commonmark/CommonMark#497.
2017-11-14Generate export header for static-only buildNick Wellnhofer
Fixes issue #247.
2017-11-05Merge pull request #217 from github/upstream/limit-nested-parensJohn MacFarlane
> 32 nested balanced parens in a link is bananas
2017-11-02Merge branch 'master' into upstream/inline-sourceposAshe Connor
2017-10-19Include GNUInstallDirs in src/CMakeLists.txtNick Wellnhofer
Fixes installation error under some CMake versions, notably kalakris' CMake backport often used with Travis.
2017-10-12Fixed regression in install dest for static library.John MacFarlane
Due to a mistake, 0.28.1 installed libcmark.a into include/. Closes #238.
2017-10-10Don't use CMAKE_INSTALL_LIBDIR to create libcmark.pc.John MacFarlane
For some reason this wasn't getting set in processing libcmark.pc.in, and we were getting the wrong entry in libcmark.pc. (See #236) The new approach sets an internal libdir variable to lib${LIB_SUFFIX}. This variable is used both to set the install destination and in the libcmark.pc.in template. Closes #236. However, I'd welcome comments from @juhp who originally added CMAKE_INSTALL_LIBDIR in #185. I think that the new system should work fine with Fedora, since LIB_SUFFIX will be set appropriately, but some testing is in order.
2017-09-14blocks: Fix quadratic behavior in `finalize`Vicent Marti
2017-08-10Skip sourcepos tracking if disabledYuki Izumi
2017-08-10Fix inlines spanning newlines, text in non-paraYuki Izumi
2017-08-09--smart: open quote can never occur right after `]` or `)`.John MacFarlane
Closes #227.
2017-08-09Add sourcepos info for inlinesYuki Izumi
2017-08-03Reformat source code with 'make format'Nguyễn Thái Ngọc Duy
2017-08-01Advertise --validate-utf8 in usage informationNguyễn Thái Ngọc Duy
This option was added in 04726a7 (Added `CMARK_OPT_VALIDATE_UTF8` option. - 2015-06-16) but not "documented".
2017-07-17Fix URL scanner.Yuki Izumi
2017-07-13Reverted mistaken fix to #193.John MacFarlane
Commit 14ea489f5dd6e3d07e23f104d6c9ce441d05751b
2017-07-12> 32 nested balanced parens in a link is bananasYuki Izumi
2017-07-11Merge pull request #213 from github/upstream/undefined-shiftJohn MacFarlane
Use unsigned integer when shifting
2017-07-11Use unsigned integer when shiftingPhil Turnbull
A UBSAN warning can be triggered when handling a long sequence of backticks: src/commonmark.c:98:20: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' which can be triggered by: ``` | a | b | | --- | --** `c```````````````````````````````- | | c | `|d` \| e | ```
2017-07-06Avoid memcpy'ing NULL pointersPhil Turnbull
A UBSAN warning can be triggered because the link title is an empty string: src/inlines.c:113:20: runtime error: null pointer passed as argument 2, which is declared to never be null which can be triggered by: ``` [f]:_ [f] ``` The length of the memcpy is zero so the NULL pointer is not dereferenced but it is still undefined behaviour.
2017-06-29DeMorgan simplification of some tests in emphasis parser.John MacFarlane
This also brings the code into closer alignment with the wording of the spec. See jgm/CommonMark#467.
2017-06-29Fixed undefined shift in commonmark writer.John MacFarlane
Closes #211. Found by google/oss-fuzz: https://oss-fuzz.com/v2/testcase-detail/4686992824598528
2017-06-29latex writer: fix memory overflow.John MacFarlane
We got an array overflow in enumerated lists nested more than 10 deep with start number =/= 1. Found by google/oss-fuzz. https://oss-fuzz.com/v2/testcase-detail/5546760854306816 This commit also ensures that we don't try to set `enum_` counters that aren't defined by LaTeX (generally up to enumv). Closes #210.
2017-06-27Check for NULL pointer in get_link_typePhil Turnbull
echo '[](xx:)' | ./build/src/cmark -t latex Segmentation fault: 11
2017-06-27Add Makefile target and harness to fuzz with libFuzzerPhil Turnbull
This can be run locally with `make libFuzzer` but the harness will be integrated into oss-fuzz for large-scale fuzzing.
2017-06-23Reset bytes after UTF8 procYuki Izumi
See https://github.com/jgm/cmark/issues/206.
2017-06-21Don't scan past newline eitherYuki Izumi
2017-06-21Don't scan past an EOLYuki Izumi
2017-06-02Merge pull request #195 from github/revert-194-upstream/remove-normalizeJohn MacFarlane
Revert "Remove normalize as an option per #190"
2017-06-02Document cases where get_ functions return NULL.John MacFarlane
E.g. cmark_node_get_url on a non-link or image. Closes #155.
2017-06-02Properly handle backslashes in link destinations.John MacFarlane
Only ascii punctuation characters are escapable, per the spec. Closes #192.
2017-06-02Fixed bug with unescaped left angle bracket in link destination.John MacFarlane
Closes #193.
2017-06-02Fixed cmark_node_get_list_start to return 0 for bullet lists...John MacFarlane
as documented! Closes #202.
2017-05-30Use CMARK_NO_DELIM for bullet lists. Closes #201.John MacFarlane
2017-05-07Re-add CMARK_OPT_NORMALIZE without effect.Yuki Izumi
2017-05-05Remove normalize as an option per #190 (#194)Yuki Izumi
2017-04-03Fixed code for freeing delimiter stack.John MacFarlane
Note, however, that this may not be needed at all: the old code would have gone into an infinite loop if the delimiter stack were not already freed. If we can prove that the delimiter stack is empty at this point, we could remove this; on the other hand, it may not hurt to keep it here defensively. Closes #189.
2017-04-03Removed abort outside of conditional (typo).John MacFarlane
2017-04-03Removed coercion in error message when aborting from buffer.John MacFarlane
2017-04-03Print message to stderr when we abort due to memory demands.John MacFarlane
Closes #188. @nwellnhof - could you have a look and let me know if you think this is a bad idea or could be improved?
2017-02-05libcmark.pc: use CMAKE_INSTALL_LIBDIR (#185)Jens Petersen
needed for multilib distros like Fedora
2017-01-20Fixed buffer overflow error in S_parser_feed.John MacFarlane
The overflow could occur in the following condition: the buffer ends with `\r` and the next memory address contains `\n`. Closes #184.