downterm 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: bbe4f92ac149f0ad1ecf96b5107fc0b8a7300cf3
4
- data.tar.gz: 64307764bded34852704a7df86054ec4cb3cc0ce
3
+ metadata.gz: 4a91d4479606005ead735082d3a2de8aa8eb15cf
4
+ data.tar.gz: f99953f7306b9a2f5e3150f29485f7246153e9c5
5
5
  SHA512:
6
- metadata.gz: f2070bfdeb9cdde7477d44d40807ff1f74e4825abd6f21d7a3eb9e974583afa6d074c31c990679bab84b089626acf9f6069132f14e6be338648d88e76e680241
7
- data.tar.gz: 521a3db1984a2d3f9711bd9ee4493215757a5bf5fe879086ebd9c014b870d10ce338790960d2067fd1a44b66b24e70da1ccde047f36cfeda9bb726e796427c27
6
+ metadata.gz: 4c8bc3c80b7d09065ea5d7489643c67f398d99ba0d451869de3b79cfe063a17b68806a128c6f2e185291245f5525b9390f697e2054724e034ed38f9fba22a529
7
+ data.tar.gz: 8271fe9ef0f63c75c8e779575ac9d17375c35068a4be417abcc5d9a393bf491b61fc28e5b5d51671bcf7a7eb9a6b109af6fff30bf123984a17f9839604660053
@@ -59,7 +59,13 @@ module Downterm
59
59
  end
60
60
 
61
61
  def block_code(code, language)
62
- code.split("\n").map { |line| " #{line}"}.join("\n")
62
+ block = code.split("\n")
63
+ .map { |line| " #{line}" }
64
+ .map { |line| line.gsub(/>/, '>') }
65
+ .map { |line| line.gsub(/&lt;/, '<') }
66
+ .map { |line| line.gsub(/&amp;/, '&') }
67
+ .join("\n")
68
+ "#{block}\n\n"
63
69
  end
64
70
 
65
71
  def block_quote(quote)
@@ -1,3 +1,3 @@
1
1
  module Downterm
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -124,6 +124,20 @@ module Downterm
124
124
  end
125
125
 
126
126
  it 'is rendered verbatim when in a block' do
127
+ md = [
128
+ %q(This is some code:),
129
+ %q(),
130
+ %q( import antigravity),
131
+ %q( puts "I'm using Python!"),
132
+ %q(),
133
+ %q(That was some code.),
134
+ ].join("\n")
135
+ expected = md
136
+ actual = markdown.render(md)
137
+ expect(actual).to eq(expected)
138
+ end
139
+
140
+ it 'is rendered verbatim in a block that has no non-block text after it' do
127
141
  md = [
128
142
  %q(This is some code:),
129
143
  %q(),
@@ -228,6 +242,44 @@ module Downterm
228
242
  actual = markdown.render(md)
229
243
  expect(actual).to eq(expected)
230
244
  end
245
+
246
+ it 'is converted from &gt; to > even in block code' do
247
+ md = [
248
+ 'This is some code.',
249
+ '',
250
+ ' &gt;&gt;&gt; code',
251
+ '',
252
+ 'That was some code.',
253
+ ].join("\n")
254
+ expected = [
255
+ 'This is some code.',
256
+ '',
257
+ ' >>> code',
258
+ '',
259
+ 'That was some code.',
260
+ ].join("\n")
261
+ actual = markdown.render(md)
262
+ expect(actual).to eq(expected)
263
+ end
264
+
265
+ it 'is converted from &lt; to < even in block code' do
266
+ md = [
267
+ 'This is some code.',
268
+ '',
269
+ ' &lt;&lt;&lt; code',
270
+ '',
271
+ 'That was some code.',
272
+ ].join("\n")
273
+ expected = [
274
+ 'This is some code.',
275
+ '',
276
+ ' <<< code',
277
+ '',
278
+ 'That was some code.',
279
+ ].join("\n")
280
+ actual = markdown.render(md)
281
+ expect(actual).to eq(expected)
282
+ end
231
283
  end
232
284
 
233
285
  describe 'HTML' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: downterm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Dippery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-22 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline