martile 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: c1eb7bd41468a4b9f87cb9082636c26a7c2e227c
4
- data.tar.gz: a64543a59e9146c19de0a414959a4a37e2cc1e81
3
+ metadata.gz: cae919ad3738c5633faebe00988f330261e6aa76
4
+ data.tar.gz: e92aebae9a0c888783ba9b4c26579eb982c8bc45
5
5
  SHA512:
6
- metadata.gz: 6d9bf2ae03d6c2a9d484440f95bcddd4bdc1bdc8a388864f6ffdd4d6264861d48e4199e5e06a0564c2f8176f874aa10a1f2483d39fab098743147f70a6c957d4
7
- data.tar.gz: f93a8b05b7c2067d2f9d51f27692c7b862ff64e4bcd6563b3e816a858ddf75ca68b31a4c92543790d84329a0c82a66b8f121d37a0d1a7fa292551b87a97128ed
6
+ metadata.gz: bd0f4fe7c0f0294104416f1324d36717601e755d240979053521eeefa4ec692726ddf6412491e0b6f5fbf422972097acfbe0879b4207521650c096da72b06899
7
+ data.tar.gz: 4ee690646238b127e46ad72d91222d14c93c17be7ac295643eefa70b0ea8bec3f5aba8a58b792f3e877b95212311fb9a70c0b473bcbd816b5cc7cae0c8aeba04
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/martile.rb CHANGED
@@ -8,8 +8,9 @@ require 'dynarex'
8
8
  require 'rdiscount'
9
9
 
10
10
 
11
- # feature: 02-Jul-2015 The shorthand !i[]() can now render an iframe tag
12
- # e.g. !i[](http://somefile.url/sometext.txt)
11
+ # feature: 02-Jul-2015 Apply_filter() now filters out pre and code tags
12
+ # The shorthand !i[]() can now render an iframe tag
13
+ # e.g. !i[](http://somefile.url/sometext.txt)
13
14
  # feature: 19-Jun-2015 Now uses github flavoured markdown to style the table
14
15
  # 01-Jun-2015 re-applied yesterday's feature which I
15
16
  # removed shortly afterwards
@@ -269,15 +270,17 @@ class Martile
269
270
 
270
271
  end
271
272
 
272
- def apply_filter(s, names=[], &block)
273
-
274
- Rexle.new("<root>#{s}</root>").root.map do |x|
273
+ def apply_filter(s, names=%w(pre code), &block)
274
+
275
+ doc = Rexle.new("<root>#{s}</root>")
276
+ #puts 'doc : ' + doc.root.xml(pretty: true).inspect
277
+ doc.root.map do |x|
275
278
 
276
279
  if x.is_a?(String) then
277
280
  block.call(x)
278
281
  else
279
282
 
280
- if names.grep x.name then
283
+ if not names.grep x.name then
281
284
  block.call(x.xml pretty: false)
282
285
  else
283
286
  x
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.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file