rmultimarkdown 6.4.0.3 → 6.7.0.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 +5 -5
- data/Rakefile +7 -13
- data/ext/Makefile +67 -55
- data/ext/extconf.rb +8 -6
- data/ext/mmd/aho-corasick.c +8 -8
- data/ext/mmd/aho-corasick.h +3 -3
- data/ext/mmd/argtable3.c +6537 -0
- data/ext/mmd/argtable3.h +273 -0
- data/ext/mmd/beamer.c +12 -1
- data/ext/mmd/char.c +120 -27
- data/ext/mmd/char.h +23 -23
- data/ext/mmd/critic_markup.c +7 -6
- data/ext/mmd/d_string.c +88 -32
- data/ext/mmd/{include/d_string.h → d_string.h} +50 -38
- data/ext/mmd/epub.c +36 -12
- data/ext/mmd/epub.h +2 -2
- data/ext/mmd/file.c +50 -40
- data/ext/mmd/file.h +2 -2
- data/ext/mmd/html.c +164 -99
- data/ext/mmd/html.h +3 -2
- data/ext/mmd/i18n.h +15 -11
- data/ext/mmd/itmz-lexer.c +16978 -0
- data/ext/mmd/itmz-lexer.h +132 -0
- data/ext/mmd/itmz-parser.c +1189 -0
- data/ext/mmd/itmz-parser.h +11 -0
- data/ext/mmd/itmz-reader.c +388 -0
- data/ext/mmd/itmz-reader.h +111 -0
- data/ext/mmd/itmz.c +567 -0
- data/ext/mmd/itmz.h +117 -0
- data/ext/mmd/latex.c +93 -41
- data/ext/mmd/lexer.c +3506 -2774
- data/ext/mmd/{include/libMultiMarkdown.h → libMultiMarkdown.h} +49 -2
- data/ext/mmd/main.c +612 -0
- data/ext/mmd/memoir.c +4 -1
- data/ext/mmd/miniz.c +6905 -6680
- data/ext/mmd/miniz.h +456 -476
- data/ext/mmd/mmd.c +399 -94
- data/ext/mmd/mmd.h +25 -25
- data/ext/mmd/object_pool.h +3 -3
- data/ext/mmd/opendocument-content.c +137 -69
- data/ext/mmd/opendocument-content.h +2 -2
- data/ext/mmd/opendocument.c +35 -14
- data/ext/mmd/opendocument.h +2 -2
- data/ext/mmd/opml-lexer.c +259 -637
- data/ext/mmd/opml-lexer.h +1 -17
- data/ext/mmd/opml-parser.c +194 -188
- data/ext/mmd/opml-reader.c +72 -142
- data/ext/mmd/opml-reader.h +1 -1
- data/ext/mmd/opml.c +13 -13
- data/ext/mmd/opml.h +1 -1
- data/ext/mmd/parser.c +1623 -1244
- data/ext/mmd/rng.c +8 -3
- data/ext/mmd/scanners.c +66625 -103198
- data/ext/mmd/scanners.h +1 -0
- data/ext/mmd/stack.c +62 -20
- data/ext/mmd/stack.h +10 -21
- data/ext/mmd/textbundle.c +23 -7
- data/ext/mmd/textbundle.h +2 -2
- data/ext/mmd/token.c +42 -16
- data/ext/mmd/{include/token.h → token.h} +22 -8
- data/ext/mmd/token_pairs.c +0 -16
- data/ext/mmd/transclude.c +6 -2
- data/ext/mmd/uthash.h +745 -745
- data/ext/mmd/version.h +8 -8
- data/ext/mmd/writer.c +225 -63
- data/ext/mmd/writer.h +50 -36
- data/ext/mmd/xml.c +855 -0
- data/ext/mmd/xml.h +134 -0
- data/ext/mmd/zip.c +71 -4
- data/ext/mmd/zip.h +7 -1
- data/ext/ruby_multi_markdown.c +9 -18
- data/lib/multi_markdown/version.rb +1 -1
- data/lib/multi_markdown.bundle +0 -0
- data/rmultimarkdown.gemspec +0 -2
- metadata +22 -28
- data/ext/mmd/char_lookup.c +0 -212
data/ext/mmd/xml.h
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
MultiMarkdown -- Lightweight markup processor to produce HTML, LaTeX, and more.
|
|
4
|
+
|
|
5
|
+
@file xml.h
|
|
6
|
+
|
|
7
|
+
@brief Utilities to help parse XML files
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@author Fletcher T. Penney
|
|
11
|
+
@bug
|
|
12
|
+
|
|
13
|
+
**/
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
|
|
17
|
+
Copyright © 2016 - 2019 Fletcher T. Penney.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
The `MultiMarkdown 6` project is released under the MIT License..
|
|
21
|
+
|
|
22
|
+
GLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:
|
|
23
|
+
|
|
24
|
+
https://github.com/fletcher/MultiMarkdown-4/
|
|
25
|
+
|
|
26
|
+
MMD 4 is released under both the MIT License and GPL.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
CuTest is released under the zlib/libpng license. See CuTest.c for the
|
|
30
|
+
text of the license.
|
|
31
|
+
|
|
32
|
+
uthash library:
|
|
33
|
+
Copyright (c) 2005-2016, Troy D. Hanson
|
|
34
|
+
|
|
35
|
+
Licensed under Revised BSD license
|
|
36
|
+
|
|
37
|
+
miniz library:
|
|
38
|
+
Copyright 2013-2014 RAD Game Tools and Valve Software
|
|
39
|
+
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
|
|
40
|
+
|
|
41
|
+
Licensed under the MIT license
|
|
42
|
+
|
|
43
|
+
argtable3 library:
|
|
44
|
+
Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
|
|
45
|
+
<sheitmann@users.sourceforge.net>
|
|
46
|
+
All rights reserved.
|
|
47
|
+
|
|
48
|
+
Licensed under the Revised BSD License
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## The MIT License ##
|
|
52
|
+
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
54
|
+
a copy of this software and associated documentation files (the
|
|
55
|
+
"Software"), to deal in the Software without restriction, including
|
|
56
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
57
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
58
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
59
|
+
the following conditions:
|
|
60
|
+
|
|
61
|
+
The above copyright notice and this permission notice shall be
|
|
62
|
+
included in all copies or substantial portions of the Software.
|
|
63
|
+
|
|
64
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
65
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
66
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
67
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
68
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
69
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
70
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Revised BSD License ##
|
|
74
|
+
|
|
75
|
+
Redistribution and use in source and binary forms, with or without
|
|
76
|
+
modification, are permitted provided that the following conditions are
|
|
77
|
+
met:
|
|
78
|
+
* Redistributions of source code must retain the above copyright
|
|
79
|
+
notice, this list of conditions and the following disclaimer.
|
|
80
|
+
* Redistributions in binary form must reproduce the above
|
|
81
|
+
copyright notice, this list of conditions and the following
|
|
82
|
+
disclaimer in the documentation and/or other materials provided
|
|
83
|
+
with the distribution.
|
|
84
|
+
* Neither the name of the <organization> nor the
|
|
85
|
+
names of its contributors may be used to endorse or promote
|
|
86
|
+
products derived from this software without specific prior
|
|
87
|
+
written permission.
|
|
88
|
+
|
|
89
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
90
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
91
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
92
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT
|
|
93
|
+
HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
94
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
95
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR
|
|
96
|
+
PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
97
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
98
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
99
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
#ifndef XML_MULTIMARKDOWN_H
|
|
106
|
+
#define XML_MULTIMARKDOWN_H
|
|
107
|
+
|
|
108
|
+
/// skip through whitespace
|
|
109
|
+
size_t xml_scan_wsnl(const char * c);
|
|
110
|
+
|
|
111
|
+
/// scan generic attribute (including quoted value if present)
|
|
112
|
+
size_t xml_scan_attribute_name(const char * c);
|
|
113
|
+
|
|
114
|
+
/// scan until start of value, if present
|
|
115
|
+
size_t xml_scan_until_value(const char * c);
|
|
116
|
+
|
|
117
|
+
/// scan value
|
|
118
|
+
size_t xml_scan_value(const char * c);
|
|
119
|
+
|
|
120
|
+
/// Does the string include encoded newline?
|
|
121
|
+
size_t xml_scan_encoded_newline(const char * c, size_t len);
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
/// Decode XML encoded text and print to DString
|
|
125
|
+
void print_xml_as_text(DString * out, const char * source, size_t start, size_t len);
|
|
126
|
+
|
|
127
|
+
/// Parse XML text for attribute and value
|
|
128
|
+
size_t xml_extract_attribute(const char * source, size_t start, char ** attr, char ** value);
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
/// Extract attribute with specified name
|
|
132
|
+
char * xml_extract_named_attribute(const char * source, size_t start, const char * name);
|
|
133
|
+
|
|
134
|
+
#endif
|
data/ext/mmd/zip.c
CHANGED
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
*/
|
|
103
103
|
|
|
104
|
+
#include "d_string.h"
|
|
104
105
|
#include "zip.h"
|
|
105
106
|
|
|
106
107
|
#include <dirent.h>
|
|
@@ -195,16 +196,82 @@ mz_bool unzip_archive_to_path(mz_zip_archive * pZip, const char * path) {
|
|
|
195
196
|
|
|
196
197
|
// Unzip archive (as plain binary data) to specified file path
|
|
197
198
|
mz_bool unzip_data_to_path(const void * data, size_t size, const char * path) {
|
|
198
|
-
mz_zip_archive pZip;
|
|
199
|
-
memset(
|
|
199
|
+
mz_zip_archive * pZip = malloc(sizeof(mz_zip_archive));
|
|
200
|
+
memset(pZip, 0, sizeof(mz_zip_archive));
|
|
200
201
|
|
|
201
|
-
mz_bool status = mz_zip_reader_init_mem(
|
|
202
|
+
mz_bool status = mz_zip_reader_init_mem(pZip, data, size, 0);
|
|
202
203
|
|
|
203
204
|
if (!status) {
|
|
204
205
|
fprintf(stderr, "mz_zip_reader_init_mem() failed.\n");
|
|
206
|
+
mz_zip_reader_end(pZip);
|
|
205
207
|
return status;
|
|
206
208
|
}
|
|
207
209
|
|
|
208
|
-
|
|
210
|
+
status = unzip_archive_to_path(pZip, path);
|
|
211
|
+
mz_zip_reader_end(pZip);
|
|
212
|
+
free(pZip);
|
|
213
|
+
return status;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
// Extract single file from archive
|
|
218
|
+
mz_bool unzip_file_from_archive(mz_zip_archive * pZip, const char * filename, DString * destination) {
|
|
219
|
+
mz_uint32 index;
|
|
220
|
+
mz_zip_archive_file_stat pStat;
|
|
221
|
+
mz_bool status;
|
|
222
|
+
|
|
223
|
+
int result = mz_zip_reader_locate_file_v2(pZip, filename, NULL, 0, &index);
|
|
224
|
+
|
|
225
|
+
if (result == -1) {
|
|
226
|
+
// Failed
|
|
227
|
+
return 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
mz_zip_reader_file_stat(pZip, index, &pStat);
|
|
231
|
+
unsigned long long size = pStat.m_uncomp_size + 1; // Allow for null terminator in case this is text
|
|
232
|
+
|
|
233
|
+
if (destination->currentStringBufferSize < size) {
|
|
234
|
+
// Buffer to small
|
|
235
|
+
free(destination->str);
|
|
236
|
+
destination->str = malloc((unsigned long)size);
|
|
237
|
+
destination->currentStringBufferSize = (size_t)size;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
status = mz_zip_reader_extract_to_mem(pZip, index, destination->str, destination->currentStringBufferSize, 0);
|
|
241
|
+
destination->currentStringLength = (size_t)size - 1;
|
|
242
|
+
destination->str[destination->currentStringLength] = '\0';
|
|
243
|
+
|
|
244
|
+
if (!status) {
|
|
245
|
+
fprintf(stderr, "mz_zip_reader_extract_to_mem() failed.\n");
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return status;
|
|
209
249
|
}
|
|
210
250
|
|
|
251
|
+
|
|
252
|
+
// Extract single file from archive
|
|
253
|
+
mz_bool unzip_file_from_data(const void * data, size_t size, const char * filename, DString * destination) {
|
|
254
|
+
mz_zip_archive * pZip = malloc(sizeof(mz_zip_archive));
|
|
255
|
+
memset(pZip, 0, sizeof(mz_zip_archive));
|
|
256
|
+
|
|
257
|
+
mz_bool status = mz_zip_reader_init_mem(pZip, data, size, 0);
|
|
258
|
+
|
|
259
|
+
if (!status) {
|
|
260
|
+
fprintf(stderr, "mz_zip_reader_init_mem() failed.\n");
|
|
261
|
+
mz_zip_reader_end(pZip);
|
|
262
|
+
return status;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
status = mz_zip_validate_archive(pZip, 0);
|
|
266
|
+
|
|
267
|
+
if (!status) {
|
|
268
|
+
fprintf(stderr, "mz_zip_validate_archive failed.\n");
|
|
269
|
+
mz_zip_reader_end(pZip);
|
|
270
|
+
return status;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
status = unzip_file_from_archive(pZip, filename, destination);
|
|
274
|
+
mz_zip_reader_end(pZip);
|
|
275
|
+
free(pZip);
|
|
276
|
+
return status;
|
|
277
|
+
}
|
data/ext/mmd/zip.h
CHANGED
|
@@ -114,7 +114,13 @@ void zip_new_archive(mz_zip_archive * pZip);
|
|
|
114
114
|
mz_bool unzip_archive_to_path(mz_zip_archive * pZip, const char * path);
|
|
115
115
|
|
|
116
116
|
// Unzip archive (as plain binary data) to specified file path
|
|
117
|
-
mz_bool unzip_data_to_path(const void * data, size_t
|
|
117
|
+
mz_bool unzip_data_to_path(const void * data, size_t size, const char * path);
|
|
118
|
+
|
|
119
|
+
// Extract single file from archive
|
|
120
|
+
mz_bool unzip_file_from_archive(mz_zip_archive * pZip, const char * filename, DString * destination);
|
|
121
|
+
|
|
122
|
+
// Extract single file from archive
|
|
123
|
+
mz_bool unzip_file_from_data(const void * data, size_t size, const char * filename, DString * file);
|
|
118
124
|
|
|
119
125
|
|
|
120
126
|
#endif
|
data/ext/ruby_multi_markdown.c
CHANGED
|
@@ -5,18 +5,6 @@
|
|
|
5
5
|
#include "mmd.h"
|
|
6
6
|
#include "d_string.h"
|
|
7
7
|
|
|
8
|
-
// Tries to convert a C string into an encoded ruby String
|
|
9
|
-
static VALUE encoded_str_new2(char *str, char *encoding) {
|
|
10
|
-
VALUE result = rb_str_new2(str);
|
|
11
|
-
|
|
12
|
-
int enc = rb_enc_find_index(encoding);
|
|
13
|
-
if (enc > 0) {
|
|
14
|
-
rb_enc_associate_index(result, enc);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
8
|
static VALUE rb_cMultiMarkdown;
|
|
21
9
|
|
|
22
10
|
static int get_exts(VALUE self) {
|
|
@@ -70,11 +58,11 @@ static void free_engine_manager(engine_manager* manager) {
|
|
|
70
58
|
free(manager);
|
|
71
59
|
}
|
|
72
60
|
|
|
73
|
-
static VALUE rb_multimarkdown_allocate(VALUE
|
|
61
|
+
static VALUE rb_multimarkdown_allocate(VALUE klass) {
|
|
74
62
|
engine_manager *manager = malloc(sizeof(engine_manager));
|
|
75
63
|
manager->mmd_engine = NULL;
|
|
76
64
|
|
|
77
|
-
return Data_Wrap_Struct(
|
|
65
|
+
return Data_Wrap_Struct(klass, NULL, free_engine_manager, manager);
|
|
78
66
|
}
|
|
79
67
|
|
|
80
68
|
static VALUE rb_multimarkdown_start_engine(VALUE self, VALUE text) {
|
|
@@ -110,6 +98,9 @@ static VALUE rb_multimarkdown_set_language(VALUE self, VALUE language) {
|
|
|
110
98
|
else if (rb_funcall(language_s, rb_intern("=="), 1, rb_str_new2("fr")) == Qtrue || rb_funcall(language_s, rb_intern("=="), 1, rb_str_new2("french")) == Qtrue) {
|
|
111
99
|
lang = FRENCH;
|
|
112
100
|
}
|
|
101
|
+
else if (rb_funcall(language_s, rb_intern("=="), 1, rb_str_new2("sp")) == Qtrue || rb_funcall(language_s, rb_intern("=="), 1, rb_str_new2("spanish")) == Qtrue) {
|
|
102
|
+
lang = SPANISH;
|
|
103
|
+
}
|
|
113
104
|
else if (rb_funcall(language_s, rb_intern("=="), 1, rb_str_new2("sv")) == Qtrue || rb_funcall(language_s, rb_intern("=="), 1, rb_str_new2("swedish")) == Qtrue) {
|
|
114
105
|
lang = SWEDISH;
|
|
115
106
|
}
|
|
@@ -121,7 +112,7 @@ static VALUE rb_multimarkdown_set_language(VALUE self, VALUE language) {
|
|
|
121
112
|
|
|
122
113
|
static VALUE rb_multimarkdown_to_html(VALUE self) {
|
|
123
114
|
char *html = mmd_engine_convert(get_mmd_engine(self), FORMAT_HTML);
|
|
124
|
-
VALUE result =
|
|
115
|
+
VALUE result = rb_utf8_str_new_cstr(html);
|
|
125
116
|
free(html);
|
|
126
117
|
|
|
127
118
|
return result;
|
|
@@ -129,7 +120,7 @@ static VALUE rb_multimarkdown_to_html(VALUE self) {
|
|
|
129
120
|
|
|
130
121
|
static VALUE rb_multimarkdown_to_latex(VALUE self) {
|
|
131
122
|
char *latex = mmd_engine_convert(get_mmd_engine(self), FORMAT_LATEX);
|
|
132
|
-
VALUE result =
|
|
123
|
+
VALUE result = rb_utf8_str_new_cstr(latex);
|
|
133
124
|
free(latex);
|
|
134
125
|
|
|
135
126
|
return result;
|
|
@@ -137,7 +128,7 @@ static VALUE rb_multimarkdown_to_latex(VALUE self) {
|
|
|
137
128
|
|
|
138
129
|
static VALUE rb_multimarkdown_extract_metadata_keys(VALUE self) {
|
|
139
130
|
char *metadata_keys = mmd_engine_metadata_keys(get_mmd_engine(self));
|
|
140
|
-
VALUE str =
|
|
131
|
+
VALUE str = rb_utf8_str_new_cstr(metadata_keys);
|
|
141
132
|
free(metadata_keys);
|
|
142
133
|
|
|
143
134
|
return rb_funcall(str, rb_intern("split"), 1, rb_str_new2("\n"));
|
|
@@ -148,7 +139,7 @@ static VALUE rb_multimarkdown_extract_metadata_value(VALUE self, VALUE key) {
|
|
|
148
139
|
char *pkey = StringValuePtr(key);
|
|
149
140
|
|
|
150
141
|
char *metadata = mmd_engine_metavalue_for_key(get_mmd_engine(self), pkey);
|
|
151
|
-
VALUE result =
|
|
142
|
+
VALUE result = rb_utf8_str_new_cstr(metadata);
|
|
152
143
|
|
|
153
144
|
return result;
|
|
154
145
|
}
|
data/lib/multi_markdown.bundle
CHANGED
|
Binary file
|
data/rmultimarkdown.gemspec
CHANGED
|
@@ -27,8 +27,6 @@ Gem::Specification.new do |s|
|
|
|
27
27
|
s.description = s.summary
|
|
28
28
|
s.extra_rdoc_files = ['README.md', 'LICENSE']
|
|
29
29
|
|
|
30
|
-
s.add_dependency "bundler"
|
|
31
|
-
|
|
32
30
|
s.files = %w(LICENSE README.md Rakefile rmultimarkdown.gemspec ext/Makefile) + Dir.glob("{bin,lib,test}/**/*") + Dir.glob("{ext}/**/*.{c,h,rb}")
|
|
33
31
|
s.test_files = Dir.glob("{test}/**/*")
|
|
34
32
|
s.executables = "rmultimarkdown"
|
metadata
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rmultimarkdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.7.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Till Schulte-Coerne
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: bundler
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">="
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
27
12
|
description: A MultiMarkdown 6 binding for Ruby
|
|
28
13
|
email:
|
|
29
14
|
- till.schulte-coerne@innoq.com
|
|
@@ -32,8 +17,8 @@ executables:
|
|
|
32
17
|
extensions:
|
|
33
18
|
- ext/extconf.rb
|
|
34
19
|
extra_rdoc_files:
|
|
35
|
-
- README.md
|
|
36
20
|
- LICENSE
|
|
21
|
+
- README.md
|
|
37
22
|
files:
|
|
38
23
|
- LICENSE
|
|
39
24
|
- README.md
|
|
@@ -44,14 +29,16 @@ files:
|
|
|
44
29
|
- ext/extconf.rb
|
|
45
30
|
- ext/mmd/aho-corasick.c
|
|
46
31
|
- ext/mmd/aho-corasick.h
|
|
32
|
+
- ext/mmd/argtable3.c
|
|
33
|
+
- ext/mmd/argtable3.h
|
|
47
34
|
- ext/mmd/beamer.c
|
|
48
35
|
- ext/mmd/beamer.h
|
|
49
36
|
- ext/mmd/char.c
|
|
50
37
|
- ext/mmd/char.h
|
|
51
|
-
- ext/mmd/char_lookup.c
|
|
52
38
|
- ext/mmd/critic_markup.c
|
|
53
39
|
- ext/mmd/critic_markup.h
|
|
54
40
|
- ext/mmd/d_string.c
|
|
41
|
+
- ext/mmd/d_string.h
|
|
55
42
|
- ext/mmd/epub.c
|
|
56
43
|
- ext/mmd/epub.h
|
|
57
44
|
- ext/mmd/file.c
|
|
@@ -59,13 +46,20 @@ files:
|
|
|
59
46
|
- ext/mmd/html.c
|
|
60
47
|
- ext/mmd/html.h
|
|
61
48
|
- ext/mmd/i18n.h
|
|
62
|
-
- ext/mmd/
|
|
63
|
-
- ext/mmd/
|
|
64
|
-
- ext/mmd/
|
|
49
|
+
- ext/mmd/itmz-lexer.c
|
|
50
|
+
- ext/mmd/itmz-lexer.h
|
|
51
|
+
- ext/mmd/itmz-parser.c
|
|
52
|
+
- ext/mmd/itmz-parser.h
|
|
53
|
+
- ext/mmd/itmz-reader.c
|
|
54
|
+
- ext/mmd/itmz-reader.h
|
|
55
|
+
- ext/mmd/itmz.c
|
|
56
|
+
- ext/mmd/itmz.h
|
|
65
57
|
- ext/mmd/latex.c
|
|
66
58
|
- ext/mmd/latex.h
|
|
67
59
|
- ext/mmd/lexer.c
|
|
68
60
|
- ext/mmd/lexer.h
|
|
61
|
+
- ext/mmd/libMultiMarkdown.h
|
|
62
|
+
- ext/mmd/main.c
|
|
69
63
|
- ext/mmd/memoir.c
|
|
70
64
|
- ext/mmd/memoir.h
|
|
71
65
|
- ext/mmd/miniz.c
|
|
@@ -96,6 +90,7 @@ files:
|
|
|
96
90
|
- ext/mmd/textbundle.c
|
|
97
91
|
- ext/mmd/textbundle.h
|
|
98
92
|
- ext/mmd/token.c
|
|
93
|
+
- ext/mmd/token.h
|
|
99
94
|
- ext/mmd/token_pairs.c
|
|
100
95
|
- ext/mmd/token_pairs.h
|
|
101
96
|
- ext/mmd/transclude.c
|
|
@@ -106,6 +101,8 @@ files:
|
|
|
106
101
|
- ext/mmd/version.h
|
|
107
102
|
- ext/mmd/writer.c
|
|
108
103
|
- ext/mmd/writer.h
|
|
104
|
+
- ext/mmd/xml.c
|
|
105
|
+
- ext/mmd/xml.h
|
|
109
106
|
- ext/mmd/zip.c
|
|
110
107
|
- ext/mmd/zip.h
|
|
111
108
|
- ext/ruby_multi_markdown.c
|
|
@@ -119,7 +116,6 @@ files:
|
|
|
119
116
|
homepage: http://github.com/tillsc/multi_markdown
|
|
120
117
|
licenses: []
|
|
121
118
|
metadata: {}
|
|
122
|
-
post_install_message:
|
|
123
119
|
rdoc_options: []
|
|
124
120
|
require_paths:
|
|
125
121
|
- lib
|
|
@@ -134,11 +130,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
134
130
|
- !ruby/object:Gem::Version
|
|
135
131
|
version: '0'
|
|
136
132
|
requirements: []
|
|
137
|
-
|
|
138
|
-
rubygems_version: 2.5.1
|
|
139
|
-
signing_key:
|
|
133
|
+
rubygems_version: 3.6.7
|
|
140
134
|
specification_version: 4
|
|
141
135
|
summary: A MultiMarkdown 6 binding for Ruby
|
|
142
136
|
test_files:
|
|
143
|
-
- test/multi_markdown_test.rb
|
|
144
137
|
- test/extensions_test.rb
|
|
138
|
+
- test/multi_markdown_test.rb
|
data/ext/mmd/char_lookup.c
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more.
|
|
4
|
-
|
|
5
|
-
@file char_lookup.c
|
|
6
|
-
|
|
7
|
-
@brief Create lookup table for char.c
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@author Fletcher T. Penney
|
|
11
|
-
@bug
|
|
12
|
-
|
|
13
|
-
**/
|
|
14
|
-
|
|
15
|
-
/*
|
|
16
|
-
|
|
17
|
-
Copyright © 2016 - 2017 Fletcher T. Penney.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
The `MultiMarkdown 6` project is released under the MIT License..
|
|
21
|
-
|
|
22
|
-
GLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:
|
|
23
|
-
|
|
24
|
-
https://github.com/fletcher/MultiMarkdown-4/
|
|
25
|
-
|
|
26
|
-
MMD 4 is released under both the MIT License and GPL.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
CuTest is released under the zlib/libpng license. See CuTest.c for the text
|
|
30
|
-
of the license.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## The MIT License ##
|
|
34
|
-
|
|
35
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
36
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
37
|
-
in the Software without restriction, including without limitation the rights
|
|
38
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
39
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
40
|
-
furnished to do so, subject to the following conditions:
|
|
41
|
-
|
|
42
|
-
The above copyright notice and this permission notice shall be included in
|
|
43
|
-
all copies or substantial portions of the Software.
|
|
44
|
-
|
|
45
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
46
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
47
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
48
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
49
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
50
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
51
|
-
THE SOFTWARE.
|
|
52
|
-
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
#include <stdlib.h>
|
|
57
|
-
#include <stdio.h>
|
|
58
|
-
|
|
59
|
-
#include "char.h"
|
|
60
|
-
|
|
61
|
-
// Shortcuts to assign values to characters in lookup table
|
|
62
|
-
#define punctuation(x) table[x] |= CHAR_PUNCTUATION
|
|
63
|
-
#define whitespace(x) table[x] |= CHAR_WHITESPACE
|
|
64
|
-
#define alpha(x) table[x] |= CHAR_ALPHA
|
|
65
|
-
#define digit(x) table[x] |= CHAR_DIGIT
|
|
66
|
-
#define line_ending(x) table[x] |= CHAR_LINE_ENDING
|
|
67
|
-
|
|
68
|
-
#define USE_EXTENDED_ASCII_disabled 1
|
|
69
|
-
|
|
70
|
-
int main( int argc, char** argv ) {
|
|
71
|
-
unsigned char table[256] = {0};
|
|
72
|
-
|
|
73
|
-
// Define punctuation
|
|
74
|
-
punctuation('.');
|
|
75
|
-
punctuation('!');
|
|
76
|
-
punctuation('?');
|
|
77
|
-
|
|
78
|
-
punctuation(',');
|
|
79
|
-
punctuation(';');
|
|
80
|
-
punctuation(':');
|
|
81
|
-
|
|
82
|
-
punctuation('"');
|
|
83
|
-
punctuation('\'');
|
|
84
|
-
punctuation('`');
|
|
85
|
-
punctuation('~');
|
|
86
|
-
|
|
87
|
-
punctuation('(');
|
|
88
|
-
punctuation(')');
|
|
89
|
-
punctuation('{');
|
|
90
|
-
punctuation('}');
|
|
91
|
-
punctuation('[');
|
|
92
|
-
punctuation(']');
|
|
93
|
-
|
|
94
|
-
punctuation('#');
|
|
95
|
-
punctuation('$');
|
|
96
|
-
punctuation('%');
|
|
97
|
-
punctuation('+');
|
|
98
|
-
punctuation('-');
|
|
99
|
-
punctuation('=');
|
|
100
|
-
punctuation('<');
|
|
101
|
-
punctuation('>');
|
|
102
|
-
|
|
103
|
-
punctuation('&');
|
|
104
|
-
punctuation('@');
|
|
105
|
-
punctuation('\\');
|
|
106
|
-
punctuation('/');
|
|
107
|
-
punctuation('^');
|
|
108
|
-
|
|
109
|
-
punctuation('*');
|
|
110
|
-
punctuation('_');
|
|
111
|
-
|
|
112
|
-
punctuation('|');
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// Define whitespace
|
|
116
|
-
whitespace(' ');
|
|
117
|
-
whitespace('\t');
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// Define line endings
|
|
121
|
-
line_ending('\n');
|
|
122
|
-
line_ending('\r');
|
|
123
|
-
line_ending('\0'); // Count EOF as line ending
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// Define digits
|
|
127
|
-
for (char i = '0'; i <= '9'; ++i) {
|
|
128
|
-
digit(i);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Define alpha
|
|
132
|
-
for (char i = 'a'; i <= 'z'; ++i) {
|
|
133
|
-
alpha(i);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
for (char i = 'A'; i <= 'Z'; ++i) {
|
|
137
|
-
alpha(i);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// Extended ASCII
|
|
142
|
-
#ifdef USE_EXTENDED_ASCII
|
|
143
|
-
|
|
144
|
-
// Punctuation ranges
|
|
145
|
-
for (int i = 132; i < 138; ++i) {
|
|
146
|
-
punctuation(i);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
for (int i = 145; i < 156; ++i) {
|
|
150
|
-
punctuation(i);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
for (int i = 161; i < 192; ++i) {
|
|
154
|
-
punctuation(i);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
// Alphanumeric ranges
|
|
159
|
-
for (int i = 192; i < 215; ++i) {
|
|
160
|
-
alpha(i);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
for (int i = 216; i < 247; ++i) {
|
|
164
|
-
alpha(i);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
for (int i = 248; i < 256; ++i) {
|
|
168
|
-
alpha(i);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Isolated extended ASCII characters
|
|
172
|
-
for (int i = 128; i < 256; ++i) {
|
|
173
|
-
switch (i) {
|
|
174
|
-
case 128:
|
|
175
|
-
case 130:
|
|
176
|
-
case 139:
|
|
177
|
-
case 215:
|
|
178
|
-
case 247:
|
|
179
|
-
punctuation(i);
|
|
180
|
-
break;
|
|
181
|
-
|
|
182
|
-
case 160:
|
|
183
|
-
whitespace(i);
|
|
184
|
-
break;
|
|
185
|
-
|
|
186
|
-
case 131:
|
|
187
|
-
case 138:
|
|
188
|
-
case 140:
|
|
189
|
-
case 142:
|
|
190
|
-
case 156:
|
|
191
|
-
case 158:
|
|
192
|
-
case 159:
|
|
193
|
-
alpha(i);
|
|
194
|
-
break;
|
|
195
|
-
|
|
196
|
-
default:
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
#endif
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
// Print output as 16 x 16 table
|
|
205
|
-
for (int i = 0; i < 16; ++i) {
|
|
206
|
-
for (int j = 0; j < 16; ++j) {
|
|
207
|
-
fprintf(stdout, "%3d,", table[i * 16 + j]);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
fprintf(stdout, "\n");
|
|
211
|
-
}
|
|
212
|
-
}
|