commonmarker 0.14.14 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/commonmarker.gemspec +2 -0
- data/ext/commonmarker/cmark/Makefile +13 -8
- data/ext/commonmarker/cmark/README.md +18 -11
- data/ext/commonmarker/cmark/api_test/CMakeLists.txt +1 -1
- data/ext/commonmarker/cmark/extensions/CMakeLists.txt +7 -7
- data/ext/commonmarker/cmark/extensions/ext_scanners.c +562 -3
- data/ext/commonmarker/cmark/extensions/ext_scanners.h +6 -0
- data/ext/commonmarker/cmark/extensions/ext_scanners.re +32 -0
- data/ext/commonmarker/cmark/extensions/table.c +87 -215
- data/ext/commonmarker/cmark/man/CMakeLists.txt +2 -2
- data/ext/commonmarker/cmark/man/make_man_page.py +3 -3
- data/ext/commonmarker/cmark/man/man1/{cmark.1 → cmark-gfm.1} +10 -4
- data/ext/commonmarker/cmark/man/man3/{cmark.3 → cmark-gfm.3} +2 -2
- data/ext/commonmarker/cmark/src/CMakeLists.txt +15 -15
- data/ext/commonmarker/cmark/src/buffer.c +5 -1
- data/ext/commonmarker/cmark/src/cmark.c +6 -2
- data/ext/commonmarker/cmark/src/cmark.h +1 -1
- data/ext/commonmarker/cmark/src/cmark_extension_api.h +0 -2
- data/ext/commonmarker/cmark/src/commonmark.c +1 -2
- data/ext/commonmarker/cmark/src/inlines.c +1 -1
- data/ext/commonmarker/cmark/src/libcmark-gfm.pc.in +10 -0
- data/ext/commonmarker/cmark/src/main.c +2 -2
- data/ext/commonmarker/cmark/src/render.c +15 -0
- data/ext/commonmarker/cmark/test/CMakeLists.txt +5 -5
- data/ext/commonmarker/cmark/test/cmark.py +2 -2
- data/ext/commonmarker/cmark/test/extensions.txt +24 -3
- data/ext/commonmarker/cmark/test/roundtrip_tests.py +1 -0
- data/ext/commonmarker/cmark/test/spec.txt +84 -15
- data/ext/commonmarker/cmark/test/spec_tests.py +9 -8
- data/ext/commonmarker/cmark/tools/Dockerfile +36 -0
- data/ext/commonmarker/extconf.rb +5 -5
- data/lib/commonmarker/node/inspect.rb +59 -0
- data/lib/commonmarker/node.rb +3 -0
- data/lib/commonmarker/version.rb +1 -1
- data/test/test_node.rb +8 -0
- data/test/test_spec.rb +1 -1
- metadata +10 -6
- data/ext/commonmarker/cmark/src/libcmark.pc.in +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 828326c7f9a66b8e7caa67ea4bd8eae887f349c2
|
|
4
|
+
data.tar.gz: b6036c31b529bc7fe63d80217aa6931ce51b126d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 230cdde9843b531264c4346ea420b1aaa766713bd26b43a73531d2e263345d088779866d5bd1d6b1ae5190fbc642ed74bda1506198762b5ea3d7da20742dbb18
|
|
7
|
+
data.tar.gz: cd36ec10001cc1df2219e371b5bd02d27965558ce68cdfa17199c9cbc093cccc988a1b4845772434aa9439978b2b09ec454e2e6b8ec94b9569f0c990a468da12
|
data/README.md
CHANGED
|
@@ -35,7 +35,7 @@ The second argument is optional--[see below](#options) for more information.
|
|
|
35
35
|
|
|
36
36
|
### Generating a document
|
|
37
37
|
|
|
38
|
-
You can also parse a string to receive a `Document` node. You can
|
|
38
|
+
You can also parse a string to receive a `Document` node. You can then print that node to HTML, iterate over the children, and other fun node stuff. For example:
|
|
39
39
|
|
|
40
40
|
``` ruby
|
|
41
41
|
require 'commonmarker'
|
data/commonmarker.gemspec
CHANGED
|
@@ -15,18 +15,18 @@ BENCHSAMPLES=$(wildcard $(BENCHDIR)/samples/*.md)
|
|
|
15
15
|
BENCHFILE=$(BENCHDIR)/benchinput.md
|
|
16
16
|
ALLTESTS=alltests.md
|
|
17
17
|
NUMRUNS?=20
|
|
18
|
-
CMARK=$(BUILDDIR)/src/cmark
|
|
18
|
+
CMARK=$(BUILDDIR)/src/cmark-gfm
|
|
19
19
|
PROG?=$(CMARK)
|
|
20
20
|
VERSION?=$(SPECVERSION)
|
|
21
21
|
RELEASE?=CommonMark-$(VERSION)
|
|
22
22
|
INSTALL_PREFIX?=/usr/local
|
|
23
23
|
CLANG_CHECK?=clang-check
|
|
24
|
-
CLANG_FORMAT=clang-format -style llvm -sort-includes=0 -i
|
|
24
|
+
CLANG_FORMAT=clang-format-3.5 -style llvm -sort-includes=0 -i
|
|
25
25
|
AFL_PATH?=/usr/local/bin
|
|
26
26
|
|
|
27
|
-
.PHONY: all cmake_build leakcheck clean fuzztest test debug ubsan asan mingw archive newbench bench format update-spec afl clang-check
|
|
27
|
+
.PHONY: all cmake_build leakcheck clean fuzztest test debug ubsan asan mingw archive newbench bench format update-spec afl clang-check docker
|
|
28
28
|
|
|
29
|
-
all: cmake_build man/man3/cmark.3
|
|
29
|
+
all: cmake_build man/man3/cmark-gfm.3
|
|
30
30
|
|
|
31
31
|
$(CMARK): cmake_build
|
|
32
32
|
|
|
@@ -80,6 +80,7 @@ afl:
|
|
|
80
80
|
-i test/afl_test_cases \
|
|
81
81
|
-o test/afl_results \
|
|
82
82
|
-x test/afl_dictionary \
|
|
83
|
+
$(AFL_OPTIONS) \
|
|
83
84
|
-t 100 \
|
|
84
85
|
$(CMARK) -e table -e strikethrough -e autolink -e tagfilter $(CMARK_OPTS)
|
|
85
86
|
|
|
@@ -92,7 +93,7 @@ mingw:
|
|
|
92
93
|
cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$(MINGW_INSTALLDIR) ;\
|
|
93
94
|
$(MAKE) && $(MAKE) install
|
|
94
95
|
|
|
95
|
-
man/man3/cmark.3: src/cmark.h | $(CMARK)
|
|
96
|
+
man/man3/cmark-gfm.3: src/cmark.h | $(CMARK)
|
|
96
97
|
python man/make_man_page.py $< > $@ \
|
|
97
98
|
|
|
98
99
|
archive:
|
|
@@ -131,7 +132,7 @@ $(EXTDIR)/ext_scanners.c: $(EXTDIR)/ext_scanners.re
|
|
|
131
132
|
esac
|
|
132
133
|
re2c --case-insensitive -b -i --no-generation-date -8 \
|
|
133
134
|
--encoding-policy substitute -o $@ $<
|
|
134
|
-
clang-format -style llvm -i $@
|
|
135
|
+
clang-format-3.5 -style llvm -i $@
|
|
135
136
|
|
|
136
137
|
# We include entities.inc in the repository, so normally this
|
|
137
138
|
# doesn't need to be regenerated:
|
|
@@ -156,7 +157,7 @@ $(ALLTESTS): $(SPEC) $(EXTENSIONS_SPEC)
|
|
|
156
157
|
leakcheck: $(ALLTESTS)
|
|
157
158
|
for format in html man xml latex commonmark; do \
|
|
158
159
|
for opts in "" "--smart" "--normalize"; do \
|
|
159
|
-
echo "cmark -t $$format -e table -e strikethrough -e autolink -e tagfilter $$opts" ; \
|
|
160
|
+
echo "cmark-gfm -t $$format -e table -e strikethrough -e autolink -e tagfilter $$opts" ; \
|
|
160
161
|
valgrind -q --leak-check=full --dsymutil=yes --suppressions=suppressions --error-exitcode=1 $(PROG) -t $$format -e table -e strikethrough -e autolink -e tagfilter $$opts $(ALLTESTS) >/dev/null || exit 1;\
|
|
161
162
|
done; \
|
|
162
163
|
done;
|
|
@@ -202,7 +203,7 @@ format:
|
|
|
202
203
|
$(CLANG_FORMAT) src/*.c src/*.h api_test/*.c api_test/*.h
|
|
203
204
|
|
|
204
205
|
format-extensions:
|
|
205
|
-
clang-format -style llvm -i extensions/*.c extensions/*.h
|
|
206
|
+
clang-format-3.5 -style llvm -i extensions/*.c extensions/*.h
|
|
206
207
|
|
|
207
208
|
operf: $(CMARK)
|
|
208
209
|
operf $< < $(BENCHFILE) > /dev/null
|
|
@@ -211,3 +212,7 @@ distclean: clean
|
|
|
211
212
|
-rm -rf *.dSYM
|
|
212
213
|
-rm -f README.html
|
|
213
214
|
-rm -rf $(BENCHFILE) $(ALLTESTS) progit
|
|
215
|
+
|
|
216
|
+
docker:
|
|
217
|
+
docker build -t cmark $(CURDIR)/tools
|
|
218
|
+
docker run --privileged -t -i -v $(CURDIR):/src/cmark -w /src/cmark cmark /bin/bash
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
cmark
|
|
2
|
-
|
|
1
|
+
cmark-gfm
|
|
2
|
+
=========
|
|
3
3
|
|
|
4
|
-
[![Build Status]](https://travis-ci.org/
|
|
5
|
-
[![Windows Build Status]](https://ci.appveyor.com/project/
|
|
4
|
+
[![Build Status]](https://travis-ci.org/github/cmark)
|
|
5
|
+
[![Windows Build Status]](https://ci.appveyor.com/project/github/cmark)
|
|
6
6
|
|
|
7
|
-
`cmark` is the C reference implementation of
|
|
8
|
-
rationalized version of Markdown syntax with a
|
|
9
|
-
|
|
10
|
-
[
|
|
7
|
+
`cmark-gfm` is an extended version of the C reference implementation of
|
|
8
|
+
[CommonMark], a rationalized version of Markdown syntax with a spec. This
|
|
9
|
+
repository adds GitHub Flavored Markdown extensions to
|
|
10
|
+
[the upstream implementation], as defined in [the spec].
|
|
11
|
+
|
|
12
|
+
The rest of the README is preserved as-is from the upstream source. Note that
|
|
13
|
+
the library and binaries produced by this fork are suffixed with `-gfm` in
|
|
14
|
+
order to distinguish them from the upstream.
|
|
15
|
+
|
|
16
|
+
---
|
|
11
17
|
|
|
12
18
|
It provides a shared library (`libcmark`) with functions for parsing
|
|
13
19
|
CommonMark documents to an abstract syntax tree (AST), manipulating
|
|
@@ -178,11 +184,12 @@ Nick Wellnhofer contributed many improvements, including
|
|
|
178
184
|
most of the C library's API and its test harness.
|
|
179
185
|
|
|
180
186
|
[benchmarks]: benchmarks.md
|
|
181
|
-
[the spec]:
|
|
187
|
+
[the spec]: https://github.github.com/gfm/
|
|
188
|
+
[the upstream implementation]: https://github.com/jgm/cmark
|
|
182
189
|
[CommonMark]: http://commonmark.org
|
|
183
190
|
[cmake]: http://www.cmake.org/download/
|
|
184
191
|
[re2c]: http://re2c.org
|
|
185
192
|
[commonmark.js]: https://github.com/jgm/commonmark.js
|
|
186
|
-
[Build Status]: https://img.shields.io/travis/
|
|
187
|
-
[Windows Build Status]: https://ci.appveyor.com/api/projects/status/
|
|
193
|
+
[Build Status]: https://img.shields.io/travis/github/cmark/master.svg?style=flat
|
|
194
|
+
[Windows Build Status]: https://ci.appveyor.com/api/projects/status/wv7ifhqhv5itm3d5?svg=true
|
|
188
195
|
[american fuzzy lop]: http://lcamtuf.coredump.cx/afl/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 2.8)
|
|
2
|
-
set(LIBRARY "
|
|
3
|
-
set(STATICLIBRARY "
|
|
2
|
+
set(LIBRARY "libcmark-gfmextensions")
|
|
3
|
+
set(STATICLIBRARY "libcmark-gfmextensions_static")
|
|
4
4
|
set(LIBRARY_SOURCES
|
|
5
5
|
core-extensions.c
|
|
6
6
|
table.c
|
|
@@ -38,7 +38,7 @@ if (CMARK_SHARED)
|
|
|
38
38
|
add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES})
|
|
39
39
|
|
|
40
40
|
set_target_properties(${LIBRARY} PROPERTIES
|
|
41
|
-
OUTPUT_NAME "
|
|
41
|
+
OUTPUT_NAME "cmark-gfmextensions"
|
|
42
42
|
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
|
|
43
43
|
VERSION ${PROJECT_VERSION})
|
|
44
44
|
|
|
@@ -46,10 +46,10 @@ if (CMARK_SHARED)
|
|
|
46
46
|
APPEND PROPERTY MACOSX_RPATH true)
|
|
47
47
|
|
|
48
48
|
# Avoid name clash between PROGRAM and LIBRARY pdb files.
|
|
49
|
-
set_target_properties(${LIBRARY} PROPERTIES PDB_NAME
|
|
49
|
+
set_target_properties(${LIBRARY} PROPERTIES PDB_NAME cmark-gfmextensions_dll)
|
|
50
50
|
|
|
51
51
|
list(APPEND CMARK_INSTALL ${LIBRARY})
|
|
52
|
-
target_link_libraries(${LIBRARY} libcmark)
|
|
52
|
+
target_link_libraries(${LIBRARY} libcmark-gfm)
|
|
53
53
|
|
|
54
54
|
generate_export_header(${LIBRARY} BASE_NAME cmarkextensions)
|
|
55
55
|
endif()
|
|
@@ -63,11 +63,11 @@ if (CMARK_STATIC)
|
|
|
63
63
|
|
|
64
64
|
if (MSVC)
|
|
65
65
|
set_target_properties(${STATICLIBRARY} PROPERTIES
|
|
66
|
-
OUTPUT_NAME "
|
|
66
|
+
OUTPUT_NAME "cmark-gfmextensions_static"
|
|
67
67
|
VERSION ${PROJECT_VERSION})
|
|
68
68
|
else()
|
|
69
69
|
set_target_properties(${STATICLIBRARY} PROPERTIES
|
|
70
|
-
OUTPUT_NAME "
|
|
70
|
+
OUTPUT_NAME "cmark-gfmextensions"
|
|
71
71
|
VERSION ${PROJECT_VERSION})
|
|
72
72
|
endif(MSVC)
|
|
73
73
|
endif()
|