pot_markdown 0.1.2 → 0.1.3

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: 7d550260430cb9b09c249e0ad1ba5708fd42396c
4
- data.tar.gz: cd54ee6b8fedc398265377751be58c385214549e
3
+ metadata.gz: b88c41e5554a8abaa56455a47583b860df455b9e
4
+ data.tar.gz: 2ee8fad9618881e0f585a13a58e3a671e8c7d652
5
5
  SHA512:
6
- metadata.gz: 78eaa770e2634ace990b7bb493bda7d4e209084922ff7bbade6c1cbc5ede60946b463a7dfac98693841622e18c80489b6c937e1aee678e3f207865687d28bbe1
7
- data.tar.gz: d06d37d98642300730b3ad079d921b26d9a6859d9b9bab00a23877a9df993ba01ab766703cc04638443185045c4ea141687e12c054e622ecabea148dbe300d1f
6
+ metadata.gz: fc729974173e0590b2ee57dec99ea3209aa421a81cc1f4dea3bbe229716d6ef6874b34a0954b9102a03ad0bb2b8961b33b2bae82e690b13ab987ffc62f0b9ea5
7
+ data.tar.gz: 4849d016d014e426ec64b274c53f30ab5363bca52d11fa1d1a7f30f578fb7cc37581ef2bfee8d38e0f7280426e5351517532f97f32b5ca766b8ad766d8258393
@@ -1,6 +1,7 @@
1
1
  require 'nokogiri'
2
2
  require 'sanitize'
3
3
 
4
+ require 'pot_markdown/filters/sanitize_transformers/id_transformer'
4
5
  require 'pot_markdown/filters/sanitize_transformers/list_transformer'
5
6
  require 'pot_markdown/filters/sanitize_transformers/table_transformer'
6
7
 
@@ -80,6 +81,7 @@ module PotMarkdown
80
81
  datetime
81
82
  height
82
83
  hreflang
84
+ id
83
85
  itemprop
84
86
  lang
85
87
  name
@@ -133,6 +135,7 @@ module PotMarkdown
133
135
  }
134
136
  },
135
137
  transformers: [
138
+ SanitizeTransformers::IdTransformer,
136
139
  SanitizeTransformers::ListTransformer,
137
140
  SanitizeTransformers::TableTransformer
138
141
  ]
@@ -0,0 +1,24 @@
1
+ module PotMarkdown
2
+ module Filters
3
+ module SanitizeTransformers
4
+ class IdTransformer
5
+ def self.call(*args)
6
+ new(*args).transform
7
+ end
8
+
9
+ def initialize(env)
10
+ @env = env
11
+ @node = env[:node]
12
+ end
13
+
14
+ attr_reader :node
15
+
16
+ def transform
17
+ return unless node.attribute('id')
18
+ return if node.attribute('id').to_s =~ /\Afn/
19
+ node.remove_attribute('id')
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module PotMarkdown
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pot_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ru_shalm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-19 00:00:00.000000000 Z
11
+ date: 2016-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-pipeline
@@ -233,6 +233,7 @@ files:
233
233
  - lib/pot_markdown/filters/sanitize_html_filter.rb
234
234
  - lib/pot_markdown/filters/sanitize_iframe_filter.rb
235
235
  - lib/pot_markdown/filters/sanitize_script_filter.rb
236
+ - lib/pot_markdown/filters/sanitize_transformers/id_transformer.rb
236
237
  - lib/pot_markdown/filters/sanitize_transformers/list_transformer.rb
237
238
  - lib/pot_markdown/filters/sanitize_transformers/table_transformer.rb
238
239
  - lib/pot_markdown/filters/toc_filter.rb