mdl 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/mdl/cli.rb +13 -2
- data/lib/mdl/rules.rb +5 -4
- data/lib/mdl/version.rb +1 -1
- data/test/rule_tests/spaces_inside_emphasis_markers.md +4 -0
- data/test/rule_tests/spaces_inside_link_text.md +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bbddcf751f5ec8a6e7a2d184820c2ba747baa0c
|
4
|
+
data.tar.gz: 6a40d8e63ef5829c7177d5998dbd0363abae8eaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cb2592afd5b65dbe4bce8aa980ebfca2b9bb76c2d6d9deff09220375d53305706963a9ceb0d4582ac138dcb4bf2a380d792272cf704152a054c76f5859ad082
|
7
|
+
data.tar.gz: 82b4dd7b7b81e1ed956e3c39a6ee3a9e6e09deaeb96eeae6278860a69625d53c7ec269944d5db21cadbd7b639a8295cfde4f8540e4eff171cb03d6658f7d3212
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.2.1](https://github.com/mivok/markdownlint/tree/v0.2.1) (2015-04-13)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/mivok/markdownlint/compare/v0.2.0...v0.2.1)
|
6
|
+
|
7
|
+
### Bugs fixed
|
8
|
+
|
9
|
+
* Incorrect parsing of rules/tags specification in .mdlrc (#81)
|
10
|
+
* Exception on image links with MD039 (#82)
|
11
|
+
* MD037 flags on two words beginning with underscores on the same line. (#83)
|
12
|
+
|
13
|
+
### Known issues
|
14
|
+
|
15
|
+
* Exception on some lines with raw html list items in them (#83)
|
16
|
+
|
3
17
|
## [v0.2.0](https://github.com/mivok/markdownlint/tree/v0.2.0) (2015-04-13)
|
4
18
|
|
5
19
|
[Full Changelog](https://github.com/mivok/markdownlint/compare/v0.1.0...v0.2.0)
|
data/lib/mdl/cli.rb
CHANGED
@@ -80,14 +80,25 @@ module MarkdownLint
|
|
80
80
|
# Put values in the config file
|
81
81
|
MarkdownLint::Config.merge!(config)
|
82
82
|
|
83
|
+
# Set the correct format for any rules/tags configuration loaded from
|
84
|
+
# the config file. Ideally this would probably be done as part of the
|
85
|
+
# config class itself rather than here.
|
86
|
+
MarkdownLint::Config[:rules] = CLI.toggle_list(
|
87
|
+
MarkdownLint::Config[:rules]) unless MarkdownLint::Config[:rules].nil?
|
88
|
+
MarkdownLint::Config[:tags] = CLI.toggle_list(
|
89
|
+
MarkdownLint::Config[:tags], true) \
|
90
|
+
unless MarkdownLint::Config[:tags].nil?
|
91
|
+
|
83
92
|
# Read from stdin if we didn't provide a filename
|
84
93
|
if cli_arguments.empty? and not config[:list_rules]
|
85
94
|
cli_arguments << "-"
|
86
95
|
end
|
87
96
|
end
|
88
97
|
|
89
|
-
def self.toggle_list(
|
90
|
-
parts
|
98
|
+
def self.toggle_list(parts, to_sym=false)
|
99
|
+
if parts.class == String
|
100
|
+
parts = parts.split(',')
|
101
|
+
end
|
91
102
|
inc = parts.select{|p| not p.start_with?('~')}
|
92
103
|
exc = parts.select{|p| p.start_with?('~')}.map{|p| p[1..-1]}
|
93
104
|
if to_sym
|
data/lib/mdl/rules.rb
CHANGED
@@ -496,8 +496,8 @@ rule "MD037", "Spaces inside emphasis markers" do
|
|
496
496
|
# Kramdown doesn't parse emphasis with spaces, which means we can just
|
497
497
|
# look for emphasis patterns inside regular text with spaces just inside
|
498
498
|
# them.
|
499
|
-
(doc.matching_text_element_lines(
|
500
|
-
doc.matching_text_element_lines(/(\*\*?|__?).+\s\1/)).sort
|
499
|
+
(doc.matching_text_element_lines(/\s(\*\*?|__?)\s.+\1/) | \
|
500
|
+
doc.matching_text_element_lines(/(\*\*?|__?).+\s\1\s/)).sort
|
501
501
|
end
|
502
502
|
end
|
503
503
|
|
@@ -515,8 +515,9 @@ rule "MD039", "Spaces inside link text" do
|
|
515
515
|
tags :whitespace, :links
|
516
516
|
check do |doc|
|
517
517
|
doc.element_linenumbers(doc.find_type_elements(:a).select{|e|
|
518
|
-
e.children[0].
|
519
|
-
e.children[0].value.
|
518
|
+
e.children[0].type == :text and
|
519
|
+
(e.children[0].value.start_with?(" ") or
|
520
|
+
e.children[0].value.end_with?(" ")) })
|
520
521
|
end
|
521
522
|
end
|
522
523
|
|
data/lib/mdl/version.rb
CHANGED