mdl 0.5.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mdl +2 -2
- data/lib/mdl.rb +49 -40
- data/lib/mdl/cli.rb +92 -90
- data/lib/mdl/config.rb +2 -1
- data/lib/mdl/doc.rb +52 -59
- data/lib/mdl/kramdown_parser.rb +1 -1
- data/lib/mdl/rules.rb +224 -169
- data/lib/mdl/ruleset.rb +11 -10
- data/lib/mdl/style.rb +30 -8
- data/lib/mdl/styles/cirosantilli.rb +2 -2
- data/lib/mdl/styles/default.rb +1 -1
- data/lib/mdl/version.rb +1 -1
- data/mdl.gemspec +23 -20
- metadata +85 -289
- data/.gitignore +0 -13
- data/.travis.yml +0 -23
- data/CHANGELOG.md +0 -187
- data/README.md +0 -86
- data/Rakefile +0 -8
- data/docs/RULES.md +0 -1047
- data/docs/configuration.md +0 -99
- data/docs/creating_rules.md +0 -90
- data/docs/creating_styles.md +0 -47
- data/docs/rolling_a_release.md +0 -49
- data/example/markdown_spec.md +0 -897
- data/test/fixtures/default_mdlrc +0 -1
- data/test/fixtures/dir_with_md_and_markdown/bar.markdown +0 -1
- data/test/fixtures/dir_with_md_and_markdown/foo.md +0 -1
- data/test/fixtures/front_matter/jekyll_post.md +0 -16
- data/test/fixtures/mdlrc_disable_rules +0 -1
- data/test/fixtures/mdlrc_disable_tags +0 -1
- data/test/fixtures/mdlrc_enable_rules +0 -1
- data/test/fixtures/mdlrc_enable_tags +0 -1
- data/test/fixtures/my_ruleset.rb +0 -6
- data/test/rule_tests/alternate_top_level_header.md +0 -3
- data/test/rule_tests/alternate_top_level_header_style.rb +0 -4
- data/test/rule_tests/atx_closed_header_spacing.md +0 -17
- data/test/rule_tests/atx_header_spacing.md +0 -5
- data/test/rule_tests/blockquote_blank_lines.md +0 -31
- data/test/rule_tests/blockquote_spaces.md +0 -23
- data/test/rule_tests/bulleted_list_2_space_indent.md +0 -6
- data/test/rule_tests/bulleted_list_2_space_indent_style.rb +0 -3
- data/test/rule_tests/bulleted_list_4_space_indent.md +0 -3
- data/test/rule_tests/bulleted_list_not_at_beginning_of_line.md +0 -14
- data/test/rule_tests/code_block_consistency.md +0 -11
- data/test/rule_tests/code_block_consistency_style.rb +0 -1
- data/test/rule_tests/code_block_dollar.md +0 -33
- data/test/rule_tests/code_block_dollar_fence.md +0 -29
- data/test/rule_tests/code_block_fenced.md +0 -17
- data/test/rule_tests/code_block_fenced_style.rb +0 -1
- data/test/rule_tests/code_block_indented.md +0 -17
- data/test/rule_tests/code_block_indented_style.rb +0 -1
- data/test/rule_tests/consecutive_blank_lines.md +0 -11
- data/test/rule_tests/consistent_bullet_styles_asterisk.md +0 -3
- data/test/rule_tests/consistent_bullet_styles_dash.md +0 -3
- data/test/rule_tests/consistent_bullet_styles_plus.md +0 -3
- data/test/rule_tests/default_test_style.rb +0 -5
- data/test/rule_tests/emphasis_instead_of_headers.md +0 -40
- data/test/rule_tests/empty_doc.md +0 -0
- data/test/rule_tests/fenced_code_blocks.md +0 -27
- data/test/rule_tests/fenced_code_with_nesting.md +0 -73
- data/test/rule_tests/fenced_code_without_blank_lines.md +0 -42
- data/test/rule_tests/fenced_code_without_blank_lines_style.rb +0 -3
- data/test/rule_tests/first_header_bad_atx.md +0 -1
- data/test/rule_tests/first_header_bad_setext.md +0 -2
- data/test/rule_tests/first_header_good_atx.md +0 -1
- data/test/rule_tests/first_header_good_setext.md +0 -2
- data/test/rule_tests/first_line_top_level_header_atx.md +0 -3
- data/test/rule_tests/first_line_top_level_header_atx_style.rb +0 -2
- data/test/rule_tests/first_line_top_level_header_setext.md +0 -4
- data/test/rule_tests/first_line_top_level_header_setext_style.rb +0 -2
- data/test/rule_tests/fix_102_extra_nodes_in_link_text.md +0 -8
- data/test/rule_tests/header_duplicate_content.md +0 -11
- data/test/rule_tests/header_duplicate_content_different_nesting.md +0 -11
- data/test/rule_tests/header_duplicate_content_different_nesting_style.rb +0 -1
- data/test/rule_tests/header_duplicate_content_no_different_nesting.md +0 -13
- data/test/rule_tests/header_multiple_toplevel.md +0 -3
- data/test/rule_tests/header_mutliple_h1_no_toplevel.md +0 -5
- data/test/rule_tests/header_trailing_punctuation.md +0 -11
- data/test/rule_tests/header_trailing_punctuation_customized.md +0 -14
- data/test/rule_tests/header_trailing_punctuation_customized_style.rb +0 -2
- data/test/rule_tests/headers_bad.md +0 -7
- data/test/rule_tests/headers_good.md +0 -5
- data/test/rule_tests/headers_good_setext_with_atx.md +0 -7
- data/test/rule_tests/headers_good_setext_with_atx_style.rb +0 -2
- data/test/rule_tests/headers_good_with_issue_numbers.md +0 -12
- data/test/rule_tests/headers_surrounding_space_atx.md +0 -12
- data/test/rule_tests/headers_surrounding_space_setext.md +0 -15
- data/test/rule_tests/headers_with_spaces_at_the_beginning.md +0 -20
- data/test/rule_tests/hr_style_dashes.md +0 -22
- data/test/rule_tests/hr_style_dashes_style.rb +0 -3
- data/test/rule_tests/hr_style_inconsistent.md +0 -22
- data/test/rule_tests/hr_style_long.md +0 -22
- data/test/rule_tests/hr_style_long_style.rb +0 -3
- data/test/rule_tests/hr_style_stars.md +0 -22
- data/test/rule_tests/hr_style_stars_style.rb +0 -3
- data/test/rule_tests/inconsistent_bullet_indent_same_level.md +0 -4
- data/test/rule_tests/inconsistent_bullet_styles_asterisk.md +0 -3
- data/test/rule_tests/inconsistent_bullet_styles_dash.md +0 -3
- data/test/rule_tests/inconsistent_bullet_styles_plus.md +0 -3
- data/test/rule_tests/incorrect_bullet_style_asterisk.md +0 -3
- data/test/rule_tests/incorrect_bullet_style_asterisk_style.rb +0 -3
- data/test/rule_tests/incorrect_bullet_style_dash.md +0 -3
- data/test/rule_tests/incorrect_bullet_style_dash_style.rb +0 -3
- data/test/rule_tests/incorrect_bullet_style_plus.md +0 -3
- data/test/rule_tests/incorrect_bullet_style_plus_style.rb +0 -3
- data/test/rule_tests/incorrect_header_atx.md +0 -6
- data/test/rule_tests/incorrect_header_atx_closed.md +0 -6
- data/test/rule_tests/incorrect_header_atx_closed_style.rb +0 -2
- data/test/rule_tests/incorrect_header_atx_style.rb +0 -2
- data/test/rule_tests/incorrect_header_setext.md +0 -6
- data/test/rule_tests/incorrect_header_setext_style.rb +0 -2
- data/test/rule_tests/inline_html.md +0 -13
- data/test/rule_tests/links.md +0 -9
- data/test/rule_tests/lists_without_blank_lines.md +0 -75
- data/test/rule_tests/long_lines.md +0 -3
- data/test/rule_tests/long_lines_100.md +0 -7
- data/test/rule_tests/long_lines_100_style.rb +0 -3
- data/test/rule_tests/long_lines_code.md +0 -45
- data/test/rule_tests/long_lines_code_style.rb +0 -3
- data/test/rule_tests/mixed_header_types_atx.md +0 -6
- data/test/rule_tests/mixed_header_types_atx_closed.md +0 -6
- data/test/rule_tests/mixed_header_types_setext.md +0 -6
- data/test/rule_tests/no_first_line_header.md +0 -1
- data/test/rule_tests/no_first_line_header_style.rb +0 -1
- data/test/rule_tests/no_first_line_top_level_header.md +0 -1
- data/test/rule_tests/no_first_line_top_level_header_style.rb +0 -1
- data/test/rule_tests/ordered_list_item_prefix.md +0 -13
- data/test/rule_tests/ordered_list_item_prefix_ordered.md +0 -13
- data/test/rule_tests/ordered_list_item_prefix_ordered_style.rb +0 -3
- data/test/rule_tests/reversed_link.md +0 -7
- data/test/rule_tests/spaces_after_list_marker.md +0 -74
- data/test/rule_tests/spaces_after_list_marker_style.rb +0 -5
- data/test/rule_tests/spaces_inside_codespan_elements.md +0 -7
- data/test/rule_tests/spaces_inside_emphasis_markers.md +0 -35
- data/test/rule_tests/spaces_inside_link_text.md +0 -10
- data/test/rule_tests/trailing_spaces_br.md +0 -4
- data/test/rule_tests/trailing_spaces_br_style.rb +0 -3
- data/test/rule_tests/whitespace_issues.md +0 -3
- data/test/setup_tests.rb +0 -5
- data/test/test_cli.rb +0 -300
- data/test/test_ruledocs.rb +0 -52
- data/test/test_rules.rb +0 -58
- data/tools/README.md +0 -3
- data/tools/docker/Dockerfile +0 -13
- data/tools/docker/README.md +0 -19
- data/tools/test_location.rb +0 -20
- data/tools/view_markdown.rb +0 -11
data/.gitignore
DELETED
data/.travis.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
dist: trusty
|
3
|
-
language: ruby
|
4
|
-
|
5
|
-
notifications:
|
6
|
-
email: false
|
7
|
-
|
8
|
-
# Temporary disable of jruby testing. There are problems on travis-ci
|
9
|
-
# currently with this. See:
|
10
|
-
#
|
11
|
-
# https://github.com/travis-ci/travis-ci/issues/9826
|
12
|
-
#
|
13
|
-
# before_install:
|
14
|
-
# - unset _JAVA_OPTIONS
|
15
|
-
|
16
|
-
matrix:
|
17
|
-
include:
|
18
|
-
- rvm: 2.3.4
|
19
|
-
- rvm: 2.4.1
|
20
|
-
- rvm: 2.5.1
|
21
|
-
# - rvm: jruby-9.1.9.0
|
22
|
-
# env: JRUBY_OPTS="--dev"
|
23
|
-
# - rvm: jruby-9.2.0.0
|
data/CHANGELOG.md
DELETED
@@ -1,187 +0,0 @@
|
|
1
|
-
# Change Log
|
2
|
-
|
3
|
-
## [Unreleased]
|
4
|
-
|
5
|
-
### Changed
|
6
|
-
|
7
|
-
## [v0.5.0]
|
8
|
-
|
9
|
-
### Added
|
10
|
-
|
11
|
-
* Add md042 to enforce code block style
|
12
|
-
* JSON formatter/output
|
13
|
-
|
14
|
-
### Changed
|
15
|
-
|
16
|
-
* PR #200: allow different nesting on headers duplication check
|
17
|
-
* MD036 - Ignore multi-line emphasized paragraphs, and emphasized paragraphs
|
18
|
-
that end in punctuation (#140)
|
19
|
-
|
20
|
-
### Fixed
|
21
|
-
|
22
|
-
* PR #168: fix issue numbers false positives
|
23
|
-
* Fix issue #102: lint MD039 checking for nodes inside link text
|
24
|
-
|
25
|
-
## [v0.4.0] (2016-08-22)
|
26
|
-
|
27
|
-
### Added
|
28
|
-
|
29
|
-
* Ignore yaml front matter option (#130, #143)
|
30
|
-
|
31
|
-
### Changed
|
32
|
-
|
33
|
-
* Allow top level header rules (MD002, MD025, MD041) to be configurable (#142)
|
34
|
-
|
35
|
-
### Fixed
|
36
|
-
|
37
|
-
* Read UTF-8 files correctly even if locale is set to C (#135, #146, #147,
|
38
|
-
#148)
|
39
|
-
* Fix issues loading .mdlrc file (#126, #129, #133, #148)
|
40
|
-
* Fix erroneous triggering of MD022/MD023 in some cases (#144)
|
41
|
-
* Detect codeblock lines correctly when ignoring them (#141)
|
42
|
-
|
43
|
-
## [v0.3.1] (2016-03-20)
|
44
|
-
|
45
|
-
### Fixed
|
46
|
-
|
47
|
-
* Fix error on starting mdl
|
48
|
-
|
49
|
-
## [v0.3.0] (2016-03-19)
|
50
|
-
|
51
|
-
### Rules added
|
52
|
-
|
53
|
-
* MD041 - First line in file should be a top level header
|
54
|
-
|
55
|
-
### Added
|
56
|
-
|
57
|
-
* You can now load your own custom rules with the `-u` option. See
|
58
|
-
[rules.rb](https://github.com/markdownlint/markdownlint/blob/master/lib/mdl/rules.rb)
|
59
|
-
for an example of what a rules file looks like. Use the `-d` option if you
|
60
|
-
don't want to load markdownlint's default ruleset.
|
61
|
-
* You can now refer to rules by human-readable/writable aliases, such as
|
62
|
-
'ul-style' instead of 'MD004'. See RULES.md for a list of the rule aliases.
|
63
|
-
You can pass the `-a` option to display rule aliases instead of MDxxx rule
|
64
|
-
IDs.
|
65
|
-
|
66
|
-
### Changed
|
67
|
-
|
68
|
-
* MD003 - An additional header style, setext_with_atx, was added to require
|
69
|
-
setext style headers for levels 1 and 2, but allow atx style headers for
|
70
|
-
levels 3 and above (i.e. header levels that can't be expressed with setext
|
71
|
-
style headers)
|
72
|
-
* MD013 - You now have the option to exclude code blocks and tables from the
|
73
|
-
line length limit check.
|
74
|
-
|
75
|
-
### Fixed
|
76
|
-
|
77
|
-
* Crash with MD034 and pipe character (#93, #97)
|
78
|
-
* MD031 failed on nested code blocks (#100, #109)
|
79
|
-
* MD037 crashes on <li> with underscores (#83)
|
80
|
-
* Regression introduced in v0.2.1 - ignoring rules/tags on the command line
|
81
|
-
caused a crash (#108)
|
82
|
-
* MD027 false positive when line starts with a backtick (#105)
|
83
|
-
|
84
|
-
### Merged pull requests
|
85
|
-
|
86
|
-
* [Add support for nested code fences to MD031/MD032 - David
|
87
|
-
Anson](https://github.com/markdownlint/markdownlint/pull/109)
|
88
|
-
* [Add missing word to description of MD035 in RULES.md - David
|
89
|
-
Anson](https://github.com/markdownlint/markdownlint/pull/86)
|
90
|
-
* [Probe for .mdlrc in current and parent directories - Loic
|
91
|
-
Nageleisen](https://github.com/markdownlint/markdownlint/pull/111)
|
92
|
-
* [MD013: allow excluding code blocks and tables - Loic
|
93
|
-
Nageleisen](https://github.com/markdownlint/markdownlint/pull/112)
|
94
|
-
|
95
|
-
## [v0.2.1] (2015-04-13)
|
96
|
-
|
97
|
-
### Fixed
|
98
|
-
|
99
|
-
* Incorrect parsing of rules/tags specification in .mdlrc (#81)
|
100
|
-
* Exception on image links with MD039 (#82)
|
101
|
-
* MD037 flags on two words beginning with underscores on the same line. (#83)
|
102
|
-
|
103
|
-
### Known issues
|
104
|
-
|
105
|
-
* Exception on some lines with raw html list items in them (#83)
|
106
|
-
|
107
|
-
## [v0.2.0] (2015-04-13)
|
108
|
-
|
109
|
-
### Rules added
|
110
|
-
|
111
|
-
* MD033 - Inline HTML
|
112
|
-
* MD034 - Bare URL used
|
113
|
-
* MD035 - Horizontal rule style
|
114
|
-
* MD036 - Emphasis used instead of a header
|
115
|
-
* MD037 - Spaces inside emphasis markers
|
116
|
-
* MD038 - Spaces inside code span elements
|
117
|
-
* MD039 - Spaces inside link text
|
118
|
-
* MD040 - Fenced code blocks should have a language specified
|
119
|
-
|
120
|
-
## Added
|
121
|
-
|
122
|
-
* Trailing spaces rule should allow an excemption for deliberate <br/\>
|
123
|
-
insertion.
|
124
|
-
* Rules can be excluded in .mdlrc and on the command line by specifying a rule
|
125
|
-
as ~MD000.
|
126
|
-
|
127
|
-
### Merged pull requests
|
128
|
-
|
129
|
-
* [Add parameter (value and default) information to rule documentation. - David Anson](https://github.com/markdownlint/markdownlint/pull/76)
|
130
|
-
|
131
|
-
## [v0.1.0] (2015-02-22)
|
132
|
-
|
133
|
-
### Rules added
|
134
|
-
|
135
|
-
* MD031 - Fenced code blocks should be surrounded by blank lines
|
136
|
-
* MD032 - Lists should be surrounded by blank lines
|
137
|
-
|
138
|
-
### Fixed
|
139
|
-
|
140
|
-
* MD014 triggers when it shouldn't
|
141
|
-
|
142
|
-
### Merged pull requests
|
143
|
-
|
144
|
-
* [MD032 - Lists should be surrounded by blank lines - David Anson](https://github.com/markdownlint/markdownlint/pull/70)
|
145
|
-
* [MD031 - Fenced code blocks should be surrounded by blank lines - David Anson](https://github.com/markdownlint/markdownlint/pull/68)
|
146
|
-
* [Clarify how to specify your own style - mjankowski](https://github.com/markdownlint/markdownlint/pull/65)
|
147
|
-
* [Use single quotes to prevent early escaping - highb](https://github.com/markdownlint/markdownlint/pull/64)
|
148
|
-
|
149
|
-
## [v0.0.1] (2014-09-07)
|
150
|
-
|
151
|
-
### Rules added
|
152
|
-
|
153
|
-
* MD001 - Header levels should only increment by one level at a time
|
154
|
-
* MD002 - First header should be a h1 header
|
155
|
-
* MD003 - Header style
|
156
|
-
* MD004 - Unordered list style
|
157
|
-
* MD005 - Inconsistent indentation for list items at the same level
|
158
|
-
* MD006 - Consider starting bulleted lists at the beginning of the line
|
159
|
-
* MD007 - Unordered list indentation
|
160
|
-
* MD009 - Trailing spaces
|
161
|
-
* MD010 - Hard tabs
|
162
|
-
* MD011 - Reversed link syntax
|
163
|
-
* MD012 - Multiple consecutive blank lines
|
164
|
-
* MD013 - Line length
|
165
|
-
* MD014 - Dollar signs used before commands without showing output
|
166
|
-
* MD018 - No space after hash on atx style header
|
167
|
-
* MD019 - Multiple spaces after hash on atx style header
|
168
|
-
* MD020 - No space inside hashes on closed atx style header
|
169
|
-
* MD021 - Multiple spaces inside hashes on closed atx style header
|
170
|
-
* MD022 - Headers should be surrounded by blank lines
|
171
|
-
* MD023 - Headers must start at the beginning of the line
|
172
|
-
* MD024 - Multiple headers with the same content
|
173
|
-
* MD025 - Multiple top level headers in the same document
|
174
|
-
* MD026 - Trailing punctuation in header
|
175
|
-
* MD027 - Multiple spaces after blockquote symbol
|
176
|
-
* MD028 - Blank line inside blockquote
|
177
|
-
* MD029 - Ordered list item prefix
|
178
|
-
* MD030 - Spaces after list markers
|
179
|
-
|
180
|
-
[Unreleased]: https://github.com/markdownlint/markdownlint/tree/master
|
181
|
-
[v0.4.0]: https://github.com/markdownlint/markdownlint/tree/v0.4.0
|
182
|
-
[v0.3.1]: https://github.com/markdownlint/markdownlint/tree/v0.3.1
|
183
|
-
[v0.3.0]: https://github.com/markdownlint/markdownlint/tree/v0.3.0
|
184
|
-
[v0.2.1]: https://github.com/markdownlint/markdownlint/tree/v0.2.1
|
185
|
-
[v0.2.0]: https://github.com/markdownlint/markdownlint/tree/v0.2.0
|
186
|
-
[v0.1.0]: https://github.com/markdownlint/markdownlint/tree/v0.1.0
|
187
|
-
[v0.0.1]: https://github.com/markdownlint/markdownlint/tree/v0.0.1
|
data/README.md
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
[![Issues on deck](https://badge.waffle.io/mivok/markdownlint.png?label=on%20deck&title=On%20Deck)](https://waffle.io/mivok/markdownlint)
|
2
|
-
[![Travis build status](http://api.travis-ci.org/markdownlint/markdownlint.svg)](https://travis-ci.org/markdownlint/markdownlint)
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/mdl.svg)](http://badge.fury.io/rb/mdl)
|
4
|
-
|
5
|
-
# Markdown lint tool
|
6
|
-
|
7
|
-
A tool to check markdown files and flag style issues.
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
Markdownlint is written in ruby and is distributed as a rubygem. As long as
|
12
|
-
you have a relatively up to date ruby on your system, markdownlint will be
|
13
|
-
simple to install and use. You have 2 options to install it:
|
14
|
-
|
15
|
-
To install from rubygems, run:
|
16
|
-
|
17
|
-
gem install mdl
|
18
|
-
|
19
|
-
To install the latest development version from github:
|
20
|
-
|
21
|
-
git clone https://github.com/markdownlint/markdownlint
|
22
|
-
cd markdownlint
|
23
|
-
rake install
|
24
|
-
|
25
|
-
|
26
|
-
Note that you will need [rake](https://github.com/ruby/rake)
|
27
|
-
(`gem install rake`) and [bundler](https://github.com/bundler/bundler)
|
28
|
-
(`gem install bundler`) in order to build from source.
|
29
|
-
|
30
|
-
## Usage
|
31
|
-
|
32
|
-
To have markdownlint check your markdown files, simply run `mdl` with the
|
33
|
-
filenames as a parameter:
|
34
|
-
|
35
|
-
mdl README.md
|
36
|
-
|
37
|
-
Markdownlint can also take a directory, and it will scan all markdown files
|
38
|
-
within the directory (and nested directories):
|
39
|
-
|
40
|
-
mdl docs/
|
41
|
-
|
42
|
-
If you don't specify a filename, markdownlint will use stdin:
|
43
|
-
|
44
|
-
cat foo.md | mdl
|
45
|
-
|
46
|
-
Markdownlint will output a list of issues it finds, and the line number where
|
47
|
-
the issue is. See [RULES.md](docs/RULES.md) for information on each issue, as
|
48
|
-
well as how to correct it:
|
49
|
-
|
50
|
-
README.md:1: MD013 Line length
|
51
|
-
README.md:70: MD029 Ordered list item prefix
|
52
|
-
README.md:71: MD029 Ordered list item prefix
|
53
|
-
README.md:72: MD029 Ordered list item prefix
|
54
|
-
README.md:73: MD029 Ordered list item prefix
|
55
|
-
|
56
|
-
Markdownlint has many more options you can pass on the command line, run
|
57
|
-
`mdl --help` to see what they are, or see the documentation on
|
58
|
-
[configuring markdownlint](docs/configuration.md).
|
59
|
-
|
60
|
-
### Styles
|
61
|
-
|
62
|
-
Not everyone writes markdown in the same way, and there are multiple flavors
|
63
|
-
and styles, each of which are valid. While markdownlint's default settings
|
64
|
-
will result in markdown files that reflect the author's preferred markdown
|
65
|
-
authoring preferences, your project may have different guidelines.
|
66
|
-
|
67
|
-
It's not markdownlint's intention to dictate any one specific style, and in
|
68
|
-
order to support these differing styles and/or preferences, markdownlint
|
69
|
-
supports what are called 'style files'. A style file is a file describing
|
70
|
-
which rules markdownlint should enable, and also what settings to apply to
|
71
|
-
individual rules. For example, rule [MD013](docs/RULES.md#md013---line-length)
|
72
|
-
checks for long lines, and by default will report an issue for any line longer
|
73
|
-
than 80 characters. If your project has a different maximum line length limit,
|
74
|
-
or if you don't want to enforce a line limit at all, then this can be
|
75
|
-
configured in a style file.
|
76
|
-
|
77
|
-
For more information on creating style files, see the
|
78
|
-
[creating styles](docs/creating_styles.md) document.
|
79
|
-
|
80
|
-
## Contributing
|
81
|
-
|
82
|
-
1. Fork it ( <http://github.com/markdownlint/markdownlint/fork> )
|
83
|
-
1. Create your feature branch (`git checkout -b my-new-feature`)
|
84
|
-
1. Commit your changes (`git commit -am 'Add some feature'`)
|
85
|
-
1. Push to the branch (`git push origin my-new-feature`)
|
86
|
-
1. Create new Pull Request
|
data/Rakefile
DELETED
data/docs/RULES.md
DELETED
@@ -1,1047 +0,0 @@
|
|
1
|
-
# Rules
|
2
|
-
|
3
|
-
This document contains a description of all rules, what they are checking for,
|
4
|
-
as well as an examples of documents that break the rule and corrected
|
5
|
-
versions of the examples.
|
6
|
-
|
7
|
-
## MD001 - Header levels should only increment by one level at a time
|
8
|
-
|
9
|
-
Tags: headers
|
10
|
-
|
11
|
-
Aliases: header-increment
|
12
|
-
|
13
|
-
This rule is triggered when you skip header levels in a markdown document, for
|
14
|
-
example:
|
15
|
-
|
16
|
-
# Header 1
|
17
|
-
|
18
|
-
### Header 3
|
19
|
-
|
20
|
-
We skipped out a 2nd level header in this document
|
21
|
-
|
22
|
-
When using multiple header levels, nested headers should increase by only one
|
23
|
-
level at a time:
|
24
|
-
|
25
|
-
# Header 1
|
26
|
-
|
27
|
-
## Header 2
|
28
|
-
|
29
|
-
### Header 3
|
30
|
-
|
31
|
-
#### Header 4
|
32
|
-
|
33
|
-
## Another Header 2
|
34
|
-
|
35
|
-
### Another Header 3
|
36
|
-
|
37
|
-
|
38
|
-
## MD002 - First header should be a top level header
|
39
|
-
|
40
|
-
Tags: headers
|
41
|
-
|
42
|
-
Aliases: first-header-h1
|
43
|
-
|
44
|
-
Parameters: level (number; default 1)
|
45
|
-
|
46
|
-
This rule is triggered when the first header in the document isn't a h1 header:
|
47
|
-
|
48
|
-
## This isn't a H1 header
|
49
|
-
|
50
|
-
### Another header
|
51
|
-
|
52
|
-
The first header in the document should be a h1 header:
|
53
|
-
|
54
|
-
# Start with a H1 header
|
55
|
-
|
56
|
-
## Then use a H2 for subsections
|
57
|
-
|
58
|
-
## MD003 - Header style
|
59
|
-
|
60
|
-
Tags: headers
|
61
|
-
|
62
|
-
Aliases: header-style
|
63
|
-
|
64
|
-
Parameters: style ("consistent", "atx", "atx_closed", "setext", "setext_with_atx"; default "consistent")
|
65
|
-
|
66
|
-
This rule is triggered when different header styles (atx, setext, and 'closed'
|
67
|
-
atx) are used in the same document:
|
68
|
-
|
69
|
-
# ATX style H1
|
70
|
-
|
71
|
-
## Closed ATX style H2 ##
|
72
|
-
|
73
|
-
Setext style H1
|
74
|
-
===============
|
75
|
-
|
76
|
-
Be consistent with the style of header used in a document:
|
77
|
-
|
78
|
-
# ATX style H1
|
79
|
-
|
80
|
-
## ATX style H2
|
81
|
-
|
82
|
-
The setext_with_atx doc style allows atx-style headers of level 3 or more in
|
83
|
-
documents with setext style headers:
|
84
|
-
|
85
|
-
Setext style H1
|
86
|
-
===============
|
87
|
-
|
88
|
-
Setext style H2
|
89
|
-
---------------
|
90
|
-
|
91
|
-
### ATX style H3
|
92
|
-
|
93
|
-
Note: the configured header style can be a specific style to use (atx,
|
94
|
-
atx_closed, setext, setext_with_atx), or simply require that the usage be
|
95
|
-
consistent within the document.
|
96
|
-
|
97
|
-
## MD004 - Unordered list style
|
98
|
-
|
99
|
-
Tags: bullet, ul
|
100
|
-
|
101
|
-
Aliases: ul-style
|
102
|
-
|
103
|
-
Parameters: style ("consistent", "asterisk", "plus", "dash"; default "consistent")
|
104
|
-
|
105
|
-
This rule is triggered when the symbols used in the document for unordered
|
106
|
-
list items do not match the configured unordered list style:
|
107
|
-
|
108
|
-
* Item 1
|
109
|
-
+ Item 2
|
110
|
-
- Item 3
|
111
|
-
|
112
|
-
To fix this issue, use the configured style for list items throughout the
|
113
|
-
document:
|
114
|
-
|
115
|
-
* Item 1
|
116
|
-
* Item 2
|
117
|
-
* Item 3
|
118
|
-
|
119
|
-
Note: the configured list style can be a specific symbol to use (asterisk,
|
120
|
-
plus, dash), or simply require that the usage be consistent within the
|
121
|
-
document.
|
122
|
-
|
123
|
-
## MD005 - Inconsistent indentation for list items at the same level
|
124
|
-
|
125
|
-
Tags: bullet, ul, indentation
|
126
|
-
|
127
|
-
Aliases: list-indent
|
128
|
-
|
129
|
-
This rule is triggered when list items are parsed as being at the same level,
|
130
|
-
but don't have the same indentation:
|
131
|
-
|
132
|
-
* Item 1
|
133
|
-
* Nested Item 1
|
134
|
-
* Nested Item 2
|
135
|
-
* A misaligned item
|
136
|
-
|
137
|
-
Usually this rule will be triggered because of a typo. Correct the indentation
|
138
|
-
for the list to fix it:
|
139
|
-
|
140
|
-
* Item 1
|
141
|
-
* Nested Item 1
|
142
|
-
* Nested Item 2
|
143
|
-
* Nested Item 3
|
144
|
-
|
145
|
-
## MD006 - Consider starting bulleted lists at the beginning of the line
|
146
|
-
|
147
|
-
Tags: bullet, ul, indentation
|
148
|
-
|
149
|
-
Aliases: ul-start-left
|
150
|
-
|
151
|
-
This rule is triggered when top level lists don't start at the beginning of a
|
152
|
-
line:
|
153
|
-
|
154
|
-
Some text
|
155
|
-
|
156
|
-
* List item
|
157
|
-
* List item
|
158
|
-
|
159
|
-
To fix, ensure that top level list items are not indented:
|
160
|
-
|
161
|
-
|
162
|
-
Some test
|
163
|
-
|
164
|
-
* List item
|
165
|
-
* List item
|
166
|
-
|
167
|
-
Rationale: Starting lists at the beginning of the line means that nested list
|
168
|
-
items can all be indented by the same amount when an editor's indent function
|
169
|
-
or the tab key is used to indent. Starting a list 1 space in means that the
|
170
|
-
indent of the first nested list is less than the indent of the second level (3
|
171
|
-
characters if you use 4 space tabs, or 1 character if you use 2 space tabs).
|
172
|
-
|
173
|
-
## MD007 - Unordered list indentation
|
174
|
-
|
175
|
-
Tags: bullet, ul, indentation
|
176
|
-
|
177
|
-
Aliases: ul-indent
|
178
|
-
|
179
|
-
Parameters: indent (number; default 2)
|
180
|
-
|
181
|
-
This rule is triggered when list items are not indented by the configured
|
182
|
-
number of spaces (default: 2).
|
183
|
-
|
184
|
-
Example:
|
185
|
-
|
186
|
-
* List item
|
187
|
-
* Nested list item indented by 3 spaces
|
188
|
-
|
189
|
-
Corrected Example:
|
190
|
-
|
191
|
-
* List item
|
192
|
-
* Nested list item indented by 2 spaces
|
193
|
-
|
194
|
-
Rationale (2 space indent): indenting by 2 spaces allows the content of a
|
195
|
-
nested list to be in line with the start of the content of the parent list
|
196
|
-
when a single space is used after the list marker.
|
197
|
-
|
198
|
-
Rationale (4 space indent): Same indent as code blocks, simpler for editors to
|
199
|
-
implement. See
|
200
|
-
<http://www.cirosantilli.com/markdown-styleguide/#indented-lists> for more
|
201
|
-
information.
|
202
|
-
|
203
|
-
In addition, this is a compatibility issue with multi-markdown parsers, which
|
204
|
-
require a 4 space indents. See
|
205
|
-
<http://support.markedapp.com/discussions/problems/21-sub-lists-not-indenting>
|
206
|
-
for a description of the problem.
|
207
|
-
|
208
|
-
## MD009 - Trailing spaces
|
209
|
-
|
210
|
-
Tags: whitespace
|
211
|
-
|
212
|
-
Aliases: no-trailing-spaces
|
213
|
-
|
214
|
-
Parameters: br_spaces (number; default: 0)
|
215
|
-
|
216
|
-
This rule is triggered on any lines that end with whitespace. To fix this,
|
217
|
-
find the line that is triggered and remove any trailing spaces from the end.
|
218
|
-
|
219
|
-
The br_spaces parameter allows an exception to this rule for a specific amount
|
220
|
-
of trailing spaces used to insert an explicit line break/br element. For
|
221
|
-
example, set br_spaces to 2 to allow exactly 2 spaces at the end of a line.
|
222
|
-
|
223
|
-
Note: you have to set br_spaces to 2 or higher for this exception to take
|
224
|
-
effect - you can't insert a br element with just a single trailing space, so
|
225
|
-
if you set br_spaces to 1, the exception will be disabled, just as if it was
|
226
|
-
set to the default of 0.
|
227
|
-
|
228
|
-
## MD010 - Hard tabs
|
229
|
-
|
230
|
-
Tags: whitespace, hard_tab
|
231
|
-
|
232
|
-
Aliases: no-hard-tabs
|
233
|
-
|
234
|
-
This rule is triggered by any lines that contain hard tab characters instead
|
235
|
-
of using spaces for indentation. To fix this, replace any hard tab characters
|
236
|
-
with spaces instead.
|
237
|
-
|
238
|
-
Example:
|
239
|
-
|
240
|
-
Some text
|
241
|
-
|
242
|
-
* hard tab character used to indent the list item
|
243
|
-
|
244
|
-
Corrected example:
|
245
|
-
|
246
|
-
Some text
|
247
|
-
|
248
|
-
* Spaces used to indent the list item instead
|
249
|
-
|
250
|
-
## MD011 - Reversed link syntax
|
251
|
-
|
252
|
-
Tags: links
|
253
|
-
|
254
|
-
Aliases: no-reversed-links
|
255
|
-
|
256
|
-
This rule is triggered when text that appears to be a link is encountered, but
|
257
|
-
where the syntax appears to have been reversed (the `[]` and `()` are
|
258
|
-
reversed):
|
259
|
-
|
260
|
-
(Incorrect link syntax)[http://www.example.com/]
|
261
|
-
|
262
|
-
To fix this, swap the `[]` and `()` around:
|
263
|
-
|
264
|
-
[Correct link syntax](http://www.example.com/)
|
265
|
-
|
266
|
-
## MD012 - Multiple consecutive blank lines
|
267
|
-
|
268
|
-
Tags: whitespace, blank_lines
|
269
|
-
|
270
|
-
Aliases: no-multiple-blanks
|
271
|
-
|
272
|
-
This rule is triggered when there are multiple consecutive blank lines in the
|
273
|
-
document:
|
274
|
-
|
275
|
-
Some text here
|
276
|
-
|
277
|
-
|
278
|
-
Some more text here
|
279
|
-
|
280
|
-
To fix this, delete the offending lines:
|
281
|
-
|
282
|
-
Some text here
|
283
|
-
|
284
|
-
Some more text here
|
285
|
-
|
286
|
-
Note: this rule will not be triggered if there are multiple consecutive blank
|
287
|
-
lines inside code blocks.
|
288
|
-
|
289
|
-
## MD013 - Line length
|
290
|
-
|
291
|
-
Tags: line_length
|
292
|
-
|
293
|
-
Aliases: line-length
|
294
|
-
Parameters: line_length, code_blocks, tables (number; default 80, boolean; default true)
|
295
|
-
|
296
|
-
This rule is triggered when there are lines that are longer than the
|
297
|
-
configured line length (default: 80 characters). To fix this, split the line
|
298
|
-
up into multiple lines.
|
299
|
-
|
300
|
-
This rule has an exception where there is no whitespace beyond the configured
|
301
|
-
line length. This allows you to still include items such as long URLs without
|
302
|
-
being forced to break them in the middle.
|
303
|
-
|
304
|
-
You also have the option to exclude this rule for code blocks and tables. To
|
305
|
-
do this, set the `code_blocks` and/or `tables` parameters to false.
|
306
|
-
|
307
|
-
Code blocks are included in this rule by default since it is often a
|
308
|
-
requirement for document readability, and tentatively compatible with code
|
309
|
-
rules. Still, some languages do not lend themselves to short lines.
|
310
|
-
|
311
|
-
## MD014 - Dollar signs used before commands without showing output
|
312
|
-
|
313
|
-
Tags: code
|
314
|
-
|
315
|
-
Aliases: commands-show-output
|
316
|
-
|
317
|
-
This rule is triggered when there are code blocks showing shell commands to be
|
318
|
-
typed, and the shell commands are preceded by dollar signs ($):
|
319
|
-
|
320
|
-
$ ls
|
321
|
-
$ cat foo
|
322
|
-
$ less bar
|
323
|
-
|
324
|
-
The dollar signs are unnecessary in the above situation, and should not be
|
325
|
-
included:
|
326
|
-
|
327
|
-
ls
|
328
|
-
cat foo
|
329
|
-
less bar
|
330
|
-
|
331
|
-
However, an exception is made when there is a need to distinguish between
|
332
|
-
typed commands and command output, as in the following example:
|
333
|
-
|
334
|
-
$ ls
|
335
|
-
foo bar
|
336
|
-
$ cat foo
|
337
|
-
Hello world
|
338
|
-
$ cat bar
|
339
|
-
baz
|
340
|
-
|
341
|
-
Rationale: it is easier to copy and paste and less noisy if the dollar signs
|
342
|
-
are omitted when they are not needed. See
|
343
|
-
<http://www.cirosantilli.com/markdown-styleguide/#dollar-signs-in-shell-code>
|
344
|
-
for more information.
|
345
|
-
|
346
|
-
## MD018 - No space after hash on atx style header
|
347
|
-
|
348
|
-
Tags: headers, atx, spaces
|
349
|
-
|
350
|
-
Aliases: no-missing-space-atx
|
351
|
-
|
352
|
-
This rule is triggered when spaces are missing after the hash characters
|
353
|
-
in an atx style header:
|
354
|
-
|
355
|
-
#Header 1
|
356
|
-
|
357
|
-
##Header 2
|
358
|
-
|
359
|
-
To fix this, separate the header text from the hash character by a single
|
360
|
-
space:
|
361
|
-
|
362
|
-
# Header 1
|
363
|
-
|
364
|
-
## Header 2
|
365
|
-
|
366
|
-
## MD019 - Multiple spaces after hash on atx style header
|
367
|
-
|
368
|
-
Tags: headers, atx, spaces
|
369
|
-
|
370
|
-
Aliases: no-multiple-space-atx
|
371
|
-
|
372
|
-
This rule is triggered when more than one space is used to separate the
|
373
|
-
header text from the hash characters in an atx style header:
|
374
|
-
|
375
|
-
# Header 1
|
376
|
-
|
377
|
-
## Header 2
|
378
|
-
|
379
|
-
To fix this, separate the header text from the hash character by a single
|
380
|
-
space:
|
381
|
-
|
382
|
-
# Header 1
|
383
|
-
|
384
|
-
## Header 2
|
385
|
-
|
386
|
-
## MD020 - No space inside hashes on closed atx style header
|
387
|
-
|
388
|
-
Tags: headers, atx_closed, spaces
|
389
|
-
|
390
|
-
Aliases: no-missing-space-closed-atx
|
391
|
-
|
392
|
-
This rule is triggered when spaces are missing inside the hash characters
|
393
|
-
in a closed atx style header:
|
394
|
-
|
395
|
-
#Header 1#
|
396
|
-
|
397
|
-
##Header 2##
|
398
|
-
|
399
|
-
To fix this, separate the header text from the hash character by a single
|
400
|
-
space:
|
401
|
-
|
402
|
-
# Header 1 #
|
403
|
-
|
404
|
-
## Header 2 ##
|
405
|
-
|
406
|
-
Note: this rule will fire if either side of the header is missing spaces.
|
407
|
-
|
408
|
-
## MD021 - Multiple spaces inside hashes on closed atx style header
|
409
|
-
|
410
|
-
Tags: headers, atx_closed, spaces
|
411
|
-
|
412
|
-
Aliases: no-multiple-space-closed-atx
|
413
|
-
|
414
|
-
This rule is triggered when more than one space is used to separate the
|
415
|
-
header text from the hash characters in a closed atx style header:
|
416
|
-
|
417
|
-
# Header 1 #
|
418
|
-
|
419
|
-
## Header 2 ##
|
420
|
-
|
421
|
-
To fix this, separate the header text from the hash character by a single
|
422
|
-
space:
|
423
|
-
|
424
|
-
# Header 1 #
|
425
|
-
|
426
|
-
## Header 2 ##
|
427
|
-
|
428
|
-
Note: this rule will fire if either side of the header contains multiple
|
429
|
-
spaces.
|
430
|
-
|
431
|
-
## MD022 - Headers should be surrounded by blank lines
|
432
|
-
|
433
|
-
Tags: headers, blank_lines
|
434
|
-
|
435
|
-
Aliases: blanks-around-headers
|
436
|
-
|
437
|
-
This rule is triggered when headers (any style) are either not preceded or not
|
438
|
-
followed by a blank line:
|
439
|
-
|
440
|
-
# Header 1
|
441
|
-
Some text
|
442
|
-
|
443
|
-
Some more text
|
444
|
-
## Header 2
|
445
|
-
|
446
|
-
To fix this, ensure that all headers have a blank line both before and after
|
447
|
-
(except where the header is at the beginning or end of the document):
|
448
|
-
|
449
|
-
# Header 1
|
450
|
-
|
451
|
-
Some text
|
452
|
-
|
453
|
-
Some more text
|
454
|
-
|
455
|
-
## Header 2
|
456
|
-
|
457
|
-
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
458
|
-
not parse headers that don't have a blank line before, and will parse them as
|
459
|
-
regular text.
|
460
|
-
|
461
|
-
## MD023 - Headers must start at the beginning of the line
|
462
|
-
|
463
|
-
Tags: headers, spaces
|
464
|
-
|
465
|
-
Aliases: header-start-left
|
466
|
-
|
467
|
-
This rule is triggered when a header is indented by one or more spaces:
|
468
|
-
|
469
|
-
Some text
|
470
|
-
|
471
|
-
# Indented header
|
472
|
-
|
473
|
-
To fix this, ensure that all headers start at the beginning of the line:
|
474
|
-
|
475
|
-
Some text
|
476
|
-
|
477
|
-
# Header
|
478
|
-
|
479
|
-
Rationale: Headers that don't start at the beginning of the line will not be
|
480
|
-
parsed as headers, and will instead appear as regular text.
|
481
|
-
|
482
|
-
## MD024 - Multiple headers with the same content
|
483
|
-
|
484
|
-
Tags: headers
|
485
|
-
|
486
|
-
Aliases: no-duplicate-header
|
487
|
-
|
488
|
-
Parameters: allow_different_nesting (boolean; default false)
|
489
|
-
|
490
|
-
This rule is triggered if there are multiple headers in the document that have
|
491
|
-
the same text:
|
492
|
-
|
493
|
-
# Some text
|
494
|
-
|
495
|
-
## Some text
|
496
|
-
|
497
|
-
To fix this, ensure that the content of each header is different:
|
498
|
-
|
499
|
-
# Some text
|
500
|
-
|
501
|
-
## Some more text
|
502
|
-
|
503
|
-
Rationale: Some markdown parses generate anchors for headers based on the
|
504
|
-
header name, and having headers with the same content can cause problems with
|
505
|
-
this.
|
506
|
-
|
507
|
-
If the parameter `allow_different_nesting` is set to `true`, header duplication
|
508
|
-
under different nesting is allowed, like it usually happens in change logs:
|
509
|
-
|
510
|
-
# Change log
|
511
|
-
|
512
|
-
## 2.0.0
|
513
|
-
|
514
|
-
### Bug fixes
|
515
|
-
|
516
|
-
### Features
|
517
|
-
|
518
|
-
## 1.0.0
|
519
|
-
|
520
|
-
### Bug fixes
|
521
|
-
|
522
|
-
## MD025 - Multiple top level headers in the same document
|
523
|
-
|
524
|
-
Tags: headers
|
525
|
-
|
526
|
-
Aliases: single-h1
|
527
|
-
|
528
|
-
Parameters: level (number; default 1)
|
529
|
-
|
530
|
-
This rule is triggered when a top level header is in use (the first line of
|
531
|
-
the file is a h1 header), and more than one h1 header is in use in the
|
532
|
-
document:
|
533
|
-
|
534
|
-
# Top level header
|
535
|
-
|
536
|
-
# Another top level header
|
537
|
-
|
538
|
-
To fix, structure your document so that there is a single h1 header that is
|
539
|
-
the title for the document, and all later headers are h2 or lower level
|
540
|
-
headers:
|
541
|
-
|
542
|
-
# Title
|
543
|
-
|
544
|
-
## Header
|
545
|
-
|
546
|
-
## Another header
|
547
|
-
|
548
|
-
Rationale: A top level header is a h1 on the first line of the file, and
|
549
|
-
serves as the title for the document. If this convention is in use, then there
|
550
|
-
can not be more than one title for the document, and the entire document
|
551
|
-
should be contained within this header.
|
552
|
-
|
553
|
-
Note: The `level` parameter can be used to change the top level (ex: to h2) in
|
554
|
-
cases where an h1 is added externally.
|
555
|
-
|
556
|
-
## MD026 - Trailing punctuation in header
|
557
|
-
|
558
|
-
Tags: headers
|
559
|
-
|
560
|
-
Aliases: no-trailing-punctuation
|
561
|
-
|
562
|
-
Parameters: punctuation (string; default ".,;:!?")
|
563
|
-
|
564
|
-
This rule is triggered on any header that has a punctuation character as the
|
565
|
-
last character in the line:
|
566
|
-
|
567
|
-
# This is a header.
|
568
|
-
|
569
|
-
To fix this, remove any trailing punctuation:
|
570
|
-
|
571
|
-
# This is a header
|
572
|
-
|
573
|
-
Note: The punctuation parameter can be used to specify what characters class
|
574
|
-
as punctuation at the end of the header. For example, you can set it to
|
575
|
-
`'.,;:!'` to allow headers with question marks in them, such as might be used
|
576
|
-
in an FAQ.
|
577
|
-
|
578
|
-
## MD027 - Multiple spaces after blockquote symbol
|
579
|
-
|
580
|
-
Tags: blockquote, whitespace, indentation
|
581
|
-
|
582
|
-
Aliases: no-multiple-space-blockquote
|
583
|
-
|
584
|
-
This rule is triggered when blockquotes have more than one space after the
|
585
|
-
blockquote (`>`) symbol:
|
586
|
-
|
587
|
-
> This is a block quote with bad indentation
|
588
|
-
> there should only be one.
|
589
|
-
|
590
|
-
To fix, remove any extraneous space:
|
591
|
-
|
592
|
-
> This is a blockquote with correct
|
593
|
-
> indentation.
|
594
|
-
|
595
|
-
## MD028 - Blank line inside blockquote
|
596
|
-
|
597
|
-
Tags: blockquote, whitespace
|
598
|
-
|
599
|
-
Aliases: no-blanks-blockquote
|
600
|
-
|
601
|
-
This rule is triggered when two blockquote blocks are separated by nothing
|
602
|
-
except for a blank line:
|
603
|
-
|
604
|
-
> This is a blockquote
|
605
|
-
> which is immediately followed by
|
606
|
-
|
607
|
-
> this blockquote. Unfortunately
|
608
|
-
> In some parsers, these are treated as the same blockquote.
|
609
|
-
|
610
|
-
To fix this, ensure that any blockquotes that are right next to each other
|
611
|
-
have some text in between:
|
612
|
-
|
613
|
-
> This is a blockquote.
|
614
|
-
|
615
|
-
And Jimmy also said:
|
616
|
-
|
617
|
-
> This too is a blockquote.
|
618
|
-
|
619
|
-
Alternatively, if they are supposed to be the same quote, then add the
|
620
|
-
blockquote symbol at the beginning of the blank line:
|
621
|
-
|
622
|
-
> This is a blockquote.
|
623
|
-
>
|
624
|
-
> This is the same blockquote.
|
625
|
-
|
626
|
-
Rationale: Some markdown parsers will treat two blockquotes separated by one
|
627
|
-
or more blank lines as the same blockquote, while others will treat them as
|
628
|
-
separate blockquotes.
|
629
|
-
|
630
|
-
## MD029 - Ordered list item prefix
|
631
|
-
|
632
|
-
Tags: ol
|
633
|
-
|
634
|
-
Aliases: ol-prefix
|
635
|
-
|
636
|
-
Parameters: style ("one", "ordered"; default "one")
|
637
|
-
|
638
|
-
This rule is triggered on ordered lists that do not either start with '1.' or
|
639
|
-
do not have a prefix that increases in numerical order (depending on the
|
640
|
-
configured style, which defaults to 'one').
|
641
|
-
|
642
|
-
Example valid list if the style is configured as 'one':
|
643
|
-
|
644
|
-
1. Do this.
|
645
|
-
1. Do that.
|
646
|
-
1. Done.
|
647
|
-
|
648
|
-
Example valid list if the style is configured as 'ordered':
|
649
|
-
|
650
|
-
1. Do this.
|
651
|
-
2. Do that.
|
652
|
-
3. Done.
|
653
|
-
|
654
|
-
## MD030 - Spaces after list markers
|
655
|
-
|
656
|
-
Tags: ol, ul, whitespace
|
657
|
-
|
658
|
-
Aliases: list-marker-space
|
659
|
-
|
660
|
-
Parameters: ul_single, ol_single, ul_multi, ol_multi (number, default 1)
|
661
|
-
|
662
|
-
This rule checks for the number of spaces between a list marker (e.g. '`-`',
|
663
|
-
'`*`', '`+`' or '`1.`') and the text of the list item.
|
664
|
-
|
665
|
-
The number of spaces checked for depends on the document style in use, but the
|
666
|
-
default is 1 space after any list marker:
|
667
|
-
|
668
|
-
* Foo
|
669
|
-
* Bar
|
670
|
-
* Baz
|
671
|
-
|
672
|
-
1. Foo
|
673
|
-
1. Bar
|
674
|
-
1. Baz
|
675
|
-
|
676
|
-
1. Foo
|
677
|
-
* Bar
|
678
|
-
1. Baz
|
679
|
-
|
680
|
-
A document style may change the number of spaces after unordered list items
|
681
|
-
and ordered list items independently, as well as based on whether the content
|
682
|
-
of every item in the list consists of a single paragraph, or multiple
|
683
|
-
paragraphs (including sub-lists and code blocks).
|
684
|
-
|
685
|
-
For example, the style guide at
|
686
|
-
<http://www.cirosantilli.com/markdown-styleguide/#spaces-after-marker>
|
687
|
-
specifies that 1 space after the list marker should be used if every item in
|
688
|
-
the list fits within a single paragraph, but to use 2 or 3 spaces (for ordered
|
689
|
-
and unordered lists respectively) if there are multiple paragraphs of content
|
690
|
-
inside the list:
|
691
|
-
|
692
|
-
* Foo
|
693
|
-
* Bar
|
694
|
-
* Baz
|
695
|
-
|
696
|
-
vs.
|
697
|
-
|
698
|
-
* Foo
|
699
|
-
|
700
|
-
Second paragraph
|
701
|
-
|
702
|
-
* Bar
|
703
|
-
|
704
|
-
or
|
705
|
-
|
706
|
-
1. Foo
|
707
|
-
|
708
|
-
Second paragraph
|
709
|
-
|
710
|
-
1. Bar
|
711
|
-
|
712
|
-
To fix this, ensure the correct number of spaces are used after list marker
|
713
|
-
for your selected document style.
|
714
|
-
|
715
|
-
## MD031 - Fenced code blocks should be surrounded by blank lines
|
716
|
-
|
717
|
-
Tags: code, blank_lines
|
718
|
-
|
719
|
-
Aliases: blanks-around-fences
|
720
|
-
|
721
|
-
This rule is triggered when fenced code blocks are either not preceded or not
|
722
|
-
followed by a blank line:
|
723
|
-
|
724
|
-
Some text
|
725
|
-
```
|
726
|
-
Code block
|
727
|
-
```
|
728
|
-
|
729
|
-
```
|
730
|
-
Another code block
|
731
|
-
```
|
732
|
-
Some more text
|
733
|
-
|
734
|
-
To fix this, ensure that all fenced code blocks have a blank line both before
|
735
|
-
and after (except where the block is at the beginning or end of the document):
|
736
|
-
|
737
|
-
Some text
|
738
|
-
|
739
|
-
```
|
740
|
-
Code block
|
741
|
-
```
|
742
|
-
|
743
|
-
```
|
744
|
-
Another code block
|
745
|
-
```
|
746
|
-
|
747
|
-
Some more text
|
748
|
-
|
749
|
-
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
750
|
-
not parse fenced code blocks that don't have blank lines before and after them.
|
751
|
-
|
752
|
-
## MD032 - Lists should be surrounded by blank lines
|
753
|
-
|
754
|
-
Tags: bullet, ul, ol, blank_lines
|
755
|
-
|
756
|
-
Aliases: blanks-around-lists
|
757
|
-
|
758
|
-
This rule is triggered when lists (of any kind) are either not preceded or not
|
759
|
-
followed by a blank line:
|
760
|
-
|
761
|
-
Some text
|
762
|
-
* Some
|
763
|
-
* List
|
764
|
-
|
765
|
-
1. Some
|
766
|
-
2. List
|
767
|
-
Some text
|
768
|
-
|
769
|
-
To fix this, ensure that all lists have a blank line both before and after
|
770
|
-
(except where the block is at the beginning or end of the document):
|
771
|
-
|
772
|
-
Some text
|
773
|
-
|
774
|
-
* Some
|
775
|
-
* List
|
776
|
-
|
777
|
-
1. Some
|
778
|
-
2. List
|
779
|
-
|
780
|
-
Some text
|
781
|
-
|
782
|
-
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
783
|
-
not parse lists that don't have blank lines before and after them.
|
784
|
-
|
785
|
-
Note: List items without hanging indents are a violation of this rule; list
|
786
|
-
items with hanging indents are okay:
|
787
|
-
|
788
|
-
* This is
|
789
|
-
not okay
|
790
|
-
|
791
|
-
* This is
|
792
|
-
okay
|
793
|
-
|
794
|
-
## MD033 - Inline HTML
|
795
|
-
|
796
|
-
Tags: html
|
797
|
-
|
798
|
-
Aliases: no-inline-html
|
799
|
-
|
800
|
-
This rule is triggered whenever raw HTML is used in a markdown document:
|
801
|
-
|
802
|
-
<h1>Inline HTML header</h1>
|
803
|
-
|
804
|
-
To fix this, use 'pure' markdown instead of including raw HTML:
|
805
|
-
|
806
|
-
# Markdown header
|
807
|
-
|
808
|
-
Rationale: Raw HTML is allowed in markdown, but this rule is included for
|
809
|
-
those who want their documents to only include "pure" markdown, or for those
|
810
|
-
who are rendering markdown documents in something other than HTML.
|
811
|
-
|
812
|
-
## MD034 - Bare URL used
|
813
|
-
|
814
|
-
Tags: links, url
|
815
|
-
|
816
|
-
Aliases: no-bare-urls
|
817
|
-
|
818
|
-
This rule is triggered whenever a URL is given that isn't surrounded by angle
|
819
|
-
brackets:
|
820
|
-
|
821
|
-
For more information, see http://www.example.com/.
|
822
|
-
|
823
|
-
To fix this, add angle brackets around the URL:
|
824
|
-
|
825
|
-
For more information, see <http://www.example.com/>.
|
826
|
-
|
827
|
-
Rationale: Without angle brackets, the URL isn't converted into a link in many
|
828
|
-
markdown parsers.
|
829
|
-
|
830
|
-
Note: if you do want a bare URL without it being converted into a link,
|
831
|
-
enclose it in a code block, otherwise in some markdown parsers it _will_ be
|
832
|
-
converted:
|
833
|
-
|
834
|
-
`http://www.example.com`
|
835
|
-
|
836
|
-
## MD035 - Horizontal rule style
|
837
|
-
|
838
|
-
Tags: hr
|
839
|
-
|
840
|
-
Aliases: hr-style
|
841
|
-
|
842
|
-
Parameters: style ("consistent", "---", "***", or other string specifying the
|
843
|
-
horizontal rule; default "consistent")
|
844
|
-
|
845
|
-
This rule is triggered when inconsistent styles of horizontal rules are used
|
846
|
-
in the document:
|
847
|
-
|
848
|
-
---
|
849
|
-
|
850
|
-
- - -
|
851
|
-
|
852
|
-
***
|
853
|
-
|
854
|
-
* * *
|
855
|
-
|
856
|
-
****
|
857
|
-
|
858
|
-
To fix this, ensure any horizontal rules used in the document are consistent,
|
859
|
-
or match the given style if the rule is so configured:
|
860
|
-
|
861
|
-
---
|
862
|
-
|
863
|
-
---
|
864
|
-
|
865
|
-
Note: by default, this rule is configured to just require that all horizontal
|
866
|
-
rules in the document are the same, and will trigger if any of the horizontal
|
867
|
-
rules are different than the first one encountered in the document. If you
|
868
|
-
want to configure the rule to match a specific style, the parameter given to
|
869
|
-
the 'style' option is a string containing the exact horizontal rule text that
|
870
|
-
is allowed.
|
871
|
-
|
872
|
-
## MD036 - Emphasis used instead of a header
|
873
|
-
|
874
|
-
Tags: headers, emphasis
|
875
|
-
|
876
|
-
Parameters: punctuation (string; default ".,;:!?")
|
877
|
-
|
878
|
-
Aliases: no-emphasis-as-header
|
879
|
-
|
880
|
-
This check looks for instances where emphasized (i.e. bold or italic) text is
|
881
|
-
used to separate sections, where a header should be used instead:
|
882
|
-
|
883
|
-
**My document**
|
884
|
-
|
885
|
-
Lorem ipsum dolor sit amet...
|
886
|
-
|
887
|
-
_Another section_
|
888
|
-
|
889
|
-
Consectetur adipiscing elit, sed do eiusmod.
|
890
|
-
|
891
|
-
To fix this, use markdown headers instead of emphasized text to denote
|
892
|
-
sections:
|
893
|
-
|
894
|
-
# My document
|
895
|
-
|
896
|
-
Lorem ipsum dolor sit amet...
|
897
|
-
|
898
|
-
## Another section
|
899
|
-
|
900
|
-
Consectetur adipiscing elit, sed do eiusmod.
|
901
|
-
|
902
|
-
Note: this rule looks for single line paragraphs that consist entirely of
|
903
|
-
emphasized text. It won't fire on emphasis used within regular text,
|
904
|
-
multi-line emphasized paragraphs, and paragraphs ending in punctuation.
|
905
|
-
Similarly to rule MD026, you can configure what characters are recognized as
|
906
|
-
punctuation.
|
907
|
-
|
908
|
-
## MD037 - Spaces inside emphasis markers
|
909
|
-
|
910
|
-
Tags: whitespace, emphasis
|
911
|
-
|
912
|
-
Aliases: no-space-in-emphasis
|
913
|
-
|
914
|
-
This rule is triggered when emphasis markers (bold, italic) are used, but they
|
915
|
-
have spaces between the markers and the text:
|
916
|
-
|
917
|
-
Here is some ** bold ** text.
|
918
|
-
|
919
|
-
Here is some * italic * text.
|
920
|
-
|
921
|
-
Here is some more __ bold __ text.
|
922
|
-
|
923
|
-
Here is some more _ italic _ text.
|
924
|
-
|
925
|
-
To fix this, remove the spaces around the emphasis markers:
|
926
|
-
|
927
|
-
Here is some **bold** text.
|
928
|
-
|
929
|
-
Here is some *italic* text.
|
930
|
-
|
931
|
-
Here is some more __bold__ text.
|
932
|
-
|
933
|
-
Here is some more _italic_ text.
|
934
|
-
|
935
|
-
Rationale: Emphasis is only parsed as such when the asterisks/underscores
|
936
|
-
aren't completely surrounded by spaces. This rule attempts to detect where
|
937
|
-
they were surrounded by spaces, but it appears that emphasized text was
|
938
|
-
intended by the author.
|
939
|
-
|
940
|
-
## MD038 - Spaces inside code span elements
|
941
|
-
|
942
|
-
Tags: whitespace, code
|
943
|
-
|
944
|
-
Aliases: no-space-in-code
|
945
|
-
|
946
|
-
This rule is triggered on code span elements that have spaces right inside the
|
947
|
-
backticks:
|
948
|
-
|
949
|
-
` some text `
|
950
|
-
|
951
|
-
`some text `
|
952
|
-
|
953
|
-
` some text`
|
954
|
-
|
955
|
-
To fix this, remove the spaces inside the codespan markers:
|
956
|
-
|
957
|
-
`some text`
|
958
|
-
|
959
|
-
## MD039 - Spaces inside link text
|
960
|
-
|
961
|
-
Tags: whitespace, links
|
962
|
-
|
963
|
-
Aliases: no-space-in-links
|
964
|
-
|
965
|
-
This rule is triggered on links that have spaces surrounding the link text:
|
966
|
-
|
967
|
-
[ a link ](http://www.example.com/)
|
968
|
-
|
969
|
-
To fix this, remove the spaces surrounding the link text:
|
970
|
-
|
971
|
-
[a link](http://www.example.com/)
|
972
|
-
|
973
|
-
## MD040 - Fenced code blocks should have a language specified
|
974
|
-
|
975
|
-
Tags: code, language
|
976
|
-
|
977
|
-
Aliases: fenced-code-language
|
978
|
-
|
979
|
-
This rule is triggered when fenced code blocks are used, but a language isn't
|
980
|
-
specified:
|
981
|
-
|
982
|
-
```
|
983
|
-
#!/bin/bash
|
984
|
-
echo Hello world
|
985
|
-
```
|
986
|
-
|
987
|
-
To fix this, add a language specifier to the code block:
|
988
|
-
|
989
|
-
```bash
|
990
|
-
#!/bin/bash
|
991
|
-
echo Hello world
|
992
|
-
```
|
993
|
-
|
994
|
-
## MD041 - First line in file should be a top level header
|
995
|
-
|
996
|
-
Tags: headers
|
997
|
-
|
998
|
-
Aliases: first-line-h1
|
999
|
-
|
1000
|
-
Parameters: level (number; default 1)
|
1001
|
-
|
1002
|
-
This rule is triggered when the first line in the file isn't a top level (h1)
|
1003
|
-
header:
|
1004
|
-
|
1005
|
-
```
|
1006
|
-
This is a file without a header
|
1007
|
-
```
|
1008
|
-
|
1009
|
-
To fix this, add a header to the top of your file:
|
1010
|
-
|
1011
|
-
```
|
1012
|
-
# File with header
|
1013
|
-
|
1014
|
-
This is a file with a top level header
|
1015
|
-
```
|
1016
|
-
|
1017
|
-
Note: The `level` parameter can be used to change the top level (ex: to h2) in
|
1018
|
-
cases where an h1 is added externally.
|
1019
|
-
|
1020
|
-
## MD046 - Code block style
|
1021
|
-
|
1022
|
-
Tags: code
|
1023
|
-
|
1024
|
-
Aliases: code-block-style
|
1025
|
-
|
1026
|
-
Parameters: style ("fenced", "indented", "consistent", default "fenced")
|
1027
|
-
|
1028
|
-
This rule is truggered what a different code block style is used than the
|
1029
|
-
configured one. For example, in the default configuration this triggers:
|
1030
|
-
|
1031
|
-
Some text.
|
1032
|
-
|
1033
|
-
Code block
|
1034
|
-
|
1035
|
-
Some more text.
|
1036
|
-
|
1037
|
-
To fix this, used fenced code blocks:
|
1038
|
-
|
1039
|
-
Some text.
|
1040
|
-
|
1041
|
-
```ruby
|
1042
|
-
Code block
|
1043
|
-
```
|
1044
|
-
|
1045
|
-
Some more text.
|
1046
|
-
|
1047
|
-
Or the reverse for the `indented` style.
|