Expand description
The blank check: hygiene blank PATH... fails when a Markdown file
has two blank lines in a row.
§Design
One blank line ends a paragraph. A second blank line adds nothing,
and a diff that adds it is noise. So no Markdown file of the book
has two blank lines in a row
(01M51K1VMWTNZGD6PT1BYDGWM3). just wrap runs hygiene blank docs/src: each .md file in the folder and its subfolders.
The rule blank finds each blank line after a blank line. It skips
a code block: the text of a block is an example, as it is. A line
with only spaces is blank.
let errors = hygiene::blank::check("a.md", "# A\n\n\nText.\n");
assert_eq!(errors.len(), 1);
assert_eq!(errors[0].rule, "blank");
assert_eq!(errors[0].text, "a.md:3: a second blank line. Remove it.");
let block = "# A\n\n```text\none\n\n\ntwo\n```\n";
assert!(hygiene::blank::check("a.md", block).is_empty());Functions§
- check
- The errors of the Markdown file
namewith the contenttext: one for each line ofsecond_blank_lines. - second_
blank_ lines - The number of each blank line of
textthat follows a blank line, outside a code block. Each number counts from 1.