redcarpet 3.5.0 → 3.5.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: 0ab6ed54cafc5edbbd785307a772251508fe1a8c9d739e7b28a6f1b89e162dfb
4
- data.tar.gz: b6a8579180b8933a1181be7aeaf4e544e1161499dac1f4fb1c5f34f61585b971
3
+ metadata.gz: 3e6ea78031a1e40620168cd57fcbfae06bec5bafabc8f6e600adc552a4fe5b40
4
+ data.tar.gz: 658dd33e836daa11effa88e0491d09387963ea349751efd278e9fbdac7026066
5
5
  SHA512:
6
- metadata.gz: bc2a7f4ceab2736677752bde915f9090cabad682cfc71fc680958852d71ae18bc902d8a71ba47453adf689b41e87413bee3d766a8470d333654b6808f5b96b09
7
- data.tar.gz: e2fb9c0596683da9b2b6c24597a58ebe2b62e958c1f21173a733d0344b6e671b78fedfc2171d7b5c3a1b945a7e0d355329a2d60aeadfe79616dc730d22904816
6
+ metadata.gz: b17b0208c25d4e8566fb4a154d0f66e778b702abcf58d1d1227fa2510be421c7496e20fd6402066adba3485778e935b46aff73fd412802eedb89e44470a7ad94
7
+ data.tar.gz: 1e1c8dd559979b8bd5f4de2d20e1127b2a964c03a267133c3d9a3703f71bce44a2f4dc2efdb0dc0cc331e0ab779bfad23e9b62af0ffc4ee9078896376bd86865
@@ -255,8 +255,15 @@ rndr_quote(struct buf *ob, const struct buf *text, void *opaque)
255
255
  if (!text || !text->size)
256
256
  return 0;
257
257
 
258
+ struct html_renderopt *options = opaque;
259
+
258
260
  BUFPUTSL(ob, "<q>");
259
- bufput(ob, text->data, text->size);
261
+
262
+ if (options->flags & HTML_ESCAPE)
263
+ escape_html(ob, text->data, text->size);
264
+ else
265
+ bufput(ob, text->data, text->size);
266
+
260
267
  BUFPUTSL(ob, "</q>");
261
268
 
262
269
  return 1;
@@ -2,7 +2,7 @@ require 'redcarpet.so'
2
2
  require 'redcarpet/compat'
3
3
 
4
4
  module Redcarpet
5
- VERSION = '3.5.0'
5
+ VERSION = '3.5.1'
6
6
 
7
7
  class Markdown
8
8
  attr_reader :renderer
@@ -1,10 +1,10 @@
1
1
  # encoding: utf-8
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'redcarpet'
4
- s.version = '3.5.0'
4
+ s.version = '3.5.1'
5
5
  s.summary = "Markdown that smells nice"
6
6
  s.description = 'A fast, safe and extensible Markdown to (X)HTML parser'
7
- s.date = '2019-07-29'
7
+ s.date = '2020-12-15'
8
8
  s.email = 'vicent@github.com'
9
9
  s.homepage = 'http://github.com/vmg/redcarpet'
10
10
  s.authors = ["Natacha Porté", "Vicent Martí"]
@@ -220,6 +220,16 @@ class MarkdownTest < Redcarpet::TestCase
220
220
  assert_equal '<p>this is a <q>quote</q></p>', output
221
221
  end
222
222
 
223
+ def test_quote_flag_honors_escape_html
224
+ text = 'We are not "<svg/onload=pwned>"'
225
+
226
+ output_enabled = render(text, with: [:quote, :escape_html])
227
+ output_disabled = render(text, with: [:quote])
228
+
229
+ assert_equal "<p>We are not <q>&lt;svg/onload=pwned&gt;</q></p>", output_enabled
230
+ assert_equal "<p>We are not <q><svg/onload=pwned></q></p>", output_disabled
231
+ end
232
+
223
233
  def test_that_fenced_flag_works
224
234
  text = <<-fenced.strip_heredoc
225
235
  This is a simple test
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redcarpet
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natacha Porté
8
8
  - Vicent Martí
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-29 00:00:00.000000000 Z
12
+ date: 2020-12-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -111,7 +111,7 @@ homepage: http://github.com/vmg/redcarpet
111
111
  licenses:
112
112
  - MIT
113
113
  metadata: {}
114
- post_install_message:
114
+ post_install_message:
115
115
  rdoc_options: []
116
116
  require_paths:
117
117
  - lib
@@ -126,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.0.3
130
- signing_key:
129
+ rubygems_version: 3.1.4
130
+ signing_key:
131
131
  specification_version: 4
132
132
  summary: Markdown that smells nice
133
133
  test_files: