rdiscount 2.2.7 → 2.2.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '094c22178c083e6161282414c5c91b355d3982e92e8db075df6083b5e5618404'
4
- data.tar.gz: d051989d5cb908c4753a5e6d05ead744e91031b98eda30a3a90a59568b6145ca
3
+ metadata.gz: 5849e19e3928819b5f9a20522e207dfeedfb4f0255eadf474e422955e63d262e
4
+ data.tar.gz: 280e0da7f264fdf85ae557fb71b260c2716abf6c1487123ab86b3b5907244902
5
5
  SHA512:
6
- metadata.gz: 61a686cfbad1d1a5e28801bbce4a456d7a409fe2e8f104a67791bb35304518fcb5f36fc5ed9cb4ed4963577f4e2862e636f916dd9259f8bfd273d2924bd7daef
7
- data.tar.gz: 185f481096dd9f823473ed0dfae4161232631ab388828915e25831c842dc257be9fe45e987685eb653e1734f8787f9f11e59e24fdf3ad0780a96251bde21356d
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://github.com/davidfstr/discount.git) registered for path 'discount'
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 and date.
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
- (mkd_sta_function_t)Qchar, f, 1, f);
193
+ Qchar_mkd_sta_function_t, f, 1, f);
190
194
  }
191
195
 
192
196
 
data/ext/gethopt.c CHANGED
@@ -45,8 +45,7 @@ struct h_context *ctx;
45
45
 
46
46
 
47
47
  int
48
- hopterr(ctx,val)
49
- struct h_context *ctx;
48
+ hopterr(struct h_context *ctx, int val)
50
49
  {
51
50
  int old = ctx->opterr;
52
51
 
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
- (mkd_sta_function_t)Csputc,
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
@@ -24,7 +24,7 @@
24
24
  # end
25
25
  #
26
26
  class RDiscount
27
- VERSION = '2.2.7'
27
+ VERSION = '2.2.7.1'
28
28
 
29
29
  # Original Markdown formatted text.
30
30
  attr_reader :text
data/rdiscount.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rdiscount'
3
- s.version = '2.2.7'
3
+ s.version = '2.2.7.1'
4
4
  s.summary = "Fast Implementation of Gruber's Markdown in C"
5
5
  s.email = 'david@dafoster.net'
6
6
  s.homepage = 'http://dafoster.net/projects/rdiscount/'
@@ -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("Hello<style>p { margin: 5px; }</style>")
187
- assert_equal "<p>Hello<style>p { margin: 5px; }</style></p>\n", rd.to_html
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: 2022-10-24 00:00:00.000000000 Z
15
+ date: 2023-06-16 00:00:00.000000000 Z
16
16
  dependencies: []
17
17
  description:
18
18
  email: david@dafoster.net