rdiscount 2.2.7 → 2.2.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '094c22178c083e6161282414c5c91b355d3982e92e8db075df6083b5e5618404'
4
- data.tar.gz: d051989d5cb908c4753a5e6d05ead744e91031b98eda30a3a90a59568b6145ca
3
+ metadata.gz: 7cf15c9535d4e5016d31ce5259672abac80df8a2e5669adc6e0cb91e8b1fc7d5
4
+ data.tar.gz: 49d680d21cadadce16d98786249999d0546ff513f043feebbaf4b86aac8a77f5
5
5
  SHA512:
6
- metadata.gz: 61a686cfbad1d1a5e28801bbce4a456d7a409fe2e8f104a67791bb35304518fcb5f36fc5ed9cb4ed4963577f4e2862e636f916dd9259f8bfd273d2924bd7daef
7
- data.tar.gz: 185f481096dd9f823473ed0dfae4161232631ab388828915e25831c842dc257be9fe45e987685eb653e1734f8787f9f11e59e24fdf3ad0780a96251bde21356d
6
+ metadata.gz: 90c7ade6956dc384ba04e2fb212caab6cc3f8b8ef6ee4126114a8bfd668f6dececcabd206c048e31a58d8e1d06d337bd5ba77f94fb4d0e43f8739674fad73acd
7
+ data.tar.gz: 8e4083908e90fb651cae41fa04c5e059593fe80571cb495e39c500b5baf67f788260c85ba8b778fc5e78800c68e94a4c21a832cb424c7e054ece2365e4b92156
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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.7c
1
+ 2.2.7d
data/ext/generate.c CHANGED
@@ -757,22 +757,29 @@ linkylinky(int image, MMIOT *f)
757
757
  else {
758
758
  int goodlink, implicit_mark = mmiottell(f);
759
759
 
760
- if ( isspace(peek(f,1)) )
761
- pull(f);
762
-
763
- if ( peek(f,1) == '[' ) {
764
- pull(f); /* consume leading '[' */
765
- goodlink = linkylabel(f, &key.tag);
760
+ if ( is_flag_set(f->flags, MKD_EXTRA_FOOTNOTE)
761
+ && !is_flag_set(f->flags, MKD_STRICT)
762
+ && (!image)
763
+ && S(name)
764
+ && T(name)[0] == '^' ) {
765
+ extra_footnote = 1;
766
+ goodlink = 1;
766
767
  }
767
768
  else {
768
- /* new markdown implicit name syntax doesn't
769
- * require a second []
770
- */
771
- mmiotseek(f, implicit_mark);
772
- goodlink = !is_flag_set(f->flags, MKD_1_COMPAT);
769
+ if ( isspace(peek(f,1)) )
770
+ pull(f);
773
771
 
774
- if ( is_flag_set(f->flags, MKD_EXTRA_FOOTNOTE) && (!image) && S(name) && T(name)[0] == '^' )
775
- extra_footnote = 1;
772
+ if ( peek(f,1) == '[' ) {
773
+ pull(f); /* consume leading '[' */
774
+ goodlink = linkylabel(f, &key.tag);
775
+ }
776
+ else {
777
+ /* new markdown implicit name syntax doesn't
778
+ * require a second []
779
+ */
780
+ mmiotseek(f, implicit_mark);
781
+ goodlink = !is_flag_set(f->flags, MKD_1_COMPAT);
782
+ }
776
783
  }
777
784
 
778
785
  if ( goodlink ) {
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/ruby-config.h ADDED
@@ -0,0 +1,10 @@
1
+ // These data types may be already defined if building on Windows (using MinGW)
2
+ #ifndef DWORD
3
+ #define DWORD unsigned int
4
+ #endif
5
+ #ifndef WORD
6
+ #define WORD unsigned short
7
+ #endif
8
+ #ifndef BYTE
9
+ #define BYTE unsigned char
10
+ #endif
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.2'
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.2'
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/'
@@ -14,12 +14,13 @@ Gem::Specification.new do |s|
14
14
  Rakefile
15
15
  bin/rdiscount
16
16
  discount
17
+ ext/Csio.c
18
+ ext/VERSION
17
19
  ext/amalloc.c
18
20
  ext/amalloc.h
19
21
  ext/basename.c
20
22
  ext/blocktags
21
23
  ext/config.h
22
- ext/Csio.c
23
24
  ext/css.c
24
25
  ext/cstring.h
25
26
  ext/docheader.c
@@ -43,11 +44,11 @@ Gem::Specification.new do |s|
43
44
  ext/pgm_options.h
44
45
  ext/rdiscount.c
45
46
  ext/resource.c
47
+ ext/ruby-config.h
46
48
  ext/setup.c
47
49
  ext/tags.c
48
50
  ext/tags.h
49
51
  ext/toc.c
50
- ext/VERSION
51
52
  ext/version.c
52
53
  ext/xml.c
53
54
  ext/xmlpage.c
@@ -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.2
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-12-19 00:00:00.000000000 Z
16
16
  dependencies: []
17
17
  description:
18
18
  email: david@dafoster.net
@@ -58,6 +58,7 @@ files:
58
58
  - ext/pgm_options.h
59
59
  - ext/rdiscount.c
60
60
  - ext/resource.c
61
+ - ext/ruby-config.h
61
62
  - ext/setup.c
62
63
  - ext/tags.c
63
64
  - ext/tags.h