pot_markdown 0.1.5 → 0.1.6

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: d1cfa390c6f5bea406e7d4c18fcbc573c2331027
4
- data.tar.gz: 8813862aeaf965e043a53a7b23dd77899a025224
3
+ metadata.gz: cd3834f83a518959ab498ab9c13c8f9079f8d498
4
+ data.tar.gz: 2010579f45e3fa35719c58ce8732c062f1f0f5f4
5
5
  SHA512:
6
- metadata.gz: 504131c44962a29c99f6add3070af55c514162e03862f07fea19d0ecd264ed060a43ec41c717b2cb67d69263afd83eca86487da615d4f6a86ea17ce7445fc62c
7
- data.tar.gz: 1e9472ac041eec734636aa30930826ff00e8f27a97a1642e6a55c2f388a1df1946b4f747b45bcf8985049755ab0e9fb8c5a5f0bf9900a56a5ece02ff1f2df438
6
+ metadata.gz: 51d8be497313a33d634d09a73ec0f5775b4753f2f3c68213284ea26699aec816d6210554f437ba32fb23ea53dcf226604bf494943527538d50cf7b0dab4abb0c
7
+ data.tar.gz: 9e0932318a3f8ce966e0d539f4319d8daa33a49a91a7899028f76c10f5e11bd4dcc3c5f96aa161c48999b9f35181022c1388a0cfc7302a2f3f5f5d17a5f71180
data/.rubocop.yml CHANGED
@@ -21,6 +21,10 @@ LineLength:
21
21
  MethodLength:
22
22
  Max: 30
23
23
 
24
+ BlockLength:
25
+ Exclude:
26
+ - test/**/*
27
+
24
28
  PerceivedComplexity:
25
29
  Exclude:
26
30
  - lib/kramdown/**/*
data/.rubocop_todo.yml CHANGED
@@ -1,11 +1,11 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-03-12 02:43:19 +0900 using RuboCop version 0.37.2.
3
+ # on 2016-10-16 15:15:49 +0900 using RuboCop version 0.44.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 6
9
+ # Offense count: 4
10
10
  Metrics/AbcSize:
11
11
  Max: 33
data/.travis.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.1
5
- - 2.2
6
- - 2.3.0
4
+ - 2.2.5
5
+ - 2.3.1
7
6
  - ruby-head
8
7
  before_install:
9
8
  - gem install bundler
@@ -12,7 +12,6 @@ module Kramdown
12
12
  @block_parsers.delete(:table)
13
13
  end
14
14
 
15
- require 'kramdown/parser/pot_markdown/atx_header'
16
15
  require 'kramdown/parser/pot_markdown/code_block'
17
16
  require 'kramdown/parser/pot_markdown/table'
18
17
  end
@@ -1,7 +1,8 @@
1
1
  module Kramdown
2
2
  module Parser
3
3
  class PotMarkdown
4
- FENCED_CODEBLOCK_MATCH = /^(([~`]){3,})\s*?((\w[\w\:\.-]*)(?:\?\S*)?)?\s*?\n(.*?)^\1\2*\s*?\n/m
4
+ FENCED_CODEBLOCK_START = /^[ ]{0,3}[~`]{3,}/
5
+ FENCED_CODEBLOCK_MATCH = /^[ ]{0,3}(([~`]){3,})\s*?((\S+?)(?:\?\S*)?)?\s*?\n(.*?)^[ ]{0,3}\1\2*\s*?\n/m
5
6
 
6
7
  def parse_codeblock_fenced
7
8
  if @src.check(self.class::FENCED_CODEBLOCK_MATCH)
@@ -148,10 +148,9 @@ module PotMarkdown
148
148
  private
149
149
 
150
150
  def rule
151
- case
152
- when context[:sanitize_rule]
151
+ if context[:sanitize_rule]
153
152
  context[:sanitize_rule]
154
- when context[:sanitize_use_external]
153
+ elsif context[:sanitize_use_external]
155
154
  RULE_EXT
156
155
  else
157
156
  RULE
@@ -1,4 +1,5 @@
1
1
  require 'html/pipeline'
2
+ require 'rouge'
2
3
 
3
4
  require 'pot_markdown/filters/markdown_filter'
4
5
  require 'pot_markdown/filters/sanitize_html_filter'
@@ -1,3 +1,3 @@
1
1
  module PotMarkdown
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.6'.freeze
3
3
  end
data/pot_markdown.gemspec CHANGED
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_dependency 'html-pipeline', '~> 2.0'
21
- spec.add_dependency 'kramdown', '~> 1.10'
22
- spec.add_dependency 'rouge'
20
+ spec.add_dependency 'html-pipeline', '~> 2.4'
21
+ spec.add_dependency 'kramdown', '~> 1.12'
22
+ spec.add_dependency 'rouge', '~> 1.8'
23
23
  spec.add_dependency 'gemoji'
24
24
  spec.add_dependency 'rinku'
25
25
  spec.add_dependency 'sanitize'
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'benchmark-ips'
31
31
  spec.add_development_dependency 'test-unit'
32
32
  spec.add_development_dependency 'diffy'
33
- spec.add_development_dependency 'rubocop'
33
+ spec.add_development_dependency 'rubocop', '0.44.1'
34
34
  spec.add_development_dependency 'activesupport'
35
35
  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.5
4
+ version: 0.1.6
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-05-11 00:00:00.000000000 Z
11
+ date: 2016-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-pipeline
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: kramdown
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.10'
33
+ version: '1.12'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.10'
40
+ version: '1.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rouge
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.8'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.8'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: gemoji
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -182,16 +182,16 @@ dependencies:
182
182
  name: rubocop
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: '0'
187
+ version: 0.44.1
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - '='
193
193
  - !ruby/object:Gem::Version
194
- version: '0'
194
+ version: 0.44.1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: activesupport
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -223,7 +223,6 @@ files:
223
223
  - bin/console
224
224
  - bin/setup
225
225
  - lib/kramdown/parser/pot_markdown.rb
226
- - lib/kramdown/parser/pot_markdown/atx_header.rb
227
226
  - lib/kramdown/parser/pot_markdown/code_block.rb
228
227
  - lib/kramdown/parser/pot_markdown/table.rb
229
228
  - lib/pot_markdown.rb
@@ -1,24 +0,0 @@
1
- module Kramdown
2
- module Parser
3
- class PotMarkdown
4
- def parse_atx_header
5
- # ↓ removed in pot_markdown
6
- # return false if !after_block_boundary?
7
-
8
- start_line_number = @src.current_line_number
9
- @src.check(ATX_HEADER_MATCH)
10
- level = @src[1]
11
- text = @src[2].to_s.strip
12
- id = @src[3]
13
- return false if text.empty?
14
-
15
- @src.pos += @src.matched_size
16
- el = new_block_el(:header, nil, nil, level: level.length, raw_text: text, location: start_line_number)
17
- add_text(text, el)
18
- el.attr['id'] = id if id
19
- @tree.children << el
20
- true
21
- end
22
- end
23
- end
24
- end