martile 0.6.29 → 0.6.30

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: d35ea75ad96bb5904232d0b7edf0d3ae20d038ab
4
- data.tar.gz: 446b10e8c40fa5758a97b9fe5d90d9710b0f0629
3
+ metadata.gz: a883444aeb334dee25fc9b4acaf6d342bf05c024
4
+ data.tar.gz: 007effbafb1d0deafe2fae5d55880ee45f070a88
5
5
  SHA512:
6
- metadata.gz: ca0cbe07a23833611287748ec2728dfda66d8113939747b1a29c371e507c67e99448328db440dca9659e8d1eecec53b32d1189db0d27258abd9ddc9e2a2c9f36
7
- data.tar.gz: 054a7023189ef012e5082a0e7e8db0e5248fec763cc2d288875258f4fe1374d961fedd4ed49c7e50bccf24186b759eb1e9e1c1f012038f356189de5dd01900ff
6
+ metadata.gz: 7e35bd3808d3b300634d12e5e54a629b1781344da971436845ed7d8ead193fc03a3595a3078d7b37bf13ab7e4e00cbc43261b21c19f984d34aafbea6d9683360
7
+ data.tar.gz: d243a38f7016c6905cd8943e8675aa68b03fe5df4fa5c9d37c9336a8b94b71bf9a7e2bb069b6bb44a5920a9be95d4bca3a234fcb2772be60153da873937001d3
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/martile.rb CHANGED
@@ -9,6 +9,7 @@ require 'rdiscount'
9
9
  require 'kvx'
10
10
 
11
11
 
12
+ # bug fix: 29-Jan-2017 2 or more code listings should now be parsed correctly
12
13
  # feature: 24-Jun-2016 links containing a right parenthesis at the
13
14
  # end are no longer cropped
14
15
  # bug fix: 11-Jun-2016 pre tags are now filtered out properly
@@ -153,30 +154,16 @@ class Martile
153
154
 
154
155
  if s2[0] != '<' then
155
156
 
156
- b =[]
157
+ s.lines.chunk {|x| x =~ /^\n|^ |\n/ }.map do |_, x|
157
158
 
158
- while s2 =~ /^ {4}/ do
159
-
160
- a = s2.lines.to_a
161
- r = a.take_while{|x| x[/^( {4}|\n)/]}
162
-
163
- if r.join.strip.length > 0 then
164
- raw_code = a.shift(r.length).map{|x| x.sub(/^ {4}/,'')}.join
165
-
166
- code_block = "<pre><code>%s</code></pre>\n" % escape(raw_code)
167
-
168
- b << code_block
169
- s2 = a.join
170
- i = r.length
171
- else
172
- i = (s =~ /^ {4}/)
159
+ if x.join.lstrip[/ /] then
160
+ "\n<pre><code>%s</code></pre>\n" % escape(x.join.gsub(/^ {4}/,''))
161
+ else
162
+ x.join
173
163
  end
174
164
 
175
- b << s2.slice!(0,i)
176
-
177
- end
178
-
179
- b.join + s2
165
+ end.join
166
+
180
167
  else
181
168
  s2
182
169
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: martile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.29
4
+ version: 0.6.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  fHJRwdYS8tvLYH9UFytJxDKjlovBuFUsfKP0FJlZGQGJM5JiIj5LWelTGJtJD8hI
32
32
  2jPlwrOtiqZt2A==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-06-23 00:00:00.000000000 Z
34
+ date: 2017-01-29 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdiscount
@@ -94,7 +94,7 @@ dependencies:
94
94
  - !ruby/object:Gem::Version
95
95
  version: 0.5.11
96
96
  description:
97
- email: james@r0bertson.co.uk
97
+ email: james@jamesrobertson.eu
98
98
  executables: []
99
99
  extensions: []
100
100
  extra_rdoc_files: []
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.5.1
123
+ rubygems_version: 2.6.8
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Martile is a Markdown pre formatter which is designed to format custom Markdown
metadata.gz.sig CHANGED
Binary file