commonmarker 0.16.8 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of commonmarker might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/commonmarker/cmark/CMakeLists.txt +3 -3
- data/ext/commonmarker/cmark/README.md +2 -2
- data/ext/commonmarker/cmark/api_test/CMakeLists.txt +2 -1
- data/ext/commonmarker/cmark/api_test/harness.c +27 -0
- data/ext/commonmarker/cmark/api_test/main.c +179 -3
- data/ext/commonmarker/cmark/changelog.txt +148 -0
- data/ext/commonmarker/cmark/extensions/autolink.c +8 -0
- data/ext/commonmarker/cmark/extensions/core-extensions.c +11 -1
- data/ext/commonmarker/cmark/extensions/core-extensions.h +1 -1
- data/ext/commonmarker/cmark/extensions/strikethrough.c +5 -0
- data/ext/commonmarker/cmark/extensions/table.c +44 -23
- data/ext/commonmarker/cmark/src/blocks.c +3 -2
- data/ext/commonmarker/cmark/src/cmark_extension_api.h +9 -0
- data/ext/commonmarker/cmark/src/inlines.c +208 -93
- data/ext/commonmarker/cmark/src/inlines.h +2 -2
- data/ext/commonmarker/cmark/src/iterator.c +1 -0
- data/ext/commonmarker/cmark/src/latex.c +11 -11
- data/ext/commonmarker/cmark/src/main.c +12 -11
- data/ext/commonmarker/cmark/src/node.h +1 -0
- data/ext/commonmarker/cmark/src/scanners.c +34 -24
- data/ext/commonmarker/cmark/src/scanners.re +1 -1
- data/ext/commonmarker/cmark/src/syntax_extension.c +5 -0
- data/ext/commonmarker/cmark/src/syntax_extension.h +1 -0
- data/ext/commonmarker/cmark/test/CMakeLists.txt +3 -2
- data/ext/commonmarker/cmark/test/cmark.py +2 -5
- data/ext/commonmarker/cmark/test/regression.txt +35 -1
- data/ext/commonmarker/cmark/test/smart_punct.txt +9 -0
- data/ext/commonmarker/cmark/test/spec.txt +88 -26
- data/ext/commonmarker/commonmarker.c +1 -1
- data/ext/commonmarker/extconf.rb +1 -1
- data/lib/commonmarker/version.rb +1 -1
- data/test/test_attributes.rb +1 -80
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78ee91668a78aaedd870bbaa8bf8e6cd551cadc9
|
4
|
+
data.tar.gz: 2391e06fd9d4e7dff10c71b9750e5141e19c0516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df4d33c89c1a28d2d26f187ac1e54038dcfb0ecabb947d1437b48aeb49943e5896efce5adba324dc30d2e8b9d063be96a7c866d02f9849672e29b25b23c656a
|
7
|
+
data.tar.gz: ea01b53f7f78cd0d4c0489beaee09cf9aa6dafb38d932aaae7211aa82100d717ae67580837c27721b9aa23134462b2b1f4feaac67b3d02db5ca880f4cbb40471
|
data/README.md
CHANGED
@@ -160,7 +160,7 @@ To have multiple options applied, pass in an array of symbols:
|
|
160
160
|
CommonMarker.render_html("\"'Shelob' is my name.\"", [:HARDBREAKS, :SOURCEPOS])
|
161
161
|
```
|
162
162
|
|
163
|
-
For more information on these options, see [the CMark documentation](
|
163
|
+
For more information on these options, see [the CMark documentation](https://git.io/v7nh1).
|
164
164
|
|
165
165
|
## Hacking
|
166
166
|
|
@@ -17,9 +17,9 @@ endif()
|
|
17
17
|
set(PROJECT_NAME "cmark")
|
18
18
|
|
19
19
|
set(PROJECT_VERSION_MAJOR 0)
|
20
|
-
set(PROJECT_VERSION_MINOR
|
21
|
-
set(PROJECT_VERSION_PATCH
|
22
|
-
set(PROJECT_VERSION_GFM
|
20
|
+
set(PROJECT_VERSION_MINOR 28)
|
21
|
+
set(PROJECT_VERSION_PATCH 0)
|
22
|
+
set(PROJECT_VERSION_GFM 8)
|
23
23
|
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM} )
|
24
24
|
|
25
25
|
option(CMARK_TESTS "Build cmark tests and enable testing" ON)
|
@@ -116,9 +116,9 @@ To run a test for memory leaks using `valgrind`:
|
|
116
116
|
|
117
117
|
make leakcheck
|
118
118
|
|
119
|
-
To reformat source code using `
|
119
|
+
To reformat source code using `clang-format`:
|
120
120
|
|
121
|
-
make
|
121
|
+
make format
|
122
122
|
|
123
123
|
To run a "fuzz test" against ten long randomly generated inputs:
|
124
124
|
|
@@ -7,8 +7,9 @@ add_executable(api_test
|
|
7
7
|
include_directories(
|
8
8
|
${PROJECT_SOURCE_DIR}/src
|
9
9
|
${PROJECT_BINARY_DIR}/src
|
10
|
+
${PROJECT_BINARY_DIR}/extensions
|
10
11
|
)
|
11
|
-
target_link_libraries(api_test libcmark-gfm)
|
12
|
+
target_link_libraries(api_test libcmark-gfmextensions libcmark-gfm)
|
12
13
|
|
13
14
|
# Compiler flags
|
14
15
|
if(MSVC)
|
@@ -50,6 +50,21 @@ void INT_EQ(test_batch_runner *runner, int got, int expected, const char *msg,
|
|
50
50
|
}
|
51
51
|
}
|
52
52
|
|
53
|
+
#ifndef _WIN32
|
54
|
+
#include <unistd.h>
|
55
|
+
|
56
|
+
static char *write_tmp(char const *header, char const *data) {
|
57
|
+
char *name = strdup("/tmp/fileXXXXXX");
|
58
|
+
int fd = mkstemp(name);
|
59
|
+
FILE *f = fdopen(fd, "w+");
|
60
|
+
fputs(header, f);
|
61
|
+
fwrite(data, 1, strlen(data), f);
|
62
|
+
fclose(f);
|
63
|
+
return name;
|
64
|
+
}
|
65
|
+
|
66
|
+
#endif
|
67
|
+
|
53
68
|
void STR_EQ(test_batch_runner *runner, const char *got, const char *expected,
|
54
69
|
const char *msg, ...) {
|
55
70
|
int cond = strcmp(got, expected) == 0;
|
@@ -60,8 +75,20 @@ void STR_EQ(test_batch_runner *runner, const char *got, const char *expected,
|
|
60
75
|
va_end(ap);
|
61
76
|
|
62
77
|
if (!cond) {
|
78
|
+
#ifndef _WIN32
|
79
|
+
char *got_fn = write_tmp("actual\n", got);
|
80
|
+
char *expected_fn = write_tmp("expected\n", expected);
|
81
|
+
char buf[1024];
|
82
|
+
snprintf(buf, sizeof(buf), "git diff --no-index %s %s", expected_fn, got_fn);
|
83
|
+
system(buf);
|
84
|
+
remove(got_fn);
|
85
|
+
remove(expected_fn);
|
86
|
+
free(got_fn);
|
87
|
+
free(expected_fn);
|
88
|
+
#else
|
63
89
|
fprintf(stderr, " Got: \"%s\"\n", got);
|
64
90
|
fprintf(stderr, " Expected: \"%s\"\n", expected);
|
91
|
+
#endif
|
65
92
|
}
|
66
93
|
}
|
67
94
|
|
@@ -5,6 +5,7 @@
|
|
5
5
|
#define CMARK_NO_SHORT_NAMES
|
6
6
|
#include "cmark.h"
|
7
7
|
#include "node.h"
|
8
|
+
#include "../extensions/core-extensions.h"
|
8
9
|
|
9
10
|
#include "harness.h"
|
10
11
|
#include "cplusplus.h"
|
@@ -551,9 +552,9 @@ static void render_xml(test_batch_runner *runner) {
|
|
551
552
|
STR_EQ(runner, xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
552
553
|
"<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n"
|
553
554
|
"<paragraph sourcepos=\"1:1-1:9\">\n"
|
554
|
-
" <text>foo </text>\n"
|
555
|
-
" <emph>\n"
|
556
|
-
" <text>bar</text>\n"
|
555
|
+
" <text sourcepos=\"1:1-1:4\">foo </text>\n"
|
556
|
+
" <emph sourcepos=\"1:5-1:9\">\n"
|
557
|
+
" <text sourcepos=\"1:6-1:8\">bar</text>\n"
|
557
558
|
" </emph>\n"
|
558
559
|
"</paragraph>\n",
|
559
560
|
"render first paragraph with source pos");
|
@@ -933,6 +934,178 @@ static void test_feed_across_line_ending(test_batch_runner *runner) {
|
|
933
934
|
cmark_node_free(document);
|
934
935
|
}
|
935
936
|
|
937
|
+
static void source_pos(test_batch_runner *runner) {
|
938
|
+
static const char markdown[] =
|
939
|
+
"# Hi *there*.\n"
|
940
|
+
"\n"
|
941
|
+
"Hello “ <http://www.google.com>\n"
|
942
|
+
"there `hi` -- [okay](www.google.com (ok)).\n"
|
943
|
+
"\n"
|
944
|
+
"> 1. Okay.\n"
|
945
|
+
"> Sure.\n"
|
946
|
+
">\n"
|
947
|
+
"> 2. Yes, okay.\n"
|
948
|
+
"> ![ok](hi \"yes\")\n";
|
949
|
+
|
950
|
+
cmark_node *doc = cmark_parse_document(markdown, sizeof(markdown) - 1, CMARK_OPT_DEFAULT);
|
951
|
+
char *xml = cmark_render_xml(doc, CMARK_OPT_DEFAULT | CMARK_OPT_SOURCEPOS);
|
952
|
+
STR_EQ(runner, xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
953
|
+
"<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n"
|
954
|
+
"<document sourcepos=\"1:1-10:20\" xmlns=\"http://commonmark.org/xml/1.0\">\n"
|
955
|
+
" <heading sourcepos=\"1:1-1:13\" level=\"1\">\n"
|
956
|
+
" <text sourcepos=\"1:3-1:5\">Hi </text>\n"
|
957
|
+
" <emph sourcepos=\"1:6-1:12\">\n"
|
958
|
+
" <text sourcepos=\"1:7-1:11\">there</text>\n"
|
959
|
+
" </emph>\n"
|
960
|
+
" <text sourcepos=\"1:13-1:13\">.</text>\n"
|
961
|
+
" </heading>\n"
|
962
|
+
" <paragraph sourcepos=\"3:1-4:42\">\n"
|
963
|
+
" <text sourcepos=\"3:1-3:14\">Hello “ </text>\n"
|
964
|
+
" <link sourcepos=\"3:15-3:37\" destination=\"http://www.google.com\" title=\"\">\n"
|
965
|
+
" <text sourcepos=\"3:16-3:36\">http://www.google.com</text>\n"
|
966
|
+
" </link>\n"
|
967
|
+
" <softbreak />\n"
|
968
|
+
" <text sourcepos=\"4:1-4:6\">there </text>\n"
|
969
|
+
" <code sourcepos=\"4:8-4:9\">hi</code>\n"
|
970
|
+
" <text sourcepos=\"4:11-4:14\"> -- </text>\n"
|
971
|
+
" <link sourcepos=\"4:15-4:41\" destination=\"www.google.com\" title=\"ok\">\n"
|
972
|
+
" <text sourcepos=\"4:16-4:19\">okay</text>\n"
|
973
|
+
" </link>\n"
|
974
|
+
" <text sourcepos=\"4:42-4:42\">.</text>\n"
|
975
|
+
" </paragraph>\n"
|
976
|
+
" <block_quote sourcepos=\"6:1-10:20\">\n"
|
977
|
+
" <list sourcepos=\"6:3-10:20\" type=\"ordered\" start=\"1\" delim=\"period\" tight=\"false\">\n"
|
978
|
+
" <item sourcepos=\"6:3-8:1\">\n"
|
979
|
+
" <paragraph sourcepos=\"6:6-7:10\">\n"
|
980
|
+
" <text sourcepos=\"6:6-6:10\">Okay.</text>\n"
|
981
|
+
" <softbreak />\n"
|
982
|
+
" <text sourcepos=\"7:6-7:10\">Sure.</text>\n"
|
983
|
+
" </paragraph>\n"
|
984
|
+
" </item>\n"
|
985
|
+
" <item sourcepos=\"9:3-10:20\">\n"
|
986
|
+
" <paragraph sourcepos=\"9:6-10:20\">\n"
|
987
|
+
" <text sourcepos=\"9:6-9:15\">Yes, okay.</text>\n"
|
988
|
+
" <softbreak />\n"
|
989
|
+
" <image sourcepos=\"10:6-10:20\" destination=\"hi\" title=\"yes\">\n"
|
990
|
+
" <text sourcepos=\"10:8-10:9\">ok</text>\n"
|
991
|
+
" </image>\n"
|
992
|
+
" </paragraph>\n"
|
993
|
+
" </item>\n"
|
994
|
+
" </list>\n"
|
995
|
+
" </block_quote>\n"
|
996
|
+
"</document>\n",
|
997
|
+
"sourcepos are as expected");
|
998
|
+
free(xml);
|
999
|
+
cmark_node_free(doc);
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
static void ext_source_pos(test_batch_runner *runner) {
|
1003
|
+
static const char *extensions[3] = {
|
1004
|
+
"strikethrough",
|
1005
|
+
"table",
|
1006
|
+
"autolink",
|
1007
|
+
};
|
1008
|
+
|
1009
|
+
static const char markdown[] =
|
1010
|
+
"Hi ~~friend~~.\n"
|
1011
|
+
"\n"
|
1012
|
+
"> www.github.com\n"
|
1013
|
+
"\n"
|
1014
|
+
"1. | a | b | *c* |\n"
|
1015
|
+
" | - | - | --: |\n"
|
1016
|
+
" | 1 | 2 | ~3~ |\n";
|
1017
|
+
|
1018
|
+
cmark_parser *parser = cmark_parser_new(CMARK_OPT_DEFAULT);
|
1019
|
+
core_extensions_ensure_registered();
|
1020
|
+
|
1021
|
+
for (int i = 0; i < (int)(sizeof(extensions) / sizeof(*extensions)); ++i) {
|
1022
|
+
cmark_syntax_extension *ext = cmark_find_syntax_extension(extensions[i]);
|
1023
|
+
cmark_parser_attach_syntax_extension(parser, ext);
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
cmark_parser_feed(parser, markdown, sizeof(markdown) - 1);
|
1027
|
+
|
1028
|
+
cmark_node *doc = cmark_parser_finish(parser);
|
1029
|
+
char *xml = cmark_render_xml(doc, CMARK_OPT_DEFAULT | CMARK_OPT_SOURCEPOS);
|
1030
|
+
STR_EQ(runner, xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
1031
|
+
"<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n"
|
1032
|
+
"<document sourcepos=\"1:1-7:18\" xmlns=\"http://commonmark.org/xml/1.0\">\n"
|
1033
|
+
" <paragraph sourcepos=\"1:1-1:14\">\n"
|
1034
|
+
" <text sourcepos=\"1:1-1:3\">Hi </text>\n"
|
1035
|
+
" <strikethrough sourcepos=\"1:4-1:13\">\n"
|
1036
|
+
" <text sourcepos=\"1:6-1:11\">friend</text>\n"
|
1037
|
+
" </strikethrough>\n"
|
1038
|
+
" <text sourcepos=\"1:14-1:14\">.</text>\n"
|
1039
|
+
" </paragraph>\n"
|
1040
|
+
" <block_quote sourcepos=\"3:1-3:16\">\n"
|
1041
|
+
" <paragraph sourcepos=\"3:3-3:16\">\n"
|
1042
|
+
" <link sourcepos=\"3:2-3:16\" destination=\"http://www.github.com\" title=\"\">\n"
|
1043
|
+
" <text sourcepos=\"3:2-3:16\">www.github.com</text>\n"
|
1044
|
+
" </link>\n"
|
1045
|
+
" </paragraph>\n"
|
1046
|
+
" </block_quote>\n"
|
1047
|
+
" <list sourcepos=\"5:1-7:18\" type=\"ordered\" start=\"1\" delim=\"period\" tight=\"true\">\n"
|
1048
|
+
" <item sourcepos=\"5:1-7:18\">\n"
|
1049
|
+
" <table sourcepos=\"5:4-7:18\">\n"
|
1050
|
+
" <table_header sourcepos=\"5:4-5:18\">\n"
|
1051
|
+
" <table_cell sourcepos=\"5:5-5:7\">\n"
|
1052
|
+
" <text sourcepos=\"5:6-5:6\">a</text>\n"
|
1053
|
+
" </table_cell>\n"
|
1054
|
+
" <table_cell sourcepos=\"5:9-5:11\">\n"
|
1055
|
+
" <text sourcepos=\"5:10-5:10\">b</text>\n"
|
1056
|
+
" </table_cell>\n"
|
1057
|
+
" <table_cell sourcepos=\"5:13-5:17\">\n"
|
1058
|
+
" <emph sourcepos=\"5:14-5:16\">\n"
|
1059
|
+
" <text sourcepos=\"5:15-5:15\">c</text>\n"
|
1060
|
+
" </emph>\n"
|
1061
|
+
" </table_cell>\n"
|
1062
|
+
" </table_header>\n"
|
1063
|
+
" <table_row sourcepos=\"7:4-7:18\">\n"
|
1064
|
+
" <table_cell sourcepos=\"7:5-7:7\">\n"
|
1065
|
+
" <text sourcepos=\"7:6-7:6\">1</text>\n"
|
1066
|
+
" </table_cell>\n"
|
1067
|
+
" <table_cell sourcepos=\"7:9-7:11\">\n"
|
1068
|
+
" <text sourcepos=\"7:10-7:10\">2</text>\n"
|
1069
|
+
" </table_cell>\n"
|
1070
|
+
" <table_cell sourcepos=\"7:13-7:17\">\n"
|
1071
|
+
" <strikethrough sourcepos=\"7:14-7:16\">\n"
|
1072
|
+
" <text sourcepos=\"7:15-7:15\">3</text>\n"
|
1073
|
+
" </strikethrough>\n"
|
1074
|
+
" </table_cell>\n"
|
1075
|
+
" </table_row>\n"
|
1076
|
+
" </table>\n"
|
1077
|
+
" </item>\n"
|
1078
|
+
" </list>\n"
|
1079
|
+
"</document>\n",
|
1080
|
+
"sourcepos are as expected");
|
1081
|
+
free(xml);
|
1082
|
+
cmark_node_free(doc);
|
1083
|
+
}
|
1084
|
+
|
1085
|
+
static void ref_source_pos(test_batch_runner *runner) {
|
1086
|
+
static const char markdown[] =
|
1087
|
+
"Let's try [reference] links.\n"
|
1088
|
+
"\n"
|
1089
|
+
"[reference]: https://github.com (GitHub)\n";
|
1090
|
+
|
1091
|
+
cmark_node *doc = cmark_parse_document(markdown, sizeof(markdown) - 1, CMARK_OPT_DEFAULT);
|
1092
|
+
char *xml = cmark_render_xml(doc, CMARK_OPT_DEFAULT | CMARK_OPT_SOURCEPOS);
|
1093
|
+
STR_EQ(runner, xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
1094
|
+
"<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n"
|
1095
|
+
"<document sourcepos=\"1:1-3:40\" xmlns=\"http://commonmark.org/xml/1.0\">\n"
|
1096
|
+
" <paragraph sourcepos=\"1:1-1:28\">\n"
|
1097
|
+
" <text sourcepos=\"1:1-1:10\">Let's try </text>\n"
|
1098
|
+
" <link sourcepos=\"1:11-1:21\" destination=\"https://github.com\" title=\"GitHub\">\n"
|
1099
|
+
" <text sourcepos=\"1:12-1:20\">reference</text>\n"
|
1100
|
+
" </link>\n"
|
1101
|
+
" <text sourcepos=\"1:22-1:28\"> links.</text>\n"
|
1102
|
+
" </paragraph>\n"
|
1103
|
+
"</document>\n",
|
1104
|
+
"sourcepos are as expected");
|
1105
|
+
free(xml);
|
1106
|
+
cmark_node_free(doc);
|
1107
|
+
}
|
1108
|
+
|
936
1109
|
int main() {
|
937
1110
|
int retval;
|
938
1111
|
test_batch_runner *runner = test_batch_runner_new();
|
@@ -959,6 +1132,9 @@ int main() {
|
|
959
1132
|
test_cplusplus(runner);
|
960
1133
|
test_safe(runner);
|
961
1134
|
test_feed_across_line_ending(runner);
|
1135
|
+
source_pos(runner);
|
1136
|
+
ext_source_pos(runner);
|
1137
|
+
ref_source_pos(runner);
|
962
1138
|
|
963
1139
|
test_print_summary(runner);
|
964
1140
|
retval = test_ok(runner) ? 0 : 1;
|
@@ -1,3 +1,151 @@
|
|
1
|
+
[0.28.0.gfm.8]
|
2
|
+
|
3
|
+
* Fix bug where autolink would cause `:` to be skipped in emphasis
|
4
|
+
processing.
|
5
|
+
|
6
|
+
[0.28.0.gfm.7]
|
7
|
+
|
8
|
+
* Strikethrough characters do not disturb regular emphasis processing.
|
9
|
+
|
10
|
+
[0.28.0.gfm.6]
|
11
|
+
|
12
|
+
* Fix inline sourcepos info when inlines span multiple lines, and in
|
13
|
+
ATX headings.
|
14
|
+
|
15
|
+
[0.28.0.gfm.5]
|
16
|
+
|
17
|
+
* Latest spec.
|
18
|
+
* Fix a typo in the spec (John Gardner).
|
19
|
+
* Fix quadratic behavior in reference lookups.
|
20
|
+
* Add `core_extensions_ensure_registered`.
|
21
|
+
* Add sourcepos information for inlines.
|
22
|
+
|
23
|
+
[0.28]
|
24
|
+
|
25
|
+
* Update spec.
|
26
|
+
* Use unsigned integer when shifting (Phil Turnbull).
|
27
|
+
Avoids a UBSAN warning which can be triggered when handling a
|
28
|
+
long sequence of backticks.
|
29
|
+
* Avoid memcpy'ing NULL pointers (Phil Turnbull).
|
30
|
+
Avoids a UBSAN warning when link title is empty string.
|
31
|
+
The length of the memcpy is zero so the NULL pointer is not
|
32
|
+
dereferenced but it is still undefined behaviour.
|
33
|
+
* DeMorgan simplification of some tests in emphasis parser.
|
34
|
+
This also brings the code into closer alignment with the wording
|
35
|
+
of the spec (see jgm/CommonMark#467).
|
36
|
+
* Fixed undefined shift in commonmark writer (#211).
|
37
|
+
Found by google/oss-fuzz:
|
38
|
+
<https://oss-fuzz.com/v2/testcase-detail/4686992824598528>.
|
39
|
+
* latex writer: fix memory overflow (#210).
|
40
|
+
We got an array overflow in enumerated lists nested more than
|
41
|
+
10 deep with start number =/= 1.
|
42
|
+
This commit also ensures that we don't try to set `enum_` counters
|
43
|
+
that aren't defined by LaTeX (generally up to enumv).
|
44
|
+
Found by google/oss-fuzz:
|
45
|
+
<https://oss-fuzz.com/v2/testcase-detail/5546760854306816>.
|
46
|
+
* Check for NULL pointer in get_link_type (Phil Turnbull).
|
47
|
+
`echo '[](xx:)' | ./build/src/cmark -t latex` gave a
|
48
|
+
segfault.
|
49
|
+
* Move fuzzing dictionary into single file (Phil Turnbull).
|
50
|
+
This allows AFL and libFuzzer to use the same dictionary
|
51
|
+
* Reset bytes after UTF8 proc (Yuki Izumi, #206).
|
52
|
+
* Don't scan past an EOL (Yuki Izumi).
|
53
|
+
The existing negated character classes (`[^…]`) are careful to
|
54
|
+
always include` \x00` in the characters excluded, but these `.`
|
55
|
+
catch-alls can scan right past the terminating NUL placed
|
56
|
+
at the end of the buffer by `_scan_at`. As such, buffer
|
57
|
+
overruns can occur. Also, don't scan past a newline in HTML
|
58
|
+
block end scanners.
|
59
|
+
* Document cases where `get_` functions return `NULL` (#155).
|
60
|
+
E.g. `cmark_node_get_url` on a non-link or image.
|
61
|
+
* Properly handle backslashes in link destinations (#192).
|
62
|
+
Only ascii punctuation characters are escapable, per the spec.
|
63
|
+
* Fixed `cmark_node_get_list_start` to return 0 for bullet lists,
|
64
|
+
as documented (#202).
|
65
|
+
* Use `CMARK_NO_DELIM` for bullet lists (#201).
|
66
|
+
* Fixed code for freeing delimiter stack (#189).
|
67
|
+
* Removed abort outside of conditional (typo).
|
68
|
+
* Removed coercion in error message when aborting from buffer.
|
69
|
+
* Print message to stderr when we abort due to memory demands (#188).
|
70
|
+
* `libcmark.pc`: use `CMAKE_INSTALL_LIBDIR` (#185, Jens Petersen).
|
71
|
+
Needed for multilib distros like Fedora.
|
72
|
+
* Fixed buffer overflow error in `S_parser_feed` (#184).
|
73
|
+
The overflow could occur in the following condition:
|
74
|
+
the buffer ends with `\r` and the next memory address
|
75
|
+
contains `\n`.
|
76
|
+
* Update emphasis parsing for spec change.
|
77
|
+
Strong now goes inside Emph rather than the reverse,
|
78
|
+
when both scopes are possible. The code is much simpler.
|
79
|
+
This also avoids a spec inconsistency that cmark had previously:
|
80
|
+
`***hi***` became Strong (Emph "hi")) but
|
81
|
+
`***hi****` became Emph (Strong "hi")) "*"
|
82
|
+
* Fixes for the LaTeX renderer (#182, Doeme)
|
83
|
+
+ Don't double-output the link in latex-rendering.
|
84
|
+
+ Prevent ligatures in dashes sensibly when rendering latex.
|
85
|
+
`\-` is a hyphenation, so it doesn't get displayed at all.
|
86
|
+
* Added a test for NULL when freeing `subj->last_delim`.
|
87
|
+
* Cleaned up setting of lower bounds for openers.
|
88
|
+
We now use a much smaller array.
|
89
|
+
* Fix #178, quadratic parsing bug. Add pathological test.
|
90
|
+
* Slight improvement of clarity of logic in emph matching.
|
91
|
+
* Fix "multiple of 3" determination in emph/strong parsing.
|
92
|
+
We need to store the length of the original delimiter run,
|
93
|
+
instead of using the length of the remaining delimiters
|
94
|
+
after some have been subtracted. Test case:
|
95
|
+
`a***b* c*`. Thanks to Raph Levin for reporting.
|
96
|
+
* Correctly initialize chunk in S_process_line (Nick Wellnhofer, #170).
|
97
|
+
The `alloc` member wasn't initialized. This also allows to add an
|
98
|
+
assertion in `chunk_rtrim` which doesn't work for alloced chunks.
|
99
|
+
* Added 'make newbench'.
|
100
|
+
* `scanners.c` generated with re2c 0.16 (68K smaller!).
|
101
|
+
* `scanners.re` - fixed warnings; use `*` for fallback.
|
102
|
+
* Fixed some warnings in `scanners.re`.
|
103
|
+
* Update CaseFolding to latest (Kevin Wojniak, #168).
|
104
|
+
* Allow balanced nested parens in link destinations (Yuki Izumi, #166)
|
105
|
+
* Allocate enough bytes for backticks array.
|
106
|
+
* Inlines: Ensure that the delimiter stack is freed in subject.
|
107
|
+
* Fixed pathological cases with backtick code spans:
|
108
|
+
|
109
|
+
- Removed recursion in scan_to_closing_backticks
|
110
|
+
- Added an array of pointers to potential backtick closers
|
111
|
+
to subject
|
112
|
+
- This array is used to avoid traversing the subject again
|
113
|
+
when we've already seen all the potential backtick closers.
|
114
|
+
- Added a max bound of 1000 for backtick code span delimiters.
|
115
|
+
- This helps with pathological cases like:
|
116
|
+
|
117
|
+
x
|
118
|
+
x `
|
119
|
+
x ``
|
120
|
+
x ```
|
121
|
+
x ````
|
122
|
+
...
|
123
|
+
|
124
|
+
- Added pathological test case.
|
125
|
+
|
126
|
+
Thanks to Martin Mitáš for identifying the problem and for
|
127
|
+
discussion of solutions.
|
128
|
+
* Remove redundant cmake_minimum_required (#163, @kainjow).
|
129
|
+
* Make shared and static libraries optional (Azamat H. Hackimov).
|
130
|
+
Now you can enable/disable compilation and installation targets for
|
131
|
+
shared and static libraries via `-DCMARK_SHARED=ON/OFF` and
|
132
|
+
`-DCMARK_STATIC=ON/OFF`.
|
133
|
+
* Added support for built-in `${LIB_SUFFIX}` feature (Azamat H.
|
134
|
+
Hackimov). Replaced `${LIB_INSTALL_DIR}` option with built-in
|
135
|
+
`${LIB_SUFFIX}` for installing for 32/64-bit systems. Normally,
|
136
|
+
CMake will set `${LIB_SUFFIX}` automatically for required enviroment.
|
137
|
+
If you have any issues with it, you can override this option with
|
138
|
+
`-DLIB_SUFFIX=64` or `-DLIB_SUFFIX=""` during configuration.
|
139
|
+
* Add Makefile target and harness to fuzz with libFuzzer (Phil Turnbull).
|
140
|
+
This can be run locally with `make libFuzzer` but the harness will be
|
141
|
+
integrated into oss-fuzz for large-scale fuzzing.
|
142
|
+
* Advertise `--validate-utf8` in usage information
|
143
|
+
(Nguyễn Thái Ngọc Duy).
|
144
|
+
* Makefile: use warnings with re2c.
|
145
|
+
* README: Add link to Python wrapper, prettify languages list
|
146
|
+
(Pavlo Kapyshin).
|
147
|
+
* README: Add link to cmark-scala (Tim Nieradzik, #196)
|
148
|
+
|
1
149
|
[0.27.1.gfm.4]
|
2
150
|
|
3
151
|
* Fix regression with nested parentheses in link targets (#48).
|