commonmarker 0.16.0 → 0.16.1
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/ext/commonmarker/cmark/CMakeLists.txt +3 -3
- data/ext/commonmarker/cmark/api_test/CMakeLists.txt +1 -1
- data/ext/commonmarker/cmark/changelog.txt +7 -0
- data/ext/commonmarker/cmark/extensions/CMakeLists.txt +28 -13
- data/ext/commonmarker/cmark/extensions/autolink.c +1 -1
- data/ext/commonmarker/cmark/extensions/core-extensions.h +6 -0
- data/ext/commonmarker/cmark/extensions/table.c +15 -1
- data/ext/commonmarker/cmark/src/CMakeLists.txt +22 -35
- data/ext/commonmarker/cmark/src/cmark_extension_api.h +5 -0
- data/ext/commonmarker/cmark/src/cmark_version.h.in +1 -0
- data/ext/commonmarker/cmark/src/scanners.re +6 -6
- data/ext/commonmarker/cmark/src/syntax_extension.c +4 -0
- data/lib/commonmarker/version.rb +1 -1
- 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: f47e1115fc03d5a3d93db2ece1626fb2c38ba6b3
|
4
|
+
data.tar.gz: 8fe93860696f9344e3ef097bc7cd00e971bdb391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ba87287a25a9758033ac659d6c39ac30e7bf551f9ce0890593fa5d0287973bb77996896945850aaaf73a152eb110c623d42301f00ba39d951b2280d32d18b4f
|
7
|
+
data.tar.gz: fd802cf0b355314b87674b3cea0b78caefb6bdb7bcc59c5e7dbbfbdee633fff4e6f6e227fcd8df57f29d09472f43e4a0f268a34aed1a9f1c5b62c8488355ab10
|
@@ -19,12 +19,12 @@ set(PROJECT_NAME "cmark")
|
|
19
19
|
set(PROJECT_VERSION_MAJOR 0)
|
20
20
|
set(PROJECT_VERSION_MINOR 27)
|
21
21
|
set(PROJECT_VERSION_PATCH 1)
|
22
|
-
set(PROJECT_VERSION_GFM
|
22
|
+
set(PROJECT_VERSION_GFM 1)
|
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)
|
26
|
-
option(CMARK_STATIC "Build static libcmark library" ON)
|
27
|
-
option(CMARK_SHARED "Build shared libcmark library" ON)
|
26
|
+
option(CMARK_STATIC "Build static libcmark-gfm library" ON)
|
27
|
+
option(CMARK_SHARED "Build shared libcmark-gfm library" ON)
|
28
28
|
|
29
29
|
add_subdirectory(src)
|
30
30
|
add_subdirectory(extensions)
|
@@ -1,3 +1,10 @@
|
|
1
|
+
[0.27.1.gfm.1]
|
2
|
+
|
3
|
+
* Add plaintext renderer.
|
4
|
+
* Remove normalize option; we now always normalize the AST.
|
5
|
+
* Add getters for table alignment.
|
6
|
+
* `make install` also installs the extensions static/shared library.
|
7
|
+
|
1
8
|
[0.27.1.gfm.0]
|
2
9
|
|
3
10
|
* Add extensions: tagfilter, strikethrough, table, autolink.
|
@@ -19,15 +19,6 @@ include_directories(
|
|
19
19
|
|
20
20
|
include (GenerateExportHeader)
|
21
21
|
|
22
|
-
# We make LIB_INSTALL_DIR configurable rather than
|
23
|
-
# hard-coding lib, because on some OSes different locations
|
24
|
-
# are used for different architectures (e.g. /usr/lib64 on
|
25
|
-
# 64-bit Fedora).
|
26
|
-
if(NOT LIB_INSTALL_DIR)
|
27
|
-
set(LIB_INSTALL_DIR "lib" CACHE STRING
|
28
|
-
"Set the installation directory for libraries." FORCE)
|
29
|
-
endif(NOT LIB_INSTALL_DIR)
|
30
|
-
|
31
22
|
include_directories(. ${CMAKE_CURRENT_BINARY_DIR})
|
32
23
|
|
33
24
|
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -pg")
|
@@ -38,9 +29,9 @@ if (CMARK_SHARED)
|
|
38
29
|
add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES})
|
39
30
|
|
40
31
|
set_target_properties(${LIBRARY} PROPERTIES
|
41
|
-
|
42
|
-
|
43
|
-
|
32
|
+
OUTPUT_NAME "cmark-gfmextensions"
|
33
|
+
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM}
|
34
|
+
VERSION ${PROJECT_VERSION})
|
44
35
|
|
45
36
|
set_property(TARGET ${LIBRARY}
|
46
37
|
APPEND PROPERTY MACOSX_RPATH true)
|
@@ -48,10 +39,12 @@ if (CMARK_SHARED)
|
|
48
39
|
# Avoid name clash between PROGRAM and LIBRARY pdb files.
|
49
40
|
set_target_properties(${LIBRARY} PROPERTIES PDB_NAME cmark-gfmextensions_dll)
|
50
41
|
|
42
|
+
generate_export_header(${LIBRARY}
|
43
|
+
BASE_NAME cmarkextensions)
|
44
|
+
|
51
45
|
list(APPEND CMARK_INSTALL ${LIBRARY})
|
52
46
|
target_link_libraries(${LIBRARY} libcmark-gfm)
|
53
47
|
|
54
|
-
generate_export_header(${LIBRARY} BASE_NAME cmarkextensions)
|
55
48
|
endif()
|
56
49
|
|
57
50
|
if (CMARK_STATIC)
|
@@ -70,6 +63,28 @@ if (CMARK_STATIC)
|
|
70
63
|
OUTPUT_NAME "cmark-gfmextensions"
|
71
64
|
VERSION ${PROJECT_VERSION})
|
72
65
|
endif(MSVC)
|
66
|
+
|
67
|
+
list(APPEND CMARK_INSTALL ${STATICLIBRARY})
|
68
|
+
endif()
|
69
|
+
|
70
|
+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
71
|
+
|
72
|
+
include (InstallRequiredSystemLibraries)
|
73
|
+
install(TARGETS ${CMARK_INSTALL}
|
74
|
+
EXPORT cmark-gfmextensions
|
75
|
+
RUNTIME DESTINATION bin
|
76
|
+
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
77
|
+
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
78
|
+
)
|
79
|
+
|
80
|
+
if (CMARK_SHARED OR CMARK_STATIC)
|
81
|
+
install(FILES
|
82
|
+
core-extensions.h
|
83
|
+
${CMAKE_CURRENT_BINARY_DIR}/cmarkextensions_export.h
|
84
|
+
DESTINATION include
|
85
|
+
)
|
86
|
+
|
87
|
+
install(EXPORT cmark-gfmextensions DESTINATION lib${LIB_SUFFIX}/cmake-gfmextensions)
|
73
88
|
endif()
|
74
89
|
|
75
90
|
# Feature tests
|
@@ -152,7 +152,7 @@ static cmark_node *www_match(cmark_parser *parser, cmark_node *parent,
|
|
152
152
|
|
153
153
|
size_t link_end;
|
154
154
|
|
155
|
-
if (max_rewind > 0 && strchr("*_~(
|
155
|
+
if (max_rewind > 0 && strchr("*_~(", data[-1]) == NULL &&
|
156
156
|
!cmark_isspace(data[-1]))
|
157
157
|
return 0;
|
158
158
|
|
@@ -11,6 +11,12 @@ extern "C" {
|
|
11
11
|
CMARKEXTENSIONS_EXPORT
|
12
12
|
int core_extensions_registration(cmark_plugin *plugin);
|
13
13
|
|
14
|
+
CMARKEXTENSIONS_EXPORT
|
15
|
+
uint16_t cmarkextensions_get_table_columns(cmark_node *node);
|
16
|
+
|
17
|
+
CMARKEXTENSIONS_EXPORT
|
18
|
+
uint8_t *cmarkextensions_get_table_alignments(cmark_node *node);
|
19
|
+
|
14
20
|
#ifdef __cplusplus
|
15
21
|
}
|
16
22
|
#endif
|
@@ -9,7 +9,7 @@
|
|
9
9
|
#include "strikethrough.h"
|
10
10
|
#include "table.h"
|
11
11
|
|
12
|
-
|
12
|
+
cmark_node_type CMARK_NODE_TABLE, CMARK_NODE_TABLE_ROW,
|
13
13
|
CMARK_NODE_TABLE_CELL;
|
14
14
|
|
15
15
|
typedef struct {
|
@@ -644,3 +644,17 @@ cmark_syntax_extension *create_table_extension(void) {
|
|
644
644
|
|
645
645
|
return self;
|
646
646
|
}
|
647
|
+
|
648
|
+
uint16_t cmarkextensions_get_table_columns(cmark_node *node) {
|
649
|
+
if (node->type != CMARK_NODE_TABLE)
|
650
|
+
return 0;
|
651
|
+
|
652
|
+
return ((node_table *)node->as.opaque)->n_columns;
|
653
|
+
}
|
654
|
+
|
655
|
+
uint8_t *cmarkextensions_get_table_alignments(cmark_node *node) {
|
656
|
+
if (node->type != CMARK_NODE_TABLE)
|
657
|
+
return 0;
|
658
|
+
|
659
|
+
return ((node_table *)node->as.opaque)->alignments;
|
660
|
+
}
|
@@ -71,10 +71,7 @@ include (GenerateExportHeader)
|
|
71
71
|
add_executable(${PROGRAM} ${PROGRAM_SOURCES})
|
72
72
|
add_compiler_export_flags()
|
73
73
|
|
74
|
-
target_link_libraries(${PROGRAM} libcmark-gfm_static)
|
75
|
-
|
76
|
-
add_dependencies(${PROGRAM} libcmark-gfmextensions_static)
|
77
|
-
target_link_libraries(${PROGRAM} libcmark-gfmextensions_static)
|
74
|
+
target_link_libraries(${PROGRAM} libcmark-gfmextensions_static libcmark-gfm_static)
|
78
75
|
|
79
76
|
# Disable the PUBLIC declarations when compiling the executable:
|
80
77
|
set_target_properties(${PROGRAM} PROPERTIES
|
@@ -100,9 +97,9 @@ if (CMARK_SHARED)
|
|
100
97
|
add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES})
|
101
98
|
# Include minor version and patch level in soname for now.
|
102
99
|
set_target_properties(${LIBRARY} PROPERTIES
|
103
|
-
|
104
|
-
|
105
|
-
|
100
|
+
OUTPUT_NAME "cmark-gfm"
|
101
|
+
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM}
|
102
|
+
VERSION ${PROJECT_VERSION})
|
106
103
|
|
107
104
|
set_property(TARGET ${LIBRARY}
|
108
105
|
APPEND PROPERTY MACOSX_RPATH true)
|
@@ -119,31 +116,21 @@ endif()
|
|
119
116
|
if (CMARK_STATIC)
|
120
117
|
add_library(${STATICLIBRARY} STATIC ${LIBRARY_SOURCES})
|
121
118
|
set_target_properties(${STATICLIBRARY} PROPERTIES
|
122
|
-
|
123
|
-
|
119
|
+
COMPILE_FLAGS -DCMARK_STATIC_DEFINE
|
120
|
+
POSITION_INDEPENDENT_CODE ON)
|
124
121
|
|
125
122
|
if (MSVC)
|
126
|
-
|
127
|
-
|
128
|
-
|
123
|
+
set_target_properties(${STATICLIBRARY} PROPERTIES
|
124
|
+
OUTPUT_NAME "cmark-gfm_static"
|
125
|
+
VERSION ${PROJECT_VERSION})
|
129
126
|
else()
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
endif(MSVC)
|
134
|
-
|
135
|
-
target_link_libraries(cmark-gfm ${CMAKE_DL_LIBS})
|
127
|
+
set_target_properties(${STATICLIBRARY} PROPERTIES
|
128
|
+
OUTPUT_NAME "cmark-gfm"
|
129
|
+
VERSION ${PROJECT_VERSION})
|
130
|
+
endif(MSVC)
|
136
131
|
|
137
132
|
list(APPEND CMARK_INSTALL ${STATICLIBRARY})
|
138
133
|
endif()
|
139
|
-
set_property(TARGET ${LIBRARY}
|
140
|
-
APPEND PROPERTY MACOSX_RPATH true)
|
141
|
-
|
142
|
-
# Avoid name clash between PROGRAM and LIBRARY pdb files.
|
143
|
-
set_target_properties(${LIBRARY} PROPERTIES PDB_NAME cmark-gfm_dll)
|
144
|
-
|
145
|
-
generate_export_header(${LIBRARY}
|
146
|
-
BASE_NAME ${PROJECT_NAME})
|
147
134
|
|
148
135
|
if (MSVC)
|
149
136
|
set_property(TARGET ${PROGRAM}
|
@@ -154,7 +141,7 @@ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
|
154
141
|
|
155
142
|
include (InstallRequiredSystemLibraries)
|
156
143
|
install(TARGETS ${PROGRAM} ${CMARK_INSTALL}
|
157
|
-
EXPORT cmark
|
144
|
+
EXPORT cmark-gfm
|
158
145
|
RUNTIME DESTINATION bin
|
159
146
|
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
160
147
|
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
@@ -167,14 +154,14 @@ if(CMARK_SHARED OR CMARK_STATIC)
|
|
167
154
|
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
168
155
|
|
169
156
|
install(FILES
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
install(EXPORT cmark DESTINATION lib${LIB_SUFFIX}/cmake)
|
157
|
+
cmark.h
|
158
|
+
cmark_extension_api.h
|
159
|
+
${CMAKE_CURRENT_BINARY_DIR}/cmark_export.h
|
160
|
+
${CMAKE_CURRENT_BINARY_DIR}/cmark_version.h
|
161
|
+
DESTINATION include
|
162
|
+
)
|
163
|
+
|
164
|
+
install(EXPORT cmark-gfm DESTINATION lib${LIB_SUFFIX}/cmake-gfm)
|
178
165
|
endif()
|
179
166
|
|
180
167
|
# Feature tests
|
@@ -366,6 +366,11 @@ void cmark_syntax_extension_set_private(cmark_syntax_extension *extension,
|
|
366
366
|
void *priv,
|
367
367
|
cmark_free_func free_func);
|
368
368
|
|
369
|
+
/** See the documentation for 'cmark_syntax_extension'
|
370
|
+
*/
|
371
|
+
CMARK_EXPORT
|
372
|
+
void *cmark_syntax_extension_get_private(cmark_syntax_extension *extension);
|
373
|
+
|
369
374
|
/** See the documentation for 'cmark_syntax_extension'
|
370
375
|
*/
|
371
376
|
CMARK_EXPORT
|
@@ -3,5 +3,6 @@
|
|
3
3
|
|
4
4
|
#define CMARK_VERSION ((@PROJECT_VERSION_MAJOR@ << 24) | (@PROJECT_VERSION_MINOR@ << 16) | (@PROJECT_VERSION_PATCH@ << 8) | @PROJECT_VERSION_GFM@)
|
5
5
|
#define CMARK_VERSION_STRING "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.gfm.@PROJECT_VERSION_GFM@"
|
6
|
+
#define CMARK_GFM_VERSION @PROJECT_VERSION_GFM@
|
6
7
|
|
7
8
|
#endif
|
@@ -128,7 +128,7 @@ bufsize_t _scan_liberal_html_tag(const unsigned char *p)
|
|
128
128
|
const unsigned char *marker = NULL;
|
129
129
|
const unsigned char *start = p;
|
130
130
|
/*!re2c
|
131
|
-
|
131
|
+
[^\x00]+ [>] { return (bufsize_t)(p - start); }
|
132
132
|
* { return 0; }
|
133
133
|
*/
|
134
134
|
}
|
@@ -167,7 +167,7 @@ bufsize_t _scan_html_block_end_1(const unsigned char *p)
|
|
167
167
|
const unsigned char *marker = NULL;
|
168
168
|
const unsigned char *start = p;
|
169
169
|
/*!re2c
|
170
|
-
|
170
|
+
[^\x00]* [<] [/] ('script'|'pre'|'style') [>] { return (bufsize_t)(p - start); }
|
171
171
|
* { return 0; }
|
172
172
|
*/
|
173
173
|
}
|
@@ -178,7 +178,7 @@ bufsize_t _scan_html_block_end_2(const unsigned char *p)
|
|
178
178
|
const unsigned char *marker = NULL;
|
179
179
|
const unsigned char *start = p;
|
180
180
|
/*!re2c
|
181
|
-
|
181
|
+
[^\x00]* '-->' { return (bufsize_t)(p - start); }
|
182
182
|
* { return 0; }
|
183
183
|
*/
|
184
184
|
}
|
@@ -189,7 +189,7 @@ bufsize_t _scan_html_block_end_3(const unsigned char *p)
|
|
189
189
|
const unsigned char *marker = NULL;
|
190
190
|
const unsigned char *start = p;
|
191
191
|
/*!re2c
|
192
|
-
|
192
|
+
[^\x00]* '?>' { return (bufsize_t)(p - start); }
|
193
193
|
* { return 0; }
|
194
194
|
*/
|
195
195
|
}
|
@@ -200,7 +200,7 @@ bufsize_t _scan_html_block_end_4(const unsigned char *p)
|
|
200
200
|
const unsigned char *marker = NULL;
|
201
201
|
const unsigned char *start = p;
|
202
202
|
/*!re2c
|
203
|
-
|
203
|
+
[^\x00]* '>' { return (bufsize_t)(p - start); }
|
204
204
|
* { return 0; }
|
205
205
|
*/
|
206
206
|
}
|
@@ -211,7 +211,7 @@ bufsize_t _scan_html_block_end_5(const unsigned char *p)
|
|
211
211
|
const unsigned char *marker = NULL;
|
212
212
|
const unsigned char *start = p;
|
213
213
|
/*!re2c
|
214
|
-
|
214
|
+
[^\x00]* ']]>' { return (bufsize_t)(p - start); }
|
215
215
|
* { return 0; }
|
216
216
|
*/
|
217
217
|
}
|
@@ -118,6 +118,10 @@ void cmark_syntax_extension_set_private(cmark_syntax_extension *extension,
|
|
118
118
|
extension->free_function = free_func;
|
119
119
|
}
|
120
120
|
|
121
|
+
void *cmark_syntax_extension_get_private(cmark_syntax_extension *extension) {
|
122
|
+
return extension->priv;
|
123
|
+
}
|
124
|
+
|
121
125
|
void cmark_syntax_extension_set_opaque_free_func(cmark_syntax_extension *extension,
|
122
126
|
cmark_opaque_free_func func) {
|
123
127
|
extension->opaque_free_func = func;
|
data/lib/commonmarker/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonmarker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-enum
|