rdiscount 2.2.7 → 2.2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/BUILDING +2 -2
- data/ext/generate.c +5 -1
- data/ext/gethopt.c +1 -2
- data/ext/rdiscount.c +6 -0
- data/ext/toc.c +5 -1
- data/lib/rdiscount.rb +1 -1
- data/rdiscount.gemspec +1 -1
- data/test/rdiscount_test.rb +17 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5849e19e3928819b5f9a20522e207dfeedfb4f0255eadf474e422955e63d262e
|
4
|
+
data.tar.gz: 280e0da7f264fdf85ae557fb71b260c2716abf6c1487123ab86b3b5907244902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c7214d4b3cff6b03ddb0ae4636f82a9d46c67f3cd3e9958abfd4cff6a107cf42149f2d889578b292ec41d8226fbc0532c1c62fe1db277ccbfa276510fd4b50d
|
7
|
+
data.tar.gz: 90e140816a109a06be1aecb8d2edad72f92b2981eb8e4173ae1ff4c7f931e24029fe473d021976a8b824ea91dc84d8ef53187b3bc01692dccfd6a3c5006b4db4
|
data/BUILDING
CHANGED
@@ -17,7 +17,7 @@ grabbing the discount submodule into the root of the project and then running
|
|
17
17
|
the rake gather task to copy discount source files into the ext/ directory:
|
18
18
|
|
19
19
|
$ git submodule update --init
|
20
|
-
Submodule 'discount' (git
|
20
|
+
Submodule 'discount' (git@github.com:Orc/discount.git) registered for path 'discount'
|
21
21
|
Cloning into discount...
|
22
22
|
$ cd discount
|
23
23
|
$ ./configure.sh
|
@@ -100,7 +100,7 @@ And don't forget to rerun the preexisting tests.
|
|
100
100
|
|
101
101
|
Update the CHANGELOG.
|
102
102
|
|
103
|
-
Update rdiscount.gemspec with the new RDiscount version number
|
103
|
+
Update rdiscount.gemspec with the new RDiscount version number.
|
104
104
|
Also update the VERSION constant in lib/rdiscount.rb.
|
105
105
|
Push that change as the final commit with a message in the format
|
106
106
|
"2.0.7 release".
|
data/ext/generate.c
CHANGED
@@ -180,13 +180,17 @@ Qprintf(MMIOT *f, char *fmt, ...)
|
|
180
180
|
}
|
181
181
|
|
182
182
|
|
183
|
+
static int Qchar_mkd_sta_function_t(const int n, const void* iot) {
|
184
|
+
Qchar(n, iot);
|
185
|
+
}
|
186
|
+
|
183
187
|
/* Qanchor() prints out a suitable-for-id-tag version of a string
|
184
188
|
*/
|
185
189
|
static void
|
186
190
|
Qanchor(struct line *p, MMIOT *f)
|
187
191
|
{
|
188
192
|
mkd_string_to_anchor(T(p->text), S(p->text),
|
189
|
-
|
193
|
+
Qchar_mkd_sta_function_t, f, 1, f);
|
190
194
|
}
|
191
195
|
|
192
196
|
|
data/ext/gethopt.c
CHANGED
data/ext/rdiscount.c
CHANGED
@@ -18,6 +18,7 @@ typedef struct {
|
|
18
18
|
* - MKD_FENCEDCODE: Always set. (For compatibility with RDiscount 2.1.8 and earlier.)
|
19
19
|
* - MKD_GITHUBTAGS: Always set. (For compatibility with RDiscount 2.1.8 and earlier.)
|
20
20
|
* - MKD_NOPANTS: Set unless the "smart" accessor returns true.
|
21
|
+
* - MKD_NOSTYLE: Set unless the "filter_styles" accessor returns true.
|
21
22
|
*
|
22
23
|
* See rb_rdiscount__get_flags() for the detailed implementation.
|
23
24
|
*/
|
@@ -53,6 +54,11 @@ int rb_rdiscount__get_flags(VALUE ruby_obj)
|
|
53
54
|
if ( rb_funcall(ruby_obj, rb_intern("smart"), 0) != Qtrue ) {
|
54
55
|
flags = flags | MKD_NOPANTS;
|
55
56
|
}
|
57
|
+
|
58
|
+
/* The "filter_styles" accessor turns OFF the MKD_NOSTYLE flag. */
|
59
|
+
if ( rb_funcall(ruby_obj, rb_intern("filter_styles"), 0) != Qtrue ) {
|
60
|
+
flags = flags | MKD_NOSTYLE;
|
61
|
+
}
|
56
62
|
|
57
63
|
/* Handle standard flags declared in ACCESSOR_2_FLAG */
|
58
64
|
for ( entry = ACCESSOR_2_FLAG; entry->accessor_name; entry++ ) {
|
data/ext/toc.c
CHANGED
@@ -15,6 +15,10 @@
|
|
15
15
|
#include "markdown.h"
|
16
16
|
#include "amalloc.h"
|
17
17
|
|
18
|
+
static int Csputc_mkd_sta_function_t(const int n, const void* iot) {
|
19
|
+
Csputc(n, iot);
|
20
|
+
}
|
21
|
+
|
18
22
|
/* write an header index
|
19
23
|
*/
|
20
24
|
int
|
@@ -64,7 +68,7 @@ mkd_toc(Document *p, char **doc)
|
|
64
68
|
Csprintf(&res, "%*s<li><a href=\"#", srcp->hnumber, "");
|
65
69
|
mkd_string_to_anchor(T(srcp->text->text),
|
66
70
|
S(srcp->text->text),
|
67
|
-
|
71
|
+
Csputc_mkd_sta_function_t,
|
68
72
|
&res,1,p->ctx);
|
69
73
|
Csprintf(&res, "\">");
|
70
74
|
Csreparse(&res, T(srcp->text->text),
|
data/lib/rdiscount.rb
CHANGED
data/rdiscount.gemspec
CHANGED
data/test/rdiscount_test.rb
CHANGED
@@ -183,10 +183,25 @@ EOS
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def test_that_style_tag_is_not_filtered_by_default
|
186
|
-
rd = RDiscount.new(
|
187
|
-
|
186
|
+
rd = RDiscount.new(<<EOS)
|
187
|
+
Hello
|
188
|
+
<style>
|
189
|
+
p { margin: 5px; }
|
190
|
+
</style>
|
191
|
+
EOS
|
192
|
+
assert_equal "<p>Hello</p>\n\n<style>\np { margin: 5px; }\n</style>\n\n", rd.to_html
|
188
193
|
end
|
189
194
|
|
195
|
+
def test_that_style_tag_is_filtered_with_flag
|
196
|
+
rd = RDiscount.new(<<EOS, :filter_styles)
|
197
|
+
Hello
|
198
|
+
<style>
|
199
|
+
p { margin: 5px; }
|
200
|
+
</style>
|
201
|
+
EOS
|
202
|
+
assert_equal "<p>Hello</p>\n\n\n", rd.to_html
|
203
|
+
end
|
204
|
+
|
190
205
|
def test_that_tables_can_have_leading_and_trailing_pipes
|
191
206
|
rd = RDiscount.new(<<EOS)
|
192
207
|
| A | B |
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdiscount
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.7
|
4
|
+
version: 2.2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Tomayko
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2023-06-16 00:00:00.000000000 Z
|
16
16
|
dependencies: []
|
17
17
|
description:
|
18
18
|
email: david@dafoster.net
|