martile 0.5.10 → 0.5.11

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: c59da8fa9b9fff57c84a2503ed684788a6a81082
4
- data.tar.gz: 4a3438a8ad32b5efa66021b584529b2e4c37ddd0
3
+ metadata.gz: 4f5aa2a91b9258fa609b6e9bb08aca5d91dd570d
4
+ data.tar.gz: ca4e379f7d992f9545c32e7f492e0c4f01357d66
5
5
  SHA512:
6
- metadata.gz: e8c12768f2e1a0e84e31c315e0aba359efc4d8e6a7eade158e3ceb21e712cdee0c91ee61d9041d22aa359531df57d7fa223d02ca8322d69fd06ea19b4c2c477a
7
- data.tar.gz: 116f466348f178fa3c9a866d20521d6170c17f34063ff708c7271f3d2f526d825bffb3a4fcb1fcd1bd67fc05ba99d597c104faede165144784135903f94539b6
6
+ metadata.gz: 2f9c137dc7bad47c8b026aff236bf3567650bdff10738875067fa1205c9d91773838d19b452a46b4bf4951255f753f6f87d4f9bac515524b256317c66a1049de
7
+ data.tar.gz: 5f7f90fe348ccc0d175270f7f7e5430da19429076b31aae84a124b1e6fd353ee87c4bb7ef2631d2cd1e25a08d75faa12b2c364e78b4c27cb1dff51a0c0af20f7
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/martile.rb CHANGED
@@ -8,6 +8,7 @@ require 'dynarex'
8
8
  require 'rdiscount'
9
9
 
10
10
 
11
+ # feature: 29-Mar-2015: Borrowed the strikethru feature from Mtlite
11
12
  # bug fix: 28-Mar-2015: Fixes a bug introduced on the 20-Mar-2015 relating to
12
13
  # Markdown lists not being converted to HTML
13
14
  # see http://www.jamesrobertson.eu/bugtracker/2015/mar/28/markdown-lists-are-not-converted-to-html.html
@@ -242,14 +243,20 @@ class Martile
242
243
  # and [x] with a unicode checked checkbox
243
244
  s2 = s.gsub(/\s\[\s*\]\s/,' ☐ ').gsub(/\s\[x\]\s/,' ☑ ')
244
245
 
245
- s2.gsub(/(?:^\[|\s\[)[^\]]+\]\((https?:\/\/[^\s]+)/) do |x|
246
+ s3 = s2.gsub(/(?:^\[|\s\[)[^\]]+\]\((https?:\/\/[^\s]+)/) do |x|
246
247
 
247
248
  next x if @ignore_domainlabel and x[/#{@ignore_domainlabel}/]
248
249
 
249
- s2 = x[/https?:\/\/([^\/]+)/,1].split(/\./)
250
- r = s2.length >= 3 ? s2[1..-1] : s2
250
+ a = x[/https?:\/\/([^\/]+)/,1].split(/\./)
251
+ r = a.length >= 3 ? a[1..-1] : a
251
252
  "%s<span class='domain'>[%s]</span>" % [x, r.join('.')]
252
- end
253
+ end
254
+
255
+ # add strikethru to completed items
256
+ # e.g. -milk cow- becomes <del>milk cow</del>
257
+ s3.gsub(/\s-[^-]+-?[^-]+-[\s\]]/) do |x|
258
+ x.sub(/-([&\w]+.*\w+)-/,'<del>\1</del>')
259
+ end
253
260
 
254
261
  end
255
262
 
data.tar.gz.sig CHANGED
Binary file
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.5.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  fnr5l+RI/6f8lfxBNgDrktGB/RwPkOyWtyKk1tu9CWgHmptxL0JglikCXg5MzuZI
32
32
  tZzXOvXUoUf1VQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-03-28 00:00:00.000000000 Z
34
+ date: 2015-03-29 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdiscount
metadata.gz.sig CHANGED
Binary file