reveal-ck 0.6.1 → 0.6.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
  SHA1:
3
- metadata.gz: 7827ff95cbcd95ab71edcb05af538b444034ce57
4
- data.tar.gz: 5e4bbe103ed9e3df46ac980ab2c034ccf881a9d1
3
+ metadata.gz: 76630b76941f3736b93bb84794bef7afac6223bd
4
+ data.tar.gz: 0ad0489bf9dc82923213e3fa9c70edd4f7ef36c0
5
5
  SHA512:
6
- metadata.gz: 13546e79c4ceca5245cae207289759924f1ac11e37977764a93317364a73cafbd160e190a0f46ace2d4629d0077d49a88151f261e3728539062b7b698f0bc06e
7
- data.tar.gz: 0476d2073d10a09620f74a34a70e31895b06066e64625577dca91475e0ea2bc6ca3f23048f28bb8ba78e457287533ed8ee06855627b72de1cc7284d14f940579
6
+ metadata.gz: 82b2f640d34bf6556c29724d9280f55f3398b3d3c0c03818f963796a658527692fb3f53792c30d59a0bef9946df6763475e50dfce0a2a2ea8f4223824a8a9df1
7
+ data.tar.gz: bdf45ad90615ccde4081d82bf3489d6ddbf4105008a0b3627bcf831519fae969f24673b4e72ddb3c4ce3cd429bdb3af274617a1e219ddd79c96635b2e353c3c3
@@ -1,3 +1,4 @@
1
+ require 'cgi'
1
2
  require 'redcarpet'
2
3
 
3
4
  module RevealCK
@@ -13,12 +14,13 @@ module RevealCK
13
14
  end
14
15
 
15
16
  def block_code(code, language)
17
+ escaped = CGI.escape_html(code)
16
18
  if language.nil?
17
- "<pre><code>#{code}</code></pre>"
19
+ "<pre><code>#{escaped}</code></pre>"
18
20
  elsif language == 'notes' || language == 'note'
19
- "<aside class='notes'>#{code}</aside>"
21
+ "<aside class='notes'>#{escaped}</aside>"
20
22
  else
21
- "<pre><code class=\"#{language}\">#{code}</code></pre>"
23
+ "<pre><code class=\"#{language}\">#{escaped}</code></pre>"
22
24
  end
23
25
  end
24
26
  end
@@ -1,4 +1,4 @@
1
1
  # RevealCK::VERSION is the current version of reveal-ck
2
2
  module RevealCK
3
- VERSION = '0.6.1'
3
+ VERSION = '0.6.2'
4
4
  end
@@ -49,6 +49,17 @@ eos
49
49
  expect(output).to include 'a + b'
50
50
  end
51
51
 
52
+ it 'converts special characters in ``` block to entity references' do
53
+ output = render_markdown <<-eos
54
+ ```
55
+ <p>"&"</p>
56
+ ```
57
+ eos
58
+ expect(output).to include '<pre><code>'
59
+ expect(output).to include '</code></pre>'
60
+ expect(output).to include '&lt;p&gt;&quot;&amp;&quot;&lt;/p&gt;'
61
+ end
62
+
52
63
  it 'wraps ```ruby code in a <pre> and <code class="ruby">' do
53
64
  output = render_markdown <<-eos
54
65
  ```ruby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reveal-ck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jed Northridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-01 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: RedCloth