martile 0.3.1 → 0.3.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: 1101460d909dae1807654b507a0fb5cef8df2b5b
4
- data.tar.gz: 392a09d98c60d8187fd705f543c28eafab6784cc
3
+ metadata.gz: 4ea535043c10fa85c20eed238d483035fbc35b39
4
+ data.tar.gz: 17c2651a1e5df6fd77ef0b17292c16d2a30e327b
5
5
  SHA512:
6
- metadata.gz: 8b1170d9365135f740d104d1d93420845bc1d84959f94c945dc47089e952946c1dd8b7fb30e2f77720abb2f463cf8f81792b6345c5dc02b0a8826e858212ba7d
7
- data.tar.gz: 4a43af667e774dcddb5ffe6de3ea78180b26ef13c9b006f42ed08de1f9b7592538c5bf464477ad6f0c0a03bca122b863ff4aa38d616ba4243e6e0ea5981998ee
6
+ metadata.gz: ca341dd25ca9dd6066ec3532c711541af3cb8e824f12fdad593b3e3f7dfb4552c76af0a14dc47c61e3dd3d11ba25e0a7ba8c0280e969fe6d7b829e0b1be2efae
7
+ data.tar.gz: dc1a492db56e591a4f9f18389e3d2ab37594db047af1dc22326003242ba0c516bf39218a7dd803789950fe4c3d35a3367bd5714e83ba8ca0f188046bbec7818a
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -8,7 +8,13 @@ require 'dynarex'
8
8
  require 'rdiscount'
9
9
 
10
10
 
11
- # feature: 27-Sep-2014: A smartlink can now be used e.g. ?link http://someurl?
11
+ # feature: 27-Sep-2014: 1. A smartlink can now be used
12
+ # e.g. ?link http://someurl?
13
+ # 2. pre tegs can now be created from 2 pairs of slash
14
+ # tags, before and after the pre tag content e.g.
15
+ # //
16
+ # testing
17
+ # //
12
18
  # feature: 24-Sep-2014: A kind of markdown list can now be created inside
13
19
  # of <ol> or <ul> tags
14
20
  # bug fix: 16-Apr-2014: Words containing an underscore should no longer be
@@ -40,7 +46,9 @@ class Martile
40
46
 
41
47
  attr_reader :to_html
42
48
 
43
- def initialize(s)
49
+ def initialize(raw_s)
50
+
51
+ s = slashpre raw_s
44
52
 
45
53
  raw_s2 = apply_filter(s.strip) {|x| code_block_to_html x }
46
54
 
@@ -240,4 +248,12 @@ class Martile
240
248
  s.gsub(/\B\?([^\n]+) +(https?:\/\/[^\b]+)\?\B/,'[\1](\2)')
241
249
  end
242
250
 
251
+ def slashpre(s
252
+ )
253
+ s.gsub(/\B\/\/([^\/]+)\B\/\//) do |x|
254
+ "<pre>#{($1).lines.map{|y| y.sub(/^ +/,'')}.join}</pre>"
255
+ end
256
+
257
+ end
258
+
243
259
  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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file