Martin Mitas
e5feaf2c96
md_is_named_entity_contents: Fix buffer overflow.
...
Fixes #38 .
2018-05-29 19:42:13 +02:00
Martin Mitas
469873ee6c
md_is_link_label: Prevent read from lines[] beyond its size.
...
Fixes #37 .
2018-05-29 19:07:22 +02:00
Martin Mitas
7deaccf65d
md_is_link_label: Fix if the link label contains just backslash escapes.
...
The function did not remember the label start line index, leading to bad
consequences.
Fixes #39 .
2018-05-29 18:38:51 +02:00
Martin Mitas
387bd020b6
Fix misleading comment.
2018-05-28 23:09:09 +02:00
Martin Mitas
00ca0604f6
Bump version to 0.2.5
2018-05-28 22:06:15 +02:00
Martin Mitas
bf022cb656
Fix md_split_simple_pairing_mark().
...
When splitting a mark into two, make sure each of them gets the right
share od dummies for case that we will have to split once more.
Fixes #36 .
2018-05-28 21:16:29 +02:00
Martin Mitas
e7b84d65a4
pathological_tests.py: Fix test compatibility with Windows.
2018-05-28 21:09:32 +02:00
Martin Mitas
81e2a5cac2
pathological_tests.py: Test deeply nested lists.
2018-04-12 17:04:12 +02:00
Martin Mitas
21d6cc9dce
md2html.c: Fix possible overflow in membuf_grow().
2018-04-12 12:51:07 +02:00
Martin Mitas
26c5268e0a
md2html.c: Add newline to some error messages.
2018-04-12 12:50:29 +02:00
Martin Mitas
fdc1d61eb0
In md_is_atxheader_line(), set *p_end on success.
...
This prevents reiteration over the ATX header prefix in the caller.
2018-04-11 20:11:07 +02:00
Martin Mitas
0d1a41a4d2
md_build_attr_append_substr: Fix +1 allocation error.
...
Fixes #33 .
2018-03-28 08:21:21 +02:00
Martin Mitas
e0002e2b52
md4c.h: Fix some copy&paste errors in comments.
2017-12-27 09:45:34 +01:00
Martin Mitas
3cf6637b00
run-tests.sh: Use 'py' utility if available.
2017-12-10 16:11:36 +01:00
Martin Mitas
8bb5e2dc87
md4c.h: Fix typo in an #error message.
2017-09-29 23:42:36 +02:00
Martin Mitas
c3c1f9b051
README.md: Minor fix.
2017-09-29 23:37:31 +02:00
Martin Mitas
afc779f910
Avoid initializing strings with literals without '\0' terminator.
...
It improves maintainability of the code and it should also fix some
MSVC2015 warnings (see #26 ).
2017-09-11 11:07:05 +02:00
Martin Mitas
5f47a5cbfa
md_build_attribute: Handle U+0000 character.
2017-09-11 10:58:52 +02:00
Martin Mitas
bad11edea3
Fix path in codecov.yml
2017-08-31 14:49:18 +02:00
Martin Mitas
44fc7cf20d
Merge branch 'master' of https://github.com/mity/md4c
2017-08-30 16:06:44 +02:00
Martin Mitas
7906f4ee1b
Add codecov.yml to ignore test dir in coverage reports.
2017-08-30 16:05:27 +02:00
Martin Mitas
8bfb678588
render_html: Get rid of global variable.
...
This is a residue which by mistake survived the isolation of the
rendering code in the c850843c12
.
2017-08-28 16:18:56 +02:00
Martin Mitas
dc3dde78c8
render_html: Add a new line after <ol>.
...
This makes the behavior more consistent with <ul>.
2017-08-28 16:14:04 +02:00
Martin Mitas
19b24bdd11
Simplify the pathological test "many references".
2017-08-16 18:16:49 +02:00
Martin Mitas
07cec7dcd6
Add regression test for #24 .
2017-08-16 16:34:50 +02:00
Martin Mitas
2e0a74ba99
Fix problematic link destinations with angle brackets.
...
Fixes #24 .
2017-08-16 16:24:39 +02:00
Martin Mitas
9b8058d509
.travis.yml: Make sure we make a debug build.
...
This should be more friendly to code coverage analysis.
2017-08-13 11:47:18 +02:00
Martin Mitas
a2d8c37b80
README.md: Improve badge labels.
2017-08-13 11:24:24 +02:00
Martin Mitas
71aa92dbde
.travis.yml: Install python3 for running tests.
2017-08-13 11:04:12 +02:00
Martin Mitas
944139e594
Create code coverage report by lcov.
2017-08-13 10:57:12 +02:00
Martin Mitas
4f4bbcaaa6
Migrate code coverage reporting from coveralls.io to codecov.io.
2017-08-13 10:48:27 +02:00
Martin Mitas
17ad25ee19
CMakeLists.txt: Do not force -O2 in the release build.
...
With newer gcc (7.1), -O3 and -O2 makes real difference in the resulted
performance. On my Linux machine it makes about 10% when tested
with Cmark's `make bench`.
2017-08-03 12:01:49 +02:00
Martin Mitas
3571c2f0f0
Bump version to 0.2.3.
2017-08-02 00:41:14 +02:00
Martin Mitas
70925cacf7
README.md: Upgrade CommonMark version to 0.28.
2017-08-02 00:40:27 +02:00
Martin Mitas
25228d5d5c
md_is_link_destination_B: Apply new spec rules for parenthesis.
...
The specification now allows nesting parenthesis inside a link destination
as long as opening and closing ones are balanced.
2017-08-02 00:38:55 +02:00
Martin Mitas
a847f5522e
md_process_inlines: Apply new spec rules for emph/strong emph.
...
The spec now states that for
***foo***
we have to genarate
<em><strong>foo</strong></em>
instead of
<strong><em>foo</em></strong>
2017-08-02 00:38:54 +02:00
Martin Mitas
ee3bee1a5d
Upgrade to CommonMark specification 0.28.
2017-08-02 00:38:54 +02:00
Martin Mitas
938460d564
Improve/unify output of test scripts.
2017-07-25 03:25:42 +02:00
Martin Mitas
c52a50a3db
pathological_tests.py: Add test for reference definition lookup.
2017-07-25 03:25:42 +02:00
Martin Mitas
f0103c16e1
MD_MARK structure: Do not limit prev/next members to 24 bits.
...
For normal kind of input, using full 32 bits makes no big difference.
And limiting those members to 24 bits was maybe a security issue.
That implied a limit of 2 ** 24 == 16,777,216 marks per a single block.
As big as it may seem, malicious input may contain more. And if the
input is carefully crafted, the mark chains could theoretically form a
circles due to some overflows in these members, which could maybe make
the parser to never finish.
2017-07-25 00:26:43 +02:00
Martin Mitas
591b2d21ba
md_analyze_marks: Make the function inline.
2017-07-25 00:08:51 +02:00
Martin Mitas
61d38ef41e
md_analyze_marks: Remove unneeded parameters.
2017-07-24 23:59:23 +02:00
Martin Mitas
c51fb31058
md_analyze_marks: Walk only required range of the marks.
...
This changes causes that when recursing to analysis of link contents,
only the marks between the link opener and closer are iterated in
md_analyze_marks().
Fixes #22
2017-07-24 23:33:25 +02:00
Martin Mitas
a27aefded9
pathological_tests.py: Allow short option -p as a synonym of --program.
2017-07-24 20:17:50 +02:00
Martin Mitas
f4f7b2230c
pathological_tests.py: Allow Windowish line ends.
2017-07-24 20:15:09 +02:00
Martin Mitas
26f14899ed
Add pathological_tests.py from cmark.
2017-07-24 20:12:13 +02:00
Martin Mitas
ad4f28bb85
md_analyze_simple_pairing_mark: Fix the "rule of three".
...
If the first emphasis opener is refused due the rule of three, a previous
opener is examined. However the variable opener_orig_size_module3 was not
(re)set accordingly.
Fixes #21 .
2017-07-24 20:09:23 +02:00
Martin Mitas
e351a1d59f
md_collect_marks: Minor refactorization of emhasis handler.
2017-07-24 19:42:57 +02:00
Martin Mitas
70d739416b
md_build_attribute: Propagate NULL string if attribute is empty.
2017-07-22 00:56:23 +02:00
Martin Mitas
ca0985475b
Avoid heap allocations when building trivial MD_ATTRIBUTE.
2017-07-20 16:25:35 +02:00