diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 9a1a976b..00000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -demo/markdown-it.min.js -demo/markdownlint-browser.js -demo/markdownlint-browser.min.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index fa2e0f94..00000000 --- a/.eslintrc +++ /dev/null @@ -1,186 +0,0 @@ -{ - "ecmaFeatures": {}, - "parser": "espree", - "env": { - "browser": false, - "node": true, - "amd": false, - "mocha": false, - "jasmine": false - }, - - "rules": { - "no-alert": 2, - "no-array-constructor": 2, - "no-bitwise": 0, - "no-caller": 2, - "no-catch-shadow": 2, - "no-comma-dangle": 2, - "no-cond-assign": 2, - "no-console": 2, - "no-constant-condition": 2, - "no-continue": 2, - "no-control-regex": 2, - "no-debugger": 2, - "no-delete-var": 2, - "no-div-regex": 2, - "no-dupe-keys": 2, - "no-dupe-args": 2, - "no-duplicate-case": 2, - "no-else-return": 2, - "no-empty": 2, - "no-empty-class": 2, - "no-empty-character-class": 2, - "no-empty-label": 2, - "no-eq-null": 2, - "no-eval": 2, - "no-ex-assign": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-extra-boolean-cast": 2, - "no-extra-parens": 0, - "no-extra-semi": 2, - "no-extra-strict": 2, - "no-fallthrough": 2, - "no-floating-decimal": 2, - "no-func-assign": 2, - "no-implied-eval": 2, - "no-inline-comments": 2, - "no-inner-declarations": [2, "functions"], - "no-invalid-regexp": 2, - "no-irregular-whitespace": 2, - "no-iterator": 2, - "no-label-var": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-lonely-if": 2, - "no-loop-func": 2, - "no-mixed-requires": [2, true], - "no-mixed-spaces-and-tabs": [2, false], - "linebreak-style": [0, "unix"], - "no-multi-spaces": 2, - "no-multi-str": 2, - "no-multiple-empty-lines": [2, {"max": 2}], - "no-native-reassign": 2, - "no-negated-in-lhs": 2, - "no-nested-ternary": 0, - "no-new": 2, - "no-new-func": 2, - "no-new-object": 2, - "no-new-require": 2, - "no-new-wrappers": 2, - "no-obj-calls": 2, - "no-octal": 2, - "no-octal-escape": 2, - "no-param-reassign": 0, - "no-path-concat": 2, - "no-plusplus": 0, - "no-process-env": 2, - "no-process-exit": 2, - "no-proto": 2, - "no-redeclare": 2, - "no-regex-spaces": 2, - "no-reserved-keys": 2, - "no-restricted-modules": 0, - "no-return-assign": 2, - "no-script-url": 2, - "no-self-compare": 2, - "no-sequences": 2, - "no-shadow": 2, - "no-shadow-restricted-names": 2, - "no-space-before-semi": 2, - "no-spaced-func": 2, - "no-sparse-arrays": 2, - "no-sync": 0, - "no-ternary": 0, - "no-trailing-spaces": 2, - "no-this-before-super": 2, - "no-throw-literal": 2, - "no-undef": 2, - "no-undef-init": 2, - "no-undefined": 0, - "no-unexpected-multiline": 2, - "no-underscore-dangle": 2, - "no-unneeded-ternary": 2, - "no-unreachable": 2, - "no-unused-expressions": 2, - "no-unused-vars": [2, {"vars": "all", "args": "after-used"}], - "no-use-before-define": 2, - "no-void": 2, - "no-var": 0, - "prefer-const": 2, - "no-warning-comments": [2, { "terms": ["todo", "fixme", "xxx"], "location": "anywhere" }], - "no-with": 2, - "no-wrap-func": 2, - - "array-bracket-spacing": [2, "always"], - "accessor-pairs": 2, - "block-scoped-var": 2, - "brace-style": [2, "1tbs"], - "camelcase": 2, - "comma-dangle": [2, "never"], - "comma-spacing": 2, - "comma-style": 2, - "complexity": [2, 11], - "computed-property-spacing": [2, "never"], - "consistent-return": 2, - "consistent-this": [2, "self"], - "constructor-super": 2, - "curly": [2, "all"], - "default-case": 2, - "dot-location": [2, "property"], - "dot-notation": [2, { "allowKeywords": true }], - "eol-last": 2, - "eqeqeq": 2, - "func-names": 2, - "func-style": [2, "declaration"], - "generator-star": 2, - "generator-star-spacing": 2, - "global-strict": [2, "always"], - "guard-for-in": 2, - "handle-callback-err": 2, - "indent": [2, 2], - "key-spacing": [2, { "beforeColon": false, "afterColon": true }], - "lines-around-comment": 0, - "max-depth": [2, 4], - "max-len": [2, 80, 2], - "max-nested-callbacks": [2, 3], - "max-params": [2, 5], - "max-statements": [2, 20], - "new-cap": 2, - "new-parens": 2, - "newline-after-var": 0, - "object-curly-spacing": [2, "always"], - "object-shorthand": 0, - "one-var": 0, - "operator-assignment": [2, "always"], - "operator-linebreak": 2, - "padded-blocks": [2, "never"], - "quote-props": 2, - "quotes": [2, "double"], - "radix": 2, - "semi": 2, - "semi-spacing": [2, {"before": false, "after": true}], - "sort-vars": 0, - "space-after-function-name": [2, "never"], - "space-after-keywords": [2, "always"], - "space-before-blocks": [2, "always"], - "space-before-function-paren": [2, "never"], - "space-before-function-parentheses": [2, "never"], - "space-in-brackets": [2, "always", { "propertyName": false }], - "space-in-parens": [2, "never"], - "space-infix-ops": 2, - "space-return-throw-case": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "spaced-comment": 0, - "spaced-line-comment": [2, "always"], - "strict": 2, - "use-isnan": 2, - "valid-jsdoc": 2, - "valid-typeof": 2, - "vars-on-top": 0, - "wrap-iife": 2, - "wrap-regex": 0, - "yoda": [2, "never"] - } -} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..46f20cb1 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: DavidAnson diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..3ba13e0c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/markdownlint-issue-template.md b/.github/ISSUE_TEMPLATE/markdownlint-issue-template.md new file mode 100644 index 00000000..46976a2a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/markdownlint-issue-template.md @@ -0,0 +1,40 @@ +--- +name: markdownlint issue template +about: This template helps report issues with the markdownlint family of tools. +title: '' +labels: '' +assignees: '' +--- + + diff --git a/.github/codeql-config.yaml b/.github/codeql-config.yaml new file mode 100644 index 00000000..5b48037b --- /dev/null +++ b/.github/codeql-config.yaml @@ -0,0 +1,7 @@ +name: "CodeQL Config" + +queries: + - uses: security-and-quality + +paths-ignore: + - demo/markdownlint-browser.js diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..52925e52 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + target-branch: "next" + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + target-branch: "next" + versioning-strategy: "increase" diff --git a/.github/dictionary.txt b/.github/dictionary.txt new file mode 100644 index 00000000..8cd8589c --- /dev/null +++ b/.github/dictionary.txt @@ -0,0 +1,126 @@ +addin +APIs +async +atx +ATX +atx_closed +ATX-style +autolink +autolinks +Autolinks +axibase +backtick +backticks +blockquote +blockquotes +Boostnote +br +br_spaces +bundler +changelog +Changelog +changelogs +Changelogs +CJK +CLI +coc-markdownlint +CodeQL +CodiMD +CommonMark +config +Config +config. +CVE-\d+-\d+ +docs-util +ECMAScript +encodings +ES2015 +ES6 +ESLint +eslint-plugin-markdownlint +first-line-h1 +flymake-markdownlint-cli2 +formatter +fs +GFM +github +globbing +grunt-markdownlint +h1 +h2 +html_elements +JSDoc +JSON +JSONC +kramdown +linter +LLMs +Lombiq +markdownlint +markdownlint-cli +markdownlint-cli2 +markdownlint-rule-helpers +markdownlint-rule-search-replace +matcher +MD\d\d\d +MD\d\d\d-MD\d\d\d +mdl +MDN +minified +MkDocs +monospaced +MSBuild +namespace +Neovim +no-bare-urls +no-blanks-blockquote +no-inline-html +no-missing-space-atx +no-missing-space-closed-atx +no-multiple-space-atx +no-multiple-space-blockquote +no-multiple-space-closed-atx +non-JSON +npm +ol +ol_multi +ol-prefix +pandoc +Pandoc +Params +parsers +pre-commit +Reactable +README +reimplement +Reimplement +setext +setext_with_atx +setext_with_atx_closed +setext-style +single-h1 +sublist +subpath +Super-Linter +TestCafe +TOML +trimLeft +trimRight +ul +ul_single +ul-indent +ul-start-left +ul-style +unhandled +unreferenced +URI-encode +url +v12 +V8 +vscode-markdownlint +W3C +webhint +webhintio +webpack +whitespace +YAML diff --git a/.github/workflows/checkers.yml b/.github/workflows/checkers.yml new file mode 100644 index 00000000..d5591a5a --- /dev/null +++ b/.github/workflows/checkers.yml @@ -0,0 +1,28 @@ +name: Checkers + +on: + pull_request: + push: + branches-ignore: + - 'dependabot/**' + workflow_dispatch: + +jobs: + + linkcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: JustinBeckwith/linkinator-action@v2 + with: + linksToSkip: '^https://github.com/ ^https://www.jwz.org/ ^https://www.npmjs.com/ ^https://opensource.org/ ^https://unix.stackexchange.com/' + paths: '*.md doc/*.md helpers/*.md' + + spellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: tbroadley/spellchecker-cli-action@v1 + with: + dictionaries: '.github/dictionary.txt' + files: '*.md doc/*.md helpers/*.md' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..dd303a36 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + pull_request: + push: + branches-ignore: + - 'dependabot/**' + schedule: + - cron: '30 12 * * *' + workflow_dispatch: + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + node-version: [ 20, 22, 24 ] + + steps: + - uses: actions/checkout@v6 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: npm install + - name: Run CI Tests + run: npm run ci + + pnpm: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + - name: Use pnpm latest + uses: pnpm/action-setup@v4 + with: + version: latest + - name: Use Node.js latest + uses: actions/setup-node@v6 + with: + node-version: latest + - name: Install dependencies + run: pnpm install + - name: Run CI Tests + run: npm test diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..d61691fb --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,33 @@ +name: "CodeQL" + +on: + pull_request: + push: + branches-ignore: + - 'dependabot/**' + workflow_dispatch: + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + security-events: write + + strategy: + fail-fast: false + matrix: + language: ['javascript'] + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + config-file: ./.github/codeql-config.yaml + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/test-repos.yml b/.github/workflows/test-repos.yml new file mode 100644 index 00000000..097bf68c --- /dev/null +++ b/.github/workflows/test-repos.yml @@ -0,0 +1,31 @@ +name: TestRepos + +on: + pull_request: + push: + branches-ignore: + - 'dependabot/**' + workflow_dispatch: + +jobs: + build: + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest ] + node-version: [ latest ] + + steps: + - uses: actions/checkout@v6 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: npm install + - name: Clone Test Repos + run: npm run clone-test-repos + - name: Lint Test Repos + run: npm run lint-test-repos diff --git a/.github/workflows/update-test-repos.yml b/.github/workflows/update-test-repos.yml new file mode 100644 index 00000000..fa9d41d9 --- /dev/null +++ b/.github/workflows/update-test-repos.yml @@ -0,0 +1,41 @@ +name: UpdateTestRepos + +on: + push: + branches-ignore: + - 'dependabot/**' + schedule: + - cron: '30 12 * * *' + workflow_dispatch: + +jobs: + update: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + ref: next + - uses: actions/setup-node@v6 + - run: git config user.email "david@dlaa.me" + - run: git config user.name "David Anson" + - run: git checkout -b update-test-repos-$GITHUB_RUN_ID + - run: npm install + - run: npm run update-test-repos + env: + AVA_FORCE_CI: not-ci + - run: git diff --exit-code + continue-on-error: true + id: diff + - run: git add . + if: ${{ success() && steps.diff.outcome == 'failure' }} + - run: git commit -m "Update test repository snapshots." + if: ${{ success() && steps.diff.outcome == 'failure' }} + - run: git push --set-upstream origin update-test-repos-$GITHUB_RUN_ID + if: ${{ success() && steps.diff.outcome == 'failure' }} + - run: gh pr create --base next --body "" --title "Update test repository snapshots." + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ success() && steps.diff.outcome == 'failure' }} diff --git a/.gitignore b/.gitignore index a918cfbb..cfc43fa2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,9 @@ demo/markdown-it.min.js demo/markdownlint-browser.js demo/markdownlint-browser.min.js node_modules +!test/node_modules +!test/rules/node_modules npm-debug.log +test-repos +.DS_Store +.vscode diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..8de265a1 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,67 @@ +{ + "code-block-style": { + "style": "fenced" + }, + "code-fence-style": { + "style": "backtick" + }, + "emphasis-style": { + "style": "asterisk" + }, + "extended-ascii": { + "ascii-only": true + }, + "fenced-code-language": { + "allowed_languages": [ + "bash", + "html", + "javascript", + "json", + "markdown", + "text" + ], + "language_only": true + }, + "heading-style": { + "style": "atx" + }, + "hr-style": { + "style": "---" + }, + "line-length": { + "strict": true, + "code_blocks": false + }, + "link-image-style": { + "collapsed": false, + "shortcut": false, + "url_inline": false + }, + "no-duplicate-heading": { + "siblings_only": true + }, + "ol-prefix": { + "style": "ordered" + }, + "proper-names": { + "code_blocks": false, + "names": [ + "Cake.Markdownlint", + "CommonMark", + "JavaScript", + "Markdown", + "markdown-it", + "markdownlint", + "Node.js" + ] + }, + "reference-links-images": { + "shortcut_syntax": true + }, + "strong-style": { + "style": "asterisk" + }, + "ul-style": { + "style": "dash" + } +} diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..a1867b2a --- /dev/null +++ b/.npmignore @@ -0,0 +1,15 @@ +.eslintignore +.github +.markdownlint.json +.npmrc +.vscode +coverage +demo/* +doc-build +eslint.config.mjs +example +npm-debug.log +schema/*.mjs +scripts +test +test-repos diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..68353c60 --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +engine-strict=true +ignore-scripts=true +package-lock=false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 69d9ed1a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - iojs -script: "npm run-script test-cover" -after_script: "npm install coveralls && cat ./coverage/lcov.info | coveralls" -sudo: false diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..e1c1a159 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,520 @@ +# Changelog + +## 0.40.0 + +- Improve MD011/MD013/MD051/MD060 +- Update dependencies + +## 0.39.0 + +- Add MD060/table-column-style +- Improve MD001/MD007/MD009/MD010/MD029/MD033/MD037/MD059 +- Add support for reporting violations as severity `warning` +- Deprecate `resultVersion` and `toString` (breaking change) +- Improve type definitions +- Improve demo web page +- Update dependencies + +## 0.38.0 + +- Add MD059/descriptive-link-text +- Improve MD025/MD027/MD036/MD038/MD041/MD043/MD045/MD051/MD052 +- `markdown-it` parser no longer a production dependency (breaking change) + - Add `markdownItFactory` option, remove `markdownItPlugins` option +- Remove support for end-of-life Node version 18 +- Improve performance +- Update dependencies + +## 0.37.4 + +- Stop using `module.createRequire`, export `resolveModule` + +## 0.37.3 + +- Tweak `package.json` dependencies to work with `pnpm` + +## 0.37.2 + +- Add subpath imports for overriding default bundler behavior +- Improve MD032 + +## 0.37.1 + +- Add support for "browser" condition (as used by webpack) + +## 0.37.0 + +- Convert module to ECMAScript (breaking change) + - + - +- Convert module to named exports (breaking change) + +## 0.36.1 + +- Fix behavior of MD054 + +## 0.36.0 + +- Improve MD051 +- Move `applyFix` and `applyFixes` from helpers to core +- Make `micromark` parser available to custom rules +- Introduce `./micromark` helpers exports +- Update custom/rule documentation +- Improve performance +- Update dependencies + +## 0.35.0 + +- Add MD058/blanks-around-tables +- Use `micromark` in MD001/MD003/MD009/MD010/MD013/MD014/MD019/MD021/MD023/ + MD024/MD025/MD039/MD042/MD043 +- Improve MD018/MD020/MD031/MD034/MD044 +- `markdown-it` parser no longer invoked by default +- Add strict version of JSON schema +- Improve performance +- Update dependencies + +## 0.34.0 + +- Use `micromark` in MD027/MD028/MD036/MD040/MD041/MD046/MD048 +- Improve MD013/MD034/MD049/MD050/MD051 +- Update custom rule requirements and documentation +- Improve various TypeScript declarations +- Update dependencies + +## 0.33.0 + +- Add MD055/table-pipe-style, MD056/table-column-count +- Improve MD005/MD007/MD024/MD026/MD038 +- Incorporate `micromark-extension-directive` +- Improve JSON schema, document validation +- Reduce size of browser script +- Update dependencies + +## 0.32.1 + +- Fix behavior of MD054 + +## 0.32.0 + +- Remove deprecated MD002/MD006 +- Remove rule aliases for "header" +- Add MD054/link-image-style +- Use `micromark` in MD005/MD007/MD030 +- Improve MD022/MD026/MD034/MD037/MD038/MD045/MD051 +- Improve JSON schema and related examples +- Provide type declaration for Configuration object +- Remove support for end-of-life Node version 16 +- Update dependencies + +## 0.31.1 + +- Improve MD032/MD034 +- Update dependencies + +## 0.31.0 + +- Improve MD032/MD037/MD043/MD044/MD051/MD052 +- Improve performance +- Update dependencies + +## 0.30.0 + +- Use `micromark` in MD022/MD026/MD032/MD037/MD045/MD051 +- Incorporate `micromark-extension-math` for math syntax +- Allow custom rules to override information URL +- Update dependencies + +## 0.29.0 + +- Update `micromark` parser dependencies for better performance +- Use `micromark` in MD049/MD050 +- Improve MD034/MD037/MD044/MD049/MD050 +- Support multiple parsers in demo page +- Remove support for end-of-life Node version 14 +- Update dependencies + +## 0.28.2 + +- Update dependencies for CVE-2023-2251 + +## 0.28.1 + +- Update dependencies + +## 0.28.0 + +- Introduce `micromark` parser for better positional data (internal only) +- Use `micromark` in MD013/MD033/MD034/MD035/MD038/MD044/MD052/MD053 +- Simplify file-based test cases +- Unify browser script for demo page +- Update dependencies + +## 0.27.0 + +- Improve MD011/MD013/MD022/MD031/MD032/MD033/MD034/MD040/MD043/MD051/MD053 +- Generate/separate documentation +- Improve documentation +- Update dependencies + +## 0.26.2 + +- Improve MD037/MD051/MD053 + +## 0.26.1 + +- Improve MD051 + +## 0.26.0 + +- Add MD051/MD052/MD053 for validating link fragments & reference + links/images & link/image reference definitions (MD053 auto-fixable) +- Improve MD010/MD031/MD035/MD039/MD042/MD044/MD049/MD050 +- Add `markdownlint-disable-line` inline comment +- Support `~` paths in `readConfig/Sync` +- Add `configParsers` option +- Remove support for end-of-life Node version 12 +- Default `resultVersion` to 3 +- Update browser script to use ES2015 +- Simplify JSON schema +- Address remaining CodeQL issues +- Improve performance +- Update dependencies + +## 0.25.1 + +- Update dependencies for CVE-2022-21670 + +## 0.25.0 + +- Add MD049/MD050 for consistent emphasis/strong style (both auto-fixable) +- Improve MD007/MD010/MD032/MD033/MD035/MD037/MD039 +- Support asynchronous custom rules +- Improve performance +- Improve CI process +- Reduce dependencies +- Update dependencies + +## 0.24.0 + +- Remove support for end-of-life Node version 10 +- Add support for custom file system module +- Improve MD010/MD011/MD037/MD043/MD044 +- Improve TypeScript declaration file and JSON schema +- Update dependencies + +## 0.23.1 + +- Work around lack of webpack support for dynamic calls to `require`(`.resolve`) + +## 0.23.0 + +- Add comprehensive example `.markdownlint.jsonc`/`.markdownlint.yaml` files +- Add fix information for MD004/ul-style +- Improve MD018/MD019/MD020/MD021/MD037/MD041 +- Improve HTML comment handling +- Update test runner and test suite +- Update dependencies + +## 0.22.0 + +- Allow `extends` in config to reference installed packages by name +- Add `markdownlint-disable-next-line` inline comment +- Support JSON front matter +- Improve MD009/MD026/MD028/MD043 +- Update dependencies (including `markdown-it` to v12) + +## 0.21.1 + +- Improve MD011/MD031 +- Export `getVersion` API + +## 0.21.0 + +- Lint concurrently for better performance (async only) +- Add Promise-based APIs +- Update TypeScript declaration file +- Hide `toString` on `LintResults` +- Add ability to fix in browser demo +- Allow custom rules in `.markdownlint.json` schema +- Improve MD042/MD044 +- Improve documentation +- Update dependencies + +## 0.20.4 + +- Fix regression in MD037 +- Improve MD034/MD044 +- Improve documentation + +## 0.20.3 + +- Fix regression in MD037 +- Improve MD044 +- Add automatic regression testing + +## 0.20.2 + +- Fix regression in MD037 +- Improve MD038 + +## 0.20.1 + +- Fix regression in MD037 + +## 0.20.0 + +- Add `markdownlint-configure-file` inline comment +- Reimplement MD037 +- Improve MD005/MD007/MD013/MD018/MD029/MD031/MD034/MD038/MD039 +- Improve HTML comment handling +- Update dependencies + +## 0.19.0 + +- Remove support for end-of-life Node version 8 +- Add fix information for MD005/list-indent +- Improve MD007/MD013/MD014 +- Deprecate MD006/ul-start-left +- Add rationale for every rule +- Update test runner and code coverage +- Add more JSDoc comments +- Update dependencies + +## 0.18.0 + +- Add MD048/code-fence-style +- Add fix information for MD007/ul-indent +- Add `markdownlint-disable-file`/`markdownlint-enable-file` inline comments +- Add type declaration file (.d.ts) for TypeScript dependents +- Update schema +- Improve MD006/MD007/MD009/MD013/MD030 +- Update dependencies + +## 0.17.2 + +- Improve MD020/MD033/MD044 + +## 0.17.1 + +- Fix handling of front matter by fix information + +## 0.17.0 + +- Add `resultVersion` 3 to support fix information for default and custom rules +- Add fix information for 24 rules +- Update newline handling to match latest CommonMark specification +- Improve MD014/MD037/MD039 +- Update dependencies + +## 0.16.0 + +- Add custom rule sample for linting code +- Improve MD026/MD031/MD033/MD038 +- Update dependencies + +## 0.15.0 + +- Add `markdownlint-capture`/`markdownlint-restore` inline comments +- Improve MD009/MD013/MD026/MD033/MD036 +- Update dependencies + +## 0.14.2 + +- Improve MD047 +- Add `handleRuleFailures` option + +## 0.14.1 + +- Improve MD033 + +## 0.14.0 + +- Remove support for end-of-life Node version 6 +- Introduce `markdownlint-rule-helpers` +- Add MD046/MD047 +- Improve MD033/MD034/MD039 +- Improve custom rule validation and in-browser demo +- Update dependencies + +## 0.13.0 + +- Improve MD013/MD022/MD025/MD029/MD031/MD032/MD037/MD041 +- Deprecate MD002 +- Improve Pandoc YAML support +- Update dependencies + +## 0.12.0 + +- Add `information` link for custom rules +- Add `markdownItPlugins` for extensibility +- Improve MD023/MD032/MD038 +- Update dependencies + +## 0.11.0 + +- Improve MD005/MD024/MD029/MD038 +- Improve custom rule example +- Add `CONTRIBUTING.md` +- Update dependencies + +## 0.10.0 + +- Add support for non-JSON configuration files +- Pass file/string name to custom rules +- Update dependencies + +## 0.9.0 + +- Remove support for end-of-life Node versions 0.10/0.12/4 +- Change "header" to "heading" per spec (non-breaking) +- Improve MD003/MD009/MD041 +- Handle uncommon line-break characters +- Refactor for ES6 +- Update dependencies + +## 0.8.1 + +- Update item loop to be iterative +- Improve MD014 +- Update dependencies + +## 0.8.0 + +- Add support for using and authoring custom rules +- Improve MD004/MD007/MD013 +- Add `engines` to `package.json` +- Refactor +- Update dependencies + +## 0.7.0 + +- `resultVersion` defaults to 2 (breaking change) +- Add MD045 +- Improve MD029 +- Remove `trimLeft`/`trimRight` +- Split rules +- Refactor +- Update dependencies + +## 0.6.4 + +- Improve MD029/MD042 +- Update dependencies + +## 0.6.3 + +- Improve highlighting for MD020 + +## 0.6.2 + +- Improve MD013/MD027/MD034/MD037/MD038/MD041/MD044 +- Update dependencies + +## 0.6.1 + +- Update `markdown-it` versioning +- Exclude demo/test from publishing + +## 0.6.0 + +- `resultVersion` defaults to 1 (breaking change) +- Ignore HTML comments +- TOML front matter +- Fixes for MD044 +- Update dependencies + +## 0.5.0 + +- Add shareable configuration +- Add `noInlineConfig` option +- Add `README.md` links +- Fix MD030 +- Improve MD009/MD041 +- Update dependencies + +## 0.4.1 + +- Fixes for MD038/front matter +- Improvements to MD044 +- Update dependencies + +## 0.4.0 + +- Add MD044 +- Enhance MD013/MD032/MD041/MD042/MD043 +- Fix for MD038 +- Update dependencies + +## 0.3.1 + +- Fix regressions in MD032/MD038 +- Update dependencies + +## 0.3.0 + +- More detailed error reporting with `resultVersion` +- Enhance MD010/MD012/MD036 +- Fixes for MD027/MD029/MD030 +- Include JSON schema dependencies + +## 0.2.0 + +- Add MD042/MD043 +- Enhance MD002/MD003/MD004/MD007/MD011/MD025/MD041 +- Update dependencies + +## 0.1.1 + +- Fix bug handling HTML in tables +- Reference `markdownlint-cli` + +## 0.1.0 + +- Add aliases +- Exceptions for MD033 +- Exclusions for MD013 +- Update dependencies + +## 0.0.8 + +- Support disabling/enabling rules inline +- Improve code fence +- Update dependencies + +## 0.0.7 + +- Add MD041 +- Improve MD003 +- Ignore front matter +- Update dependencies + +## 0.0.6 + +- Improve performance +- Simplify in-browser +- Update dependencies + +## 0.0.5 + +- Add `strings` option to enable file-less scenarios +- Add in-browser demo + +## 0.0.4 + +- Add tests MD033-MD040 +- Update dependencies + +## 0.0.3 + +- Add synchronous API +- Improve documentation and code + +## 0.0.2 + +- Improve documentation, tests, and code + +## 0.0.1 + +- Initial release +- Includes tests MD001-MD032 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..71415738 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# Contributing + +Interested in contributing? Great! Here are some suggestions to make it a good +experience: + +Start by [opening an issue](https://github.com/DavidAnson/markdownlint/issues), +whether to identify a problem or outline a change. That issue should be used to +discuss the situation and agree on a plan of action before writing code or +sending a pull request. Maybe the problem isn't really a problem, or maybe there +are more things to consider. If so, it's best to realize that before spending +time and effort writing code that may not get used. + +Match the coding style of the files you edit. Although everyone has their own +preferences and opinions, a pull request is not the right forum to debate them. + +Do not add new [`dependencies` to `package.json`][dependencies]. The Markdown +parser [`micromark`][micromark] (and its extensions) is this project's only +dependency. + +Package versions for `dependencies` and `devDependencies` should be specified +exactly (also known as "pinning"). The short explanation is that doing otherwise +eventually leads to inconsistent behavior and broken functionality. (See [Why I +pin dependency versions in Node.js packages][version-pinning] for a longer +explanation.) + +If developing a new rule, start by creating a [custom rule][custom-rules] in its +own project. Once written, published, and tested in real world scenarios, open +an issue to consider adding it to this project. For rule ideas, see [issues +tagged with the `new rule` label][new-rule]. + +Add tests for all new/changed functionality. Test positive and negative +scenarios. Try to break the new code now, or else it will get broken later. + +Run tests before sending a pull request via `npm test` in the [usual +manner][npm-scripts]. Tests should all pass on all platforms. The test runner is +[AVA][ava] and test cases are located in `test/markdownlint-test*.js`. When +running tests, `test/*.md` files are enumerated, linted, and fail if any +violations are missing a corresponding `{MD###}` marker in the test file. For +example, the line `### Heading {MD001}` is expected to trigger the rule `MD001`. +For cases where the marker text can not be present on the same line, the syntax +`{MD###:#}` can be used to include a line number. If `some-test.md` needs custom +configuration, a `some-test.json` is used to provide a custom `options.config` +for that scenario. Tests run by `markdownlint-test-scenarios.js` use [AVA's +snapshot feature][ava-snapshots]. To update snapshots (for example, after +modifying a test file), run `npm run update-snapshots` and include the updated +files with the pull request. + +Lint before sending a pull request by running `npm run lint`. There should be no +issues. + +Run a full continuous integration pass before sending a pull request via `npm +run ci`. Code coverage should always be 100%. As part of a continuous +integration run, generated files may get updated and fail the run - commit them +to the repository and rerun continuous integration. + +Pull requests should contain a single commit. If necessary, squash multiple +commits before creating the pull request and when making changes. (See [Git +Tools - Rewriting History][rewriting-history] for details.) + +Open pull requests against the `next` branch. That's where the latest changes +are staged for the next release. Include the text "(fixes #??)" at the end of +the commit message so the pull request will be associated with the relevant +issue. End commit messages with a period (`.`). Once accepted, the tag `fixed in +next` will be added to the issue. When the commit is merged to the main branch +during the release process, the issue will be closed automatically. (See +[Closing issues using keywords][closing-keywords] for details.) + +Please refrain from using slang or meaningless placeholder words. Sample content +can be "text", "code", "heading", or the like. Sample URLs should use +[example.com][example-com] which is safe for this purpose. Profanity is not +allowed. + +In order to maintain the permissive MIT license this project uses, all +contributions must be your own and released under that license. Code you add +should be an original work and should not be copied from elsewhere. Taking code +from a different project, Stack Overflow, or the like is not allowed. The use of +tools such as GitHub Copilot, ChatGPT, LLMs (large language models), etc. that +incorporate code from other projects is not allowed. + +Thank you! + +[ava]: https://github.com/avajs/ava +[ava-snapshots]: https://github.com/avajs/ava/blob/main/docs/04-snapshot-testing.md +[closing-keywords]: https://help.github.com/articles/closing-issues-using-keywords/ +[custom-rules]: doc/CustomRules.md +[dependencies]: https://docs.npmjs.com/cli/v11/configuring-npm/package-json#dependencies +[example-com]: https://en.wikipedia.org/wiki/Example.com +[micromark]: https://www.npmjs.com/package/micromark +[new-rule]: https://github.com/DavidAnson/markdownlint/labels/new%20rule +[npm-scripts]: https://docs.npmjs.com/misc/scripts +[rewriting-history]: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History +[version-pinning]: https://dlaa.me/blog/post/versionpinning diff --git a/LICENSE b/LICENSE index 9672a793..71ff07a3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 David Anson +Copyright (c) David Anson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7feb862a..69afa8c8 100644 --- a/README.md +++ b/README.md @@ -1,163 +1,739 @@ # markdownlint -> A Node.js style checker and lint tool for Markdown files. +> A Node.js style checker and lint tool for Markdown/CommonMark files. [![npm version][npm-image]][npm-url] -[![GitHub tag][github-tag-image]][github-tag-url] -[![Build status][travis-image]][travis-url] -[![Coverage][coveralls-image]][coveralls-url] [![License][license-image]][license-url] ## Install -```shell +```bash npm install markdownlint --save-dev ``` ## Overview -The [Markdown](http://en.wikipedia.org/wiki/Markdown) markup language is -designed to be easy to read, write, and understand. It succeeds - and its -flexibility is both a benefit and a drawback. Many styles are possible, so -formatting can be inconsistent. Some constructs don't work well in all -parsers and should be avoided. +The [Markdown][markdown] markup language is designed to be easy to read, write, +and understand. It succeeds - and its flexibility is both a benefit and a +drawback. Many styles are possible, so formatting can be inconsistent; some +constructs don't work well in all parsers and should be avoided. -`markdownlint` is a [static analysis](http://en.wikipedia.org/wiki/Static_program_analysis) -tool for [Node.js](https://nodejs.org/) and [io.js](https://iojs.org/) with a -library of rules to enforce standards and consistency for Markdown files. It -was inspired by - and heavily influenced by - Mark Harrison's -[markdownlint](https://github.com/mivok/markdownlint) for -[Ruby](https://www.ruby-lang.org/). The rules, rule documentation, and test -cases come directly from that project. +`markdownlint` is a [static analysis][static-analysis] tool for +[Node.js][nodejs] with a library of rules to enforce standards and consistency +for Markdown files. It was inspired by - and heavily influenced by - Mark +Harrison's [markdownlint][markdownlint-ruby] for Ruby. The initial rules, rule +documentation, and test cases came from that project. -> If you need a Ruby implementation or a [CLI](http://en.wikipedia.org/wiki/Command-line_interface), -> please consider the [mdl](https://rubygems.org/gems/mdl) gem. +`markdownlint` uses the [`micromark` parser][micromark] and honors the +[CommonMark][commonmark] specification for Markdown. It additionally supports +popular [GitHub Flavored Markdown (GFM)][gfm] syntax like autolinks and tables +as well as directives, footnotes, and math syntax - all implemented by +[`micromark` extensions][micromark-extensions]. + +[commonmark]: https://commonmark.org/ +[gfm]: https://github.github.com/gfm/ +[markdown]: https://en.wikipedia.org/wiki/Markdown +[markdownlint-ruby]: https://github.com/markdownlint/markdownlint +[micromark]: https://github.com/micromark/micromark +[micromark-extensions]: https://github.com/micromark/micromark?tab=readme-ov-file#list-of-extensions +[nodejs]: https://nodejs.org/ +[static-analysis]: https://en.wikipedia.org/wiki/Static_program_analysis + +### Related + +- CLI + - [markdownlint-cli][markdownlint-cli] command-line interface for Node.js + ([works with pre-commit][markdownlint-cli-precommit]) + - [markdownlint-cli2][markdownlint-cli2] command-line interface for Node.js + ([works with pre-commit][markdownlint-cli2-precommit]) +- GitHub + - [GitHub Action for markdownlint-cli2][markdownlint-cli2-action] + - [GitHub Super-Linter Action][super-linter] + - [GitHub Actions problem matcher for + markdownlint-cli][markdownlint-problem-matcher] +- Editor + - [vscode-markdownlint extension for VS Code][vscode-markdownlint] + - [Sublime Text markdownlint for Sublime Text][sublimelinter] + - [coc-markdownlint extension for Vim/Neovim][coc] + - [flymake-markdownlint-cli2 extension for Emacs][emacs-flymake] +- Tooling + - [eslint-plugin-markdownlint for the ESLint analyzer][eslint-plugin] + - [grunt-markdownlint for the Grunt task runner][grunt-markdownlint] + - [Cake.Markdownlint addin for Cake build automation system][cake] + - [Lombiq Node.js Extensions for MSBuild (.NET builds)][nodejs-extensions] +- Ruby + - [markdownlint/mdl gem for Ruby][rubygems-mdl] + +[cake]: https://github.com/cake-contrib/Cake.Markdownlint +[coc]: https://github.com/fannheyward/coc-markdownlint +[emacs-flymake]: https://github.com/ewilderj/flymake-markdownlint-cli2 +[eslint-plugin]: https://github.com/paweldrozd/eslint-plugin-markdownlint +[grunt-markdownlint]: https://github.com/sagiegurari/grunt-markdownlint +[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli +[markdownlint-cli-precommit]: https://github.com/igorshubovych/markdownlint-cli#use-with-pre-commit +[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2 +[markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action +[markdownlint-cli2-precommit]: https://github.com/DavidAnson/markdownlint-cli2#pre-commit +[markdownlint-problem-matcher]: https://github.com/xt0rted/markdownlint-problem-matcher +[nodejs-extensions]: https://github.com/Lombiq/NodeJs-Extensions +[rubygems-mdl]: https://rubygems.org/gems/mdl +[sublimelinter]: https://github.com/jonlabelle/SublimeLinter-contrib-markdownlint +[super-linter]: https://github.com/super-linter/super-linter +[vscode-markdownlint]: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint + +### References + +The following specifications are considered authoritative in cases of ambiguity: + +- [CommonMark](https://spec.commonmark.org/current/) +- [GitHub Flavored Markdown Spec](https://github.github.com/gfm/) ## Demonstration -[`markdownlint` demo](http://dlaa.me/markdownlint/), an interactive, in-browser +[`markdownlint` demo](https://dlaa.me/markdownlint/), an interactive, in-browser playground for learning and exploring. -## Rules +## Rules / Aliases -* **MD001** - Header levels should only increment by one level at a time -* **MD002** - First header should be a h1 header -* **MD003** - Header style -* **MD004** - Unordered list style -* **MD005** - Inconsistent indentation for list items at the same level -* **MD006** - Consider starting bulleted lists at the beginning of the line -* **MD007** - Unordered list indentation -* **MD009** - Trailing spaces -* **MD010** - Hard tabs -* **MD011** - Reversed link syntax -* **MD012** - Multiple consecutive blank lines -* **MD013** - Line length -* **MD014** - Dollar signs used before commands without showing output -* **MD018** - No space after hash on atx style header -* **MD019** - Multiple spaces after hash on atx style header -* **MD020** - No space inside hashes on closed atx style header -* **MD021** - Multiple spaces inside hashes on closed atx style header -* **MD022** - Headers should be surrounded by blank lines -* **MD023** - Headers must start at the beginning of the line -* **MD024** - Multiple headers with the same content -* **MD025** - Multiple top level headers in the same document -* **MD026** - Trailing punctuation in header -* **MD027** - Multiple spaces after blockquote symbol -* **MD028** - Blank line inside blockquote -* **MD029** - Ordered list item prefix -* **MD030** - Spaces after list markers -* **MD031** - Fenced code blocks should be surrounded by blank lines -* **MD032** - Lists should be surrounded by blank lines -* **MD033** - Inline HTML -* **MD034** - Bare URL used -* **MD035** - Horizontal rule style -* **MD036** - Emphasis used instead of a header -* **MD037** - Spaces inside emphasis markers -* **MD038** - Spaces inside code span elements -* **MD039** - Spaces inside link text -* **MD040** - Fenced code blocks should have a language specified -* **MD041** - First line in file should be a top level header + + +- **[MD001](doc/md001.md)** *heading-increment* - Heading levels should only increment by one level at a time +- **[MD003](doc/md003.md)** *heading-style* - Heading style +- **[MD004](doc/md004.md)** *ul-style* - Unordered list style +- **[MD005](doc/md005.md)** *list-indent* - Inconsistent indentation for list items at the same level +- **[MD007](doc/md007.md)** *ul-indent* - Unordered list indentation +- **[MD009](doc/md009.md)** *no-trailing-spaces* - Trailing spaces +- **[MD010](doc/md010.md)** *no-hard-tabs* - Hard tabs +- **[MD011](doc/md011.md)** *no-reversed-links* - Reversed link syntax +- **[MD012](doc/md012.md)** *no-multiple-blanks* - Multiple consecutive blank lines +- **[MD013](doc/md013.md)** *line-length* - Line length +- **[MD014](doc/md014.md)** *commands-show-output* - Dollar signs used before commands without showing output +- **[MD018](doc/md018.md)** *no-missing-space-atx* - No space after hash on atx style heading +- **[MD019](doc/md019.md)** *no-multiple-space-atx* - Multiple spaces after hash on atx style heading +- **[MD020](doc/md020.md)** *no-missing-space-closed-atx* - No space inside hashes on closed atx style heading +- **[MD021](doc/md021.md)** *no-multiple-space-closed-atx* - Multiple spaces inside hashes on closed atx style heading +- **[MD022](doc/md022.md)** *blanks-around-headings* - Headings should be surrounded by blank lines +- **[MD023](doc/md023.md)** *heading-start-left* - Headings must start at the beginning of the line +- **[MD024](doc/md024.md)** *no-duplicate-heading* - Multiple headings with the same content +- **[MD025](doc/md025.md)** *single-title/single-h1* - Multiple top-level headings in the same document +- **[MD026](doc/md026.md)** *no-trailing-punctuation* - Trailing punctuation in heading +- **[MD027](doc/md027.md)** *no-multiple-space-blockquote* - Multiple spaces after blockquote symbol +- **[MD028](doc/md028.md)** *no-blanks-blockquote* - Blank line inside blockquote +- **[MD029](doc/md029.md)** *ol-prefix* - Ordered list item prefix +- **[MD030](doc/md030.md)** *list-marker-space* - Spaces after list markers +- **[MD031](doc/md031.md)** *blanks-around-fences* - Fenced code blocks should be surrounded by blank lines +- **[MD032](doc/md032.md)** *blanks-around-lists* - Lists should be surrounded by blank lines +- **[MD033](doc/md033.md)** *no-inline-html* - Inline HTML +- **[MD034](doc/md034.md)** *no-bare-urls* - Bare URL used +- **[MD035](doc/md035.md)** *hr-style* - Horizontal rule style +- **[MD036](doc/md036.md)** *no-emphasis-as-heading* - Emphasis used instead of a heading +- **[MD037](doc/md037.md)** *no-space-in-emphasis* - Spaces inside emphasis markers +- **[MD038](doc/md038.md)** *no-space-in-code* - Spaces inside code span elements +- **[MD039](doc/md039.md)** *no-space-in-links* - Spaces inside link text +- **[MD040](doc/md040.md)** *fenced-code-language* - Fenced code blocks should have a language specified +- **[MD041](doc/md041.md)** *first-line-heading/first-line-h1* - First line in a file should be a top-level heading +- **[MD042](doc/md042.md)** *no-empty-links* - No empty links +- **[MD043](doc/md043.md)** *required-headings* - Required heading structure +- **[MD044](doc/md044.md)** *proper-names* - Proper names should have the correct capitalization +- **[MD045](doc/md045.md)** *no-alt-text* - Images should have alternate text (alt text) +- **[MD046](doc/md046.md)** *code-block-style* - Code block style +- **[MD047](doc/md047.md)** *single-trailing-newline* - Files should end with a single newline character +- **[MD048](doc/md048.md)** *code-fence-style* - Code fence style +- **[MD049](doc/md049.md)** *emphasis-style* - Emphasis style +- **[MD050](doc/md050.md)** *strong-style* - Strong style +- **[MD051](doc/md051.md)** *link-fragments* - Link fragments should be valid +- **[MD052](doc/md052.md)** *reference-links-images* - Reference links and images should use a label that is defined +- **[MD053](doc/md053.md)** *link-image-reference-definitions* - Link and image reference definitions should be needed +- **[MD054](doc/md054.md)** *link-image-style* - Link and image style +- **[MD055](doc/md055.md)** *table-pipe-style* - Table pipe style +- **[MD056](doc/md056.md)** *table-column-count* - Table column count +- **[MD058](doc/md058.md)** *blanks-around-tables* - Tables should be surrounded by blank lines +- **[MD059](doc/md059.md)** *descriptive-link-text* - Link text should be descriptive +- **[MD060](doc/md060.md)** *table-column-style* - Table column style + + See [Rules.md](doc/Rules.md) for more details. +### Custom Rules + +In addition to built-in rules, custom rules can be used to address +project-specific requirements. To find community-developed rules use +[keyword `markdownlint-rule` on npm][markdownlint-rule]. +To implement your own rules, refer to [CustomRules.md](doc/CustomRules.md). + +[markdownlint-rule]: https://www.npmjs.com/search?q=keywords:markdownlint-rule + ## Tags -* **atx** - MD018, MD019 -* **atx_closed** - MD020, MD021 -* **blank_lines** - MD012, MD022, MD031, MD032 -* **blockquote** - MD027, MD028 -* **bullet** - MD004, MD005, MD006, MD007, MD032 -* **code** - MD014, MD031, MD038, MD040 -* **emphasis** - MD036, MD037 -* **hard_tab** - MD010 -* **headers** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, - MD024, MD025, MD026, MD036, MD041 -* **hr** - MD035 -* **html** - MD033 -* **indentation** - MD005, MD006, MD007, MD027 -* **language** - MD040 -* **line_length** - MD013 -* **links** - MD011, MD034, MD039 -* **ol** - MD029, MD030, MD032 -* **spaces** - MD018, MD019, MD020, MD021, MD023 -* **ul** - MD004, MD005, MD006, MD007, MD030, MD032 -* **url** - MD034 -* **whitespace** - MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039 +Tags group related rules and can be used to enable/disable multiple +rules at once. + +- **`accessibility`** - `MD045`, `MD059` +- **`atx`** - `MD018`, `MD019` +- **`atx_closed`** - `MD020`, `MD021` +- **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047` +- **`blockquote`** - `MD027`, `MD028` +- **`bullet`** - `MD004`, `MD005`, `MD007`, `MD032` +- **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048` +- **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050` +- **`hard_tab`** - `MD010` +- **`headings`** - `MD001`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`, + `MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043` +- **`hr`** - `MD035` +- **`html`** - `MD033` +- **`images`** - `MD045`, `MD052`, `MD053`, `MD054` +- **`indentation`** - `MD005`, `MD007`, `MD027` +- **`language`** - `MD040` +- **`line_length`** - `MD013` +- **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`, + `MD054`, `MD059` +- **`ol`** - `MD029`, `MD030`, `MD032` +- **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023` +- **`spelling`** - `MD044` +- **`table`** - `MD055`, `MD056`, `MD058`, `MD060` +- **`ul`** - `MD004`, `MD005`, `MD007`, `MD030`, `MD032` +- **`url`** - `MD034` +- **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`, + `MD037`, `MD038`, `MD039` + +## Configuration + +Text passed to `markdownlint` is parsed as Markdown, analyzed, and any +issues reported. Two kinds of text are ignored by most rules: + +- [HTML comments](https://www.w3.org/TR/html5/syntax.html#comments) +- [Front matter](https://jekyllrb.com/docs/frontmatter/) (see + `options.frontMatter` below) + +All rules are enabled by default. Rules can be enabled, disabled, and configured +for each call to the `lint` API by passing an `options.config` object (described +below). To enable or disable rules within a file, use one of the following HTML +comments (which are not rendered): + +- Disable all rules: `` +- Enable all rules: `` +- Disable all rules for the current line: `` +- Disable all rules for the next line: `` +- Disable one or more rules by name: `` +- Enable one or more rules by name: `` +- Disable one or more rules by name for the current line: + `` +- Disable one or more rules by name for the next line: + `` +- Capture the current rule configuration: `` +- Restore the captured rule configuration: `` + +For example: + +```markdown + +space * in * emphasis +``` + +Or: + +```markdown +space * in * emphasis +``` + +Or: + +```markdown + +space * in * emphasis + +``` + +To temporarily disable rule(s), then restore the former configuration: + +```markdown + + +any violations you want + +``` + +The initial configuration is captured by default (as if every document +began with ``), so the pattern above can +be expressed more simply: + +```markdown + +any violations you want + +``` + +Changes take effect starting with the line a comment is on, so the following +has no effect: + +```markdown +space * in * emphasis +``` + +To apply changes to an entire file regardless of where the comment is located, +the following syntax is supported: + +- Disable all rules: `` +- Enable all rules: `` +- Disable one or more rules by name: `` +- Enable one or more rules by name: `` + +This can be used to "hide" `markdownlint` comments at the bottom of a file. + +In cases where it is desirable to change the configuration of one or +more rules for a file, the following more advanced syntax is supported: + +- Configure: `` + +For example: + +```markdown + +``` + +or + +```markdown + +``` + +These changes apply to the entire file regardless of where the comment is +located. Multiple such comments (if present) are applied top-to-bottom. By +default, content of `markdownlint-configure-file` is assumed to be JSON, but +[`options.configParsers`](#optionsconfigparsers) can be used to support +alternate formats. ## API -Standard asynchronous interface: +### Linting -```js +Asynchronous API via `import { lint } from "markdownlint/async"`: + +```javascript /** - * Lint specified Markdown files according to configurable rules. + * Lint specified Markdown files. * - * @param {Object} options Configuration options. - * @param {Function} callback Callback (err, result) function. + * @param {Options | null} options Configuration options. + * @param {LintCallback} callback Callback (err, result) function. * @returns {void} */ -function markdownlint(options, callback) { ... } +function lint(options, callback) { ... } ``` -Synchronous interface (for build scripts, etc.): +Synchronous API via `import { lint } from "markdownlint/sync"`: -```js +```javascript /** - * Lint specified Markdown files according to configurable rules. + * Lint specified Markdown files. * - * @param {Object} options Configuration options. - * @returns {Object} Result object. + * @param {Options | null} options Configuration options. + * @returns {LintResults} Results object. */ -function markdownlint.sync(options) { ... } +function lint(options) { ... } ``` -### options +Promise API via `import { lint } from "markdownlint/promise"`: + +```javascript +/** + * Lint specified Markdown files. + * + * @param {Options | null} options Configuration options. + * @returns {Promise} Results object. + */ +function lint(options) { ... } +``` + +#### options Type: `Object` -Configures the function. +Configures the function. All properties are optional, but at least one +of `files` or `strings` should be set to provide input. -#### options.files +##### options.config + +Type: `Object` mapping `String` to `Boolean | "error" | "warning" | Object` + +Configures the rules to use. + +Object keys are rule names/aliases; object values are the rule's configuration. +The value `false` disables a rule. The values `true` or `"error"` enable a rule +in its default configuration and report violations as errors. The value +`"warning"` enables a rule in its default configuration and reports violations +as warnings. Passing an object enables *and* customizes the rule; the properties +`severity` (`"error" | "warning"`) and `enabled` (`false | true`) can be used in +this context. The special `default` rule assigns the default for all rules. +Using a tag name (e.g., `whitespace`) and a setting of `false`, `true`, +`"error"`, or `"warning"` applies that setting to all rules with that tag. When +no configuration object is passed or the optional `default` setting is not +present, all rules are enabled. + +The following syntax disables the specified rule, tag, or `default`: + +```javascript +{ + "rule_tag_or_default": false +} +``` + +The following syntax enables the specified rule, tag, or `default` to report +violations as errors: + +```javascript +{ + "rule_tag_or_default": true + // OR + "rule_tag_or_default": "error" +} +``` + +The following syntax enables the specified rule, tag, or `default` to report +violations as warnings: + +```javascript +{ + "rule_tag_or_default": "warning" +} +``` + +The following syntax enables and configures the specified rule to report +violations as errors: + +```javascript +{ + "rule": { + "severity": "error" + } + // OR + "rule": { + "rule_parameter": "value" + } + // OR + "rule": { + "severity": "error", + "rule_parameter": "value" + } +} +``` + +The following syntax enables and configures the specified rule to report +violations as warnings: + +```javascript +{ + "rule": { + "severity": "warning" + } + // OR + "rule": { + "severity": "warning", + "rule_parameter": "value" + } +} +``` + +> Note that values `"error"` and `"warning"` and the property `severity` are not +> supported by library versions earlier than `0.39.0`. However, the examples +> above behave the same there, with warnings being reported as errors. + +The following syntax disables and configures the specified rule: + +```javascript +{ + "rule": { + "enabled": false, + "rule_parameter": "value" + } + // OR + "rule": { + "enabled": false, + "severity": "warning", + "rule_parameter": "value" + } +} +``` + +> Note that this example behaves **differently** with library versions earlier +> than `0.39.0` because the property `enabled` is not supported: it **enables** +> the rule instead of **disabling** it. As such, this syntax is discouraged when +> interoperability is important. + +To evaluate a configuration object, the `default` setting is applied first, then +keys are processed in order from top to bottom. If multiple values apply to a +rule (because of tag names or duplication), later values override earlier ones. +Keys (including rule names, aliases, tags, or `default`) are not case-sensitive. + +Example using `default`, rule names, and tag names together: + +```json +{ + "default": true, + "MD003": { "style": "atx_closed" }, + "MD007": { "indent": 4 }, + "no-hard-tabs": false, + "whitespace": false +} +``` + +See [.markdownlint.jsonc](schema/.markdownlint.jsonc) and/or +[.markdownlint.yaml](schema/.markdownlint.yaml) for an example +configuration object with all properties set to the default value. + +Sets of rules (known as a "style") can be stored separately and loaded +as [JSON](https://en.wikipedia.org/wiki/JSON). + +Example of referencing a built-in style from JavaScript: + +```javascript +const options = { + "files": [ "..." ], + "config": require("style/relaxed.json") +}; +``` + +Example doing so from `.markdownlint.json` via `extends` (more on this below): + +```json +{ + "extends": "markdownlint/style/relaxed" +} +``` + +See the [style](style) directory for more samples. + +See [markdownlint-config-schema.json](schema/markdownlint-config-schema.json) +for the [JSON Schema](https://json-schema.org/) of the `options.config` +object. + +See [ValidatingConfiguration.md](schema/ValidatingConfiguration.md) for ways to +use the JSON Schema to validate configuration. + +For more advanced scenarios, styles can reference and build upon other styles +via the `extends` keyword and a file path or (installed) package name. The +`readConfig` function can be used to read such aggregate styles from code. + +For example, assuming a `base.json` configuration file: + +```json +{ + "default": true +} +``` + +And a `custom.json` configuration file: + +```json +{ + "extends": "base.json", + "line-length": false +} +``` + +Then code like the following: + +```javascript +const options = { + "config": markdownlint.readConfigSync("./custom.json") +}; +``` + +Merges `custom.json` and `base.json` and is equivalent to: + +```javascript +const options = { + "config": { + "default": true, + "line-length": false + } +}; +``` + +##### options.configParsers + +Type: *Optional* `Array` of `Function` taking (`String`) and returning `Object` + +Array of functions to parse the content of `markdownlint-configure-file` blocks. + +As shown in the [Configuration](#configuration) section, inline comments can be +used to customize the [configuration object](#optionsconfig) for a document. By +default, the `JSON.parse` built-in is used, but custom parsers can be specified. +Content is passed to each parser function until one returns a value (vs. +throwing an exception). As such, strict parsers should come before flexible +ones. + +For example: + +```javascript +[ JSON.parse, require("toml").parse, require("js-yaml").load ] +``` + +##### options.customRules + +Type: `Array` of `Object` + +List of custom rules to include with the default rule set for linting. + +Each array element should define a rule. Rules are typically exported +by another package, but can be defined locally. + +Example: + +```javascript +const extraRules = require("extraRules"); +const options = { + "customRules": [ extraRules.one, extraRules.two ] +}; +``` + +See [CustomRules.md](doc/CustomRules.md) for details about authoring +custom rules. + +##### options.files Type: `Array` of `String` List of files to lint. Each array element should be a single file (via relative or absolute path); -[globbing](http://en.wikipedia.org/wiki/Glob_%28programming%29) is the caller's -responsibility. +[globbing](https://en.wikipedia.org/wiki/Glob_%28programming%29) is the +caller's responsibility. Example: `[ "one.md", "dir/two.md" ]` -#### options.strings +##### options.frontMatter + +Type: `RegExp` + +Matches any [front matter](https://jekyllrb.com/docs/frontmatter/) +found at the beginning of a file. + +Some Markdown content begins with metadata; the default `RegExp` for +this option ignores common forms of "front matter". To match differently, +specify a custom `RegExp` or use the value `null` to disable the feature. + +The default value: + +```javascript +/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m +``` + +Ignores [YAML](https://en.wikipedia.org/wiki/YAML), +[TOML](https://en.wikipedia.org/wiki/TOML), and +[JSON](https://en.wikipedia.org/wiki/JSON) front matter such as: + +```text +--- +layout: post +title: Title +--- +``` + +Note: Matches must occur at the start of the file. + +##### options.fs + +Type: `Object` implementing the [file system API][node-fs-api] + +In advanced scenarios, it may be desirable to bypass the default file system +API. If a custom file system implementation is provided, `markdownlint` will use +that instead of using `node:fs`. + +Note: The only methods called are `readFile` and `readFileSync`. + +[node-fs-api]: https://nodejs.org/api/fs.html + +##### options.handleRuleFailures + +Type: `Boolean` + +Catches exceptions thrown during rule processing and reports the problem +as a rule violation. + +By default, exceptions thrown by rules (or the library itself) are unhandled +and bubble up the stack to the caller in the conventional manner. By setting +`handleRuleFailures` to `true`, exceptions thrown by failing rules will +be handled by the library and the exception message logged as a rule violation. +This setting can be useful in the presence of (custom) rules that encounter +unexpected syntax and fail. By enabling this option, the linting process +is allowed to continue and report any violations that were found. + +##### options.markdownItFactory + +Type: `Function` returning an instance of a [`markdown-it` parser][markdown-it] + +Provides a factory function for creating instances of the `markdown-it` parser. + +Previous versions of the `markdownlint` library declared `markdown-it` as a +direct dependency. This function makes it possible to avoid that dependency +entirely. In cases where `markdown-it` is needed, the caller is responsible for +declaring the dependency and returning an instance from this factory. If any +[`markdown-it` plugins][markdown-it-plugin] are needed, they should be `use`d by +the caller before returning the `markdown-it` instance. + +For compatibility with previous versions of `markdownlint`, this function should +be similar to: + +```javascript +import markdownIt from "markdown-it"; +const markdownItFactory = () => markdownIt({ "html": true }); +``` + +When an asynchronous implementation of `lint` is being invoked (e.g., via +`markdownlint/async` or `markdownlint/promise`), this function can return a +`Promise` in order to defer the import of `markdown-it`: + +```javascript +const markdownItFactory = () => import("markdown-it").then((module) => module.default({ "html": true })); +``` + +> Note that this function is only invoked when a `markdown-it` parser is +> needed. None of the built-in rules use the `markdown-it` parser, so it is only +> invoked when one or more [custom rules][custom-rules] are present that use the +> `markdown-it` parser. + +[custom-rules]: #custom-rules +[markdown-it]: https://github.com/markdown-it/markdown-it +[markdown-it-plugin]: https://www.npmjs.com/search?q=keywords:markdown-it-plugin + +##### options.noInlineConfig + +Type: `Boolean` + +Disables the use of HTML comments like `` to toggle +rules within the body of Markdown content. + +By default, properly-formatted inline comments can be used to create exceptions +for parts of a document. Setting `noInlineConfig` to `true` ignores all such +comments. + +##### ~~options.resultVersion~~ + +This property is *deprecated* and should be removed. The default format of the +`result` object remains the same as setting `resultVersion` to `3`. For +continued access to other (previously *deprecated*) formats: + +```javascript +import { convertToResultVersion0, convertToResultVersion1, convertToResultVersion2 } from "markdownlint/helpers"; +``` + +##### options.strings Type: `Object` mapping `String` to `String` Map of identifiers to strings for linting. -When Markdown content is not available as files, it can be passed as strings. -The keys of the `strings` object are used to identify each input value in the -`result` summary. +When Markdown content is not available as files, it can be passed as +strings. The keys of the `strings` object are used to identify each +input value in the `result` summary. Example: @@ -168,96 +744,200 @@ Example: } ``` -#### options.frontMatter - -Type: `RegExp` - -Matches any [front matter](http://jekyllrb.com/docs/frontmatter/) found at the -beginning of a file. - -Some Markdown content begins with metadata; the default `RegExp` for this option -ignores common forms of "front matter". To match differently, specify a custom -`RegExp` or use the value `null` to disable the feature. - -Note: Matches must occur at the start of the file. - -Default: - -```js -/^---$[^]*?^---$(\r\n|\r|\n)/m -``` - -Ignores: - -```text ---- -layout: post -title: Title ---- -``` - -#### options.config - -Type: `Object` mapping `String` to `Boolean | Object` - -Configures the rules to use. - -Object keys are rule names and values are the rule's configuration. -The value `false` disables a rule, `true` enables its default configuration, -and passing an object customizes its settings. Setting the special `default` -rule to `true` or `false` includes/excludes all rules by default. Enabling or -disabling a tag name (ex: `whitespace`) affects all rules having that tag. - -The `default` rule is applied first, then keys are processed in order from top -to bottom with later values overriding earlier ones. - -Example: - -```json -{ - "default": true, - "MD003": { "style": "atx_closed" }, - "MD007": { "indent": 4 }, - "MD009": false, - "whitespace": false -} -``` - -Sets of rules (known as a "style") can be stored separately and loaded as -[JSON](http://en.wikipedia.org/wiki/JSON). - -Example: - -```js -var options = { - "files": [ "..." ], - "config": require("style/relaxed.json") -}; -``` - -See the [style](style) directory for more samples. - -### callback +#### callback Type: `Function` taking (`Error`, `Object`) Standard completion callback. -### result +#### result Type: `Object` -Call `result.toString()` for convenience or see below for an example of the -structure of the `result` object. +Map of input file names and string identifiers to issues within. + +See the [Usage section](#usage) for an example of the structure of this object. + +### Config + +The `options.config` configuration object is simple and can be stored in a file +for readability and easy reuse. The `readConfig` function loads configuration +settings and supports the `extends` keyword for referencing files or packages +(see above). + +By default, configuration files are parsed as JSON (and named +`.markdownlint.json`). Custom parsers can be provided to handle other formats +like JSONC, YAML, and TOML. + +Asynchronous API via `import { readConfig } from "markdownlint/async"`: + +```javascript +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[] | ReadConfigCallback} [parsers] Parsing function(s). + * @param {Object} [fs] File system implementation. + * @param {ReadConfigCallback} [callback] Callback (err, result) function. + * @returns {void} + */ +function readConfig(file, parsers, fs, callback) { ... } +``` + +Synchronous API via `import { readConfig } from "markdownlint/sync"`: + +```javascript +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[]} [parsers] Parsing function(s). + * @param {Object} [fs] File system implementation. + * @returns {Configuration} Configuration object. + */ +function readConfig(file, parsers, fs) { ... } +``` + +Promise API via `import { readConfig } from "markdownlint/promise"`: + +```javascript +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[]} [parsers] Parsing function(s). + * @param {Object} [fs] File system implementation. + * @returns {Promise} Configuration object. + */ +function readConfig(file, parsers, fs) { ... } +``` + +#### file + +Type: `String` + +Location of configuration file to read. + +The `file` is resolved relative to the current working directory. If an +`extends` key is present once read, its value will be resolved as a path +relative to `file` and loaded recursively. Settings from a file referenced by +`extends` are applied first, then those of `file` are applied on top (overriding +any of the same keys appearing in the referenced file). If either the `file` or +`extends` path begins with the `~` directory, it will act as a placeholder for +the home directory. + +#### parsers + +Type: *Optional* `Array` of `Function` taking (`String`) and returning `Object` + +Array of functions to parse configuration files. + +The contents of a configuration file are passed to each parser function until +one of them returns a value (vs. throwing an exception). Consequently, strict +parsers should come before flexible parsers. + +For example: + +```javascript +[ JSON.parse, require("toml").parse, require("js-yaml").load ] +``` + +#### fs + +Type: *Optional* `Object` implementing the [file system API][file-system-api] + +[file-system-api]: https://nodejs.org/api/fs.html + +In advanced scenarios, it may be desirable to bypass the default file system +API. If a custom file system implementation is provided, `markdownlint` will use +that instead of invoking `node:fs`. + +Note: The only methods called are `readFile`, `readFileSync`, `access`, and +`accessSync`. + +#### callback + +Type: `Function` taking (`Error`, `Object`) + +Standard completion callback. + +#### result + +Type: `Object` + +Configuration object. + +### Fixing + +Rules that can be fixed automatically include a `fixInfo` property which is +outlined in the [documentation for custom rules](doc/CustomRules.md#authoring). +To apply fixes consistently, the `applyFix`/`applyFixes` methods may be used via +`import { applyFix, applyFixes } from "markdownlint"`: + +```javascript +/** + * Applies the specified fix to a Markdown content line. + * + * @param {string} line Line of Markdown content. + * @param {RuleOnErrorFixInfo} fixInfo RuleOnErrorFixInfo instance. + * @param {string} [lineEnding] Line ending to use. + * @returns {string | null} Fixed content or null if deleted. + */ +function applyFix(line, fixInfo, lineEnding = "\n") { ... } + +/** + * Applies as many of the specified fixes as possible to Markdown content. + * + * @param {string} input Lines of Markdown content. + * @param {RuleOnErrorInfo[]} errors RuleOnErrorInfo instances. + * @returns {string} Fixed content. + */ +function applyFixes(input, errors) { ... } +``` + +Invoking `applyFixes` with the results of a call to lint can be done like so: + +```javascript +import { applyFixes } from "markdownlint"; +import { lint as lintSync } from "markdownlint/sync"; + +const results = lintSync({ "strings": { "content": original } }); +const fixed = applyFixes(original, results.content); +``` + +### Miscellaneous + +To get the [semantic version][semver] of the library, the `getVersion` method +can be used: + +```javascript +/** + * Gets the (semantic) version of the library. + * + * @returns {string} SemVer string. + */ +function getVersion() { ... } +``` + +Invoking `getVersion` is simple: + +```javascript +import { getVersion } from "markdownlint"; + +// Displays the library version +console.log(getVersion()); +``` + +[semver]: https://semver.org ## Usage -Invoke `markdownlint` and use the `result` object's `toString` method: +Invoke `lint` as an asynchronous call: -```js -var markdownlint = require("markdownlint"); +```javascript +import { lint as lintAsync } from "markdownlint/async"; -var options = { +const options = { "files": [ "good.md", "bad.md" ], "strings": { "good.string": "# good.string\n\nThis string passes all rules.", @@ -265,176 +945,180 @@ var options = { } }; -markdownlint(options, function callback(err, result) { - if (!err) { - console.log(result.toString()); +lintAsync(options, function callback(error, results) { + if (!error && results) { + console.dir(results, { "colors": true, "depth": null }); } }); ``` -Or invoke `markdownlint.sync` for a synchronous call: +Or as a synchronous call: -```js -var result = markdownlint.sync(options); -console.log(result.toString()); +```javascript +import { lint as lintSync } from "markdownlint/sync"; + +const results = lintSync(options); +console.dir(results, { "colors": true, "depth": null }); ``` -Output of both calls: +Or as a `Promise`-based call: -```text -bad.string: 3: MD010 Hard tabs -bad.string: 1: MD018 No space after hash on atx style header -bad.string: 3: MD018 No space after hash on atx style header -bad.md: 3: MD010 Hard tabs -bad.md: 1: MD018 No space after hash on atx style header -bad.md: 3: MD018 No space after hash on atx style header +```javascript +import { lint as lintPromise } from "markdownlint/promise"; + +const results = await lintPromise(options); +console.dir(results, { "colors": true, "depth": null }); ``` -To examine the `result` object directly: - -```js -markdownlint(options, function callback(err, result) { - if (!err) { - console.dir(result, { "colors": true }); - } -}); -``` - -Output: +All of which return an object like: ```json { - "good.string": {}, - "bad.string": { - "MD010": [ 3 ], - "MD018": [ 1, 3 ] - }, - "good.md": {}, - "bad.md": { - "MD010": [ 3 ], - "MD018": [ 1, 3 ] - } + "good.md": [], + "bad.md": [ + { "lineNumber": 3, + "ruleNames": [ "MD010", "no-hard-tabs" ], + "ruleDescription": "Hard tabs", + "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md", + "errorDetail": "Column: 17", + "errorContext": null, + "errorRange": [ 17, 1 ], + "fixInfo": { "editColumn": 17, "deleteCount": 1, "insertText": " " }, + "severity": "error" }, + { "lineNumber": 1, + "ruleNames": [ "MD018", "no-missing-space-atx" ], + "ruleDescription": "No space after hash on atx style heading", + "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md", + "errorDetail": null, + "errorContext": "#bad.md", + "errorRange": [ 1, 2 ], + "fixInfo": { "editColumn": 2, "insertText": " " }, + "severity": "error" }, + { "lineNumber": 3, + "ruleNames": [ "MD018", "no-missing-space-atx" ], + "ruleDescription": "No space after hash on atx style heading", + "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md", + "errorDetail": null, + "errorContext": "#This file fails\tsome rules.", + "errorRange": [ 1, 2 ], + "fixInfo": { "editColumn": 2, "insertText": " " }, + "severity": "error" }, + { "lineNumber": 1, + "ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ], + "ruleDescription": "First line in a file should be a top-level heading", + "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md", + "errorDetail": null, + "errorContext": "#bad.md", + "errorRange": null, + "fixInfo": null, + "severity": "error" } + ] } ``` -Integration with the [gulp](http://gulpjs.com/) build system is straightforward: - -```js -var gulp = require("gulp"); -var through2 = require("through2"); -var markdownlint = require("markdownlint"); - -gulp.task("markdownlint", function task() { - return gulp.src("*.md", { "read": false }) - .pipe(through2.obj(function obj(file, enc, next) { - markdownlint( - { "files": [ file.relative ] }, - function callback(err, result) { - var resultString = (result || "").toString(); - if (resultString) { - console.log(resultString); - } - next(err, file); - }); - })); -}); -``` - -Output: - -```text -[00:00:00] Starting 'markdownlint'... -bad.md: 3: MD010 Hard tabs -bad.md: 1: MD018 No space after hash on atx style header -bad.md: 3: MD018 No space after hash on atx style header -[00:00:00] Finished 'markdownlint' after 10 ms -``` - -Integration with the [Grunt](http://gruntjs.com/) build system is similar: - -```js -var markdownlint = require("markdownlint"); - -module.exports = function wrapper(grunt) { - grunt.initConfig({ - "markdownlint": { - "example": { - "src": [ "*.md" ] - } - } - }); - - grunt.registerMultiTask("markdownlint", function task() { - var done = this.async(); - markdownlint( - { "files": this.filesSrc }, - function callback(err, result) { - var resultString = err || ((result || "").toString()); - if (resultString) { - grunt.fail.warn("\n" + resultString + "\n"); - } - done(!err || !resultString); - }); - }); -}; -``` - -Output: - -```text -Running "markdownlint:example" (markdownlint) task -Warning: -bad.md: 3: MD010 Hard tabs -bad.md: 1: MD018 No space after hash on atx style header -bad.md: 3: MD018 No space after hash on atx style header - Use --force to continue. -``` - ## Browser -`markdownlint` works in the browser. +`markdownlint` also works in the browser. Generate normal and minified scripts with: -```shell +```bash npm run build-demo ``` -Then reference `markdown-it` and `markdownlint`: +Then reference the `markdownlint-browser` script: ```html - ``` And call it like so: -```js -var options = { +```javascript +const options = { "strings": { "content": "Some Markdown to lint." } }; -var results = window.markdownlint.sync(options).toString(); + +const results = globalThis.markdownlint.lintSync(options); ``` +## Examples + +For ideas how to integrate `markdownlint` into your workflow, refer to the +following projects or one of the tools in the [Related section](#related): + +- [.NET Documentation][dot-net-doc] ([Search repository][dot-net-doc-search]) +- [ally.js][ally-js] ([Search repository][ally-js-search]) +- [Apache Airflow][airflow] ([Search repository][airflow-search]) +- [CodiMD][codimd] ([Search repository][codimd-search]) +- [Electron][electron] ([Search repository][electron-search]) +- [ESLint][eslint] ([Search repository][eslint-search]) +- [Garden React Components][garden] ([Search repository][garden-search]) +- [MDN Web Docs][mdn] ([Search repository][mdn-search]) +- [MkDocs][mkdocs] ([Search repository][mkdocs-search]) +- [Mocha][mocha] ([Search repository][mocha-search]) +- [Pi-hole documentation][pi-hole] ([Search repository][pi-hole-search]) +- [Reactable][reactable] ([Search repository][reactable-search]) +- [V8][v8] ([Search repository][v8-search]) +- [webhint][webhint] ([Search repository][webhint-search]) +- [webpack][webpack] ([Search repository][webpack-search]) +- [WordPress][wordpress] ([Search repository][wordpress-search]) + +For more advanced integration scenarios: + +- [GitHub Docs content linter][content-linter] +- [GitHub's `markdownlint-github` repository][markdownlint-github] + +[ally-js]: https://allyjs.io/ +[ally-js-search]: https://github.com/medialize/ally.js/search?q=markdownlint +[airflow]: https://airflow.apache.org +[airflow-search]: https://github.com/apache/airflow/search?q=markdownlint +[codimd]: https://github.com/hackmdio/codimd +[codimd-search]: https://github.com/hackmdio/codimd/search?q=markdownlint +[content-linter]: https://docs.github.com/en/contributing/collaborating-on-github-docs/using-the-content-linter +[dot-net-doc]: https://docs.microsoft.com/en-us/dotnet/ +[dot-net-doc-search]: https://github.com/dotnet/docs/search?q=markdownlint +[electron]: https://www.electronjs.org +[electron-search]: https://github.com/electron/electron/search?q=markdownlint +[eslint]: https://eslint.org/ +[eslint-search]: https://github.com/eslint/eslint/search?q=markdownlint +[garden]: https://zendeskgarden.github.io/react-components/ +[garden-search]: https://github.com/zendeskgarden/react-components/search?q=markdownlint +[markdownlint-github]: https://github.com/github/markdownlint-github +[mdn]: https://developer.mozilla.org/ +[mdn-search]: https://github.com/mdn/content/search?q=markdownlint +[mkdocs]: https://www.mkdocs.org/ +[mkdocs-search]: https://github.com/mkdocs/mkdocs/search?q=markdownlint +[mocha]: https://mochajs.org/ +[mocha-search]: https://github.com/mochajs/mocha/search?q=markdownlint +[pi-hole]: https://docs.pi-hole.net +[pi-hole-search]: https://github.com/pi-hole/docs/search?q=markdownlint +[reactable]: https://glittershark.github.io/reactable/ +[reactable-search]: https://github.com/glittershark/reactable/search?q=markdownlint +[v8]: https://v8.dev/ +[v8-search]: https://github.com/v8/v8.dev/search?q=markdownlint +[webhint]: https://webhint.io/ +[webhint-search]: https://github.com/webhintio/hint/search?q=markdownlint +[webpack]: https://webpack.js.org/ +[webpack-search]: https://github.com/webpack/webpack.js.org/search?q=markdownlint +[wordpress]: https://wordpress.org/gutenberg/ +[wordpress-search]: https://github.com/WordPress/gutenberg/search?q=markdownlint + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. + +## Releasing + +See [ReleaseProcess.md](doc/ReleaseProcess.md) for more information. + ## History -* 0.0.1 - Initial release, includes tests MD001-MD032. -* 0.0.2 - Improve documentation, tests, and code. -* 0.0.3 - Add synchronous API, improve documentation and code. -* 0.0.4 - Add tests MD033-MD040, update dependencies. -* 0.0.5 - Add `strings` option to enable file-less scenarios, add in-browser demo. -* 0.0.6 - Improve performance, simplify in-browser, update dependencies. -* 0.0.7 - Add MD041, improve MD003, ignore front matter, update dependencies. +See [CHANGELOG.md](CHANGELOG.md). [npm-image]: https://img.shields.io/npm/v/markdownlint.svg [npm-url]: https://www.npmjs.com/package/markdownlint -[github-tag-image]: https://img.shields.io/github/tag/DavidAnson/markdownlint.svg -[github-tag-url]: https://github.com/DavidAnson/markdownlint -[travis-image]: https://img.shields.io/travis/DavidAnson/markdownlint/master.svg -[travis-url]: https://travis-ci.org/DavidAnson/markdownlint -[coveralls-image]: https://img.shields.io/coveralls/DavidAnson/markdownlint/master.svg -[coveralls-url]: https://coveralls.io/r/DavidAnson/markdownlint [license-image]: https://img.shields.io/npm/l/markdownlint.svg -[license-url]: http://opensource.org/licenses/MIT +[license-url]: https://opensource.org/licenses/MIT diff --git a/demo/Web.config b/demo/Web.config deleted file mode 100644 index 6b57f21d..00000000 --- a/demo/Web.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demo/browser-exports.mjs b/demo/browser-exports.mjs new file mode 100644 index 00000000..3ed596ca --- /dev/null +++ b/demo/browser-exports.mjs @@ -0,0 +1,11 @@ +// @ts-check + +export { applyFixes, getVersion } from "markdownlint"; +export { lint as lintSync } from "markdownlint/sync"; +export { frontMatterRe } from "markdownlint/helpers"; +export { compile, parse, postprocess, preprocess } from "micromark"; +export { directive, directiveHtml } from "micromark-extension-directive"; +export { gfmAutolinkLiteral, gfmAutolinkLiteralHtml } from "micromark-extension-gfm-autolink-literal"; +export { gfmFootnote, gfmFootnoteHtml } from "micromark-extension-gfm-footnote"; +export { gfmTable, gfmTableHtml } from "micromark-extension-gfm-table"; +export { math, mathHtml } from "micromark-extension-math"; diff --git a/demo/browser-polyfills.js b/demo/browser-polyfills.js deleted file mode 100644 index d62d41a6..00000000 --- a/demo/browser-polyfills.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -// Polyfills for browsers that do not support String.trimLeft/Right -function trimLeftPolyfill() { - return this.replace(/^\s*/, ""); -} -/* istanbul ignore if */ -if (!String.prototype.trimLeft) { - String.prototype.trimLeft = trimLeftPolyfill; -} -function trimRightPolyfill() { - return this.replace(/\s*$/, ""); -} -/* istanbul ignore if */ -if (!String.prototype.trimRight) { - String.prototype.trimRight = trimRightPolyfill; -} - -// Export for testing -/* istanbul ignore else */ -if ((typeof module !== "undefined") && module.exports) { - module.exports = { - "trimLeftPolyfill": trimLeftPolyfill, - "trimRightPolyfill": trimRightPolyfill - }; -} diff --git a/demo/default.css b/demo/default.css index b5030189..ee41cff6 100644 --- a/demo/default.css +++ b/demo/default.css @@ -42,6 +42,17 @@ textarea { padding: 0; resize: none; } +.detail { + font-size: 80%; + font-style: italic; + white-space: pre-wrap; +} +.warning { + background: rgb(255, 255, 0, 0.5); +} +.error { + background: rgb(255, 0, 0, 0.3); +} .flex-rows { display: flex; flex-direction: column; @@ -59,7 +70,7 @@ textarea { min-height: 0; } .highlight { - background: yellow; + background: rgb(0, 255, 255, 0.8); } .inset { box-sizing: border-box; diff --git a/demo/default.htm b/demo/default.htm index 1a3d020a..4c1bc442 100644 --- a/demo/default.htm +++ b/demo/default.htm @@ -1,24 +1,24 @@ - + - - + + markdownlint demo
-
markdownlint demo
+
markdownlint demo
- +
@@ -28,7 +28,9 @@
- + +
+
diff --git a/demo/default.js b/demo/default.js index 75d56e49..c595d854 100644 --- a/demo/default.js +++ b/demo/default.js @@ -1,6 +1,11 @@ "use strict"; (function main() { + // Dependencies + var markdownit = globalThis.markdownit; + var markdownlint = globalThis.markdownlint; + var micromark = markdownlint; + // DOM elements var markdown = document.getElementById("markdown"); var markup = document.getElementById("markup"); @@ -8,19 +13,101 @@ var violations = document.getElementById("violations"); var form = document.getElementsByTagName("form")[0]; var openFile = document.getElementById("openFile"); + var copyLink = document.getElementById("copyLink"); // Variables - var markdownit = window.markdownit(); var newLineRe = /\r\n|\r|\n/; - var rulesMd = "https://github.com/DavidAnson/markdownlint" + - "/blob/master/doc/Rules.md"; + var hashPrefix = "%m"; + var allLintErrors = []; + + // Do-nothing function + function noop() {} + + // Sanitize string for HTML display + function sanitize(str) { + return str + .replace(/&/g, "&") + .replace(//g, ">"); + } + + // Renders directive metadata + function handleDirective(directive) { + const content = directive.content; + delete directive.content; + if (content) { + this.tag("
"); + } + this.tag(""); + this.raw(this.encode(JSON.stringify(directive))); + this.tag(""); + this.raw(content); + if (content) { + this.tag("
"); + } + } + + // Renders Markdown to HTML + function render(markdown) { + markdown = markdown.replace(markdownlint.frontMatterRe, ""); + const match = /^\?renderer=([a-z-]+)$/.exec(globalThis.location.search); + const renderer = match ? match[1] : "micromark"; + if (renderer === "markdown-it") { + return markdownit({ "html": true }).render(markdown); + } else if (renderer === "micromark") { + const parseOptions = { + "extensions": [ + micromark.directive(), + micromark.gfmAutolinkLiteral(), + micromark.gfmFootnote(), + micromark.gfmTable(), + micromark.math() + ] + }; + const context = micromark.parse(parseOptions); + const chunks = micromark.preprocess()(markdown, undefined, true); + const events = micromark.postprocess(context.document().write(chunks)); + const compileOptions = { + "allowDangerousHtml": true, + "htmlExtensions": [ + micromark.directiveHtml({ "*": handleDirective }), + micromark.gfmAutolinkLiteralHtml(), + micromark.gfmFootnoteHtml(), + micromark.gfmTableHtml(), + micromark.mathHtml() + ] + }; + try { + return micromark.compile(compileOptions)(events); + } catch(error) { + return `[Exception: "${error}"]`; + } + } + return `[Unsupported renderer "${renderer}"]`; + } + + // Highlight ranges + function highlightRanges(results, className) { + for (const result of results) { + const { errorRange, lineNumber } = result; + const line = document.getElementById(`l${lineNumber}`); + line.classList.add(className); + if (errorRange) { + const [ col, len ] = errorRange; + for (let i = 0; i < len; i++) { + var char = document.getElementById(`l${lineNumber}c${col + i}`); + char.classList.add(className); + } + } + } + } // Handle input function onMarkdownInput() { // Markdown var content = markdown.value; // Markup - markup.innerHTML = markdownit.render(content); + markup.innerHTML = render(content); // Numbered var lines = content.split(newLineRe); var padding = lines.length.toString().replace(/\d/g, " "); @@ -28,8 +115,12 @@ .map(function mapNumberedLine(line, index) { index++; var paddedIndex = (padding + index).slice(-padding.length); - return "" + paddedIndex + ": " + - line + ""; + return ( + `${paddedIndex}: ` + + // eslint-disable-next-line unicorn/prefer-spread + line.split("").map((c, i) => `${sanitize(c)}`).join("") + + "" + ); }).join("\n"); // Violations var options = { @@ -38,19 +129,39 @@ }, "config": { "MD013": false - } + }, + "handleRuleFailures": true }; - var results = window.markdownlint.sync(options).toString(); - violations.innerHTML = results.split(newLineRe) - .map(function mapResultLine(line) { - return line.replace(/^content: (\d+): (MD\d\d\d) (.*)$/, - function replacer(match, p1, p2, p3) { - var ruleRef = rulesMd + "#" + p2.toLowerCase() + "---" + - p3.toLowerCase().replace(/ /g, "-"); - return "" + p1 + " - " + - "" + p2 + " " + p3; - }); - }).join("
"); + allLintErrors = markdownlint.lintSync(options).content; + violations.innerHTML = allLintErrors.map(function mapResult(result) { + var ruleName = result.ruleNames.slice(0, 2).join(" / "); + var resultJson = encodeURIComponent(JSON.stringify(result)).replaceAll("'", "%27"); + return "" + + result.lineNumber + " - " + ruleName + " " + + result.ruleDescription + + (result.errorDetail ? + " [" + + sanitize(result.errorDetail) + + "]" : + "") + + (result.errorContext ? + " [Context: \"" + + sanitize(result.errorContext) + + "\"]" : + "") + + " [" + + result.severity + + "]" + + (result.fixInfo ? + " [Fix]" : + ""); + }).join("
"); + // Highlight errors and warnings + highlightRanges(allLintErrors.filter((error) => error.severity === "warning"), "warning"); + highlightRanges(allLintErrors.filter((error) => error.severity === "error"), "error"); } // Load from a string or File object @@ -63,12 +174,10 @@ onMarkdownInput(); } else { // Update from File object - var reader = new FileReader(); - reader.onload = function readerOnload(e) { - markdown.value = e.target.result; + source.text().then((text) => { + markdown.value = text; onMarkdownInput(); - }; - reader.readAsText(source); + }); } } @@ -94,31 +203,61 @@ } // Handle violation navigation - function onLineNumberClick(e) { - var line = document.getElementById("l" + e.target.textContent); - if (line) { - var highlighted = document.getElementsByClassName("highlight"); - Array.prototype.forEach.call(highlighted, function forElement(element) { - element.classList.remove("highlight"); - }); - line.classList.add("highlight"); - line.scrollIntoView(); - e.preventDefault(); + function onViolationClick(e) { + const resultJson = JSON.parse(decodeURIComponent(e.target.target)); + switch (e.target.hash) { + case "#fix": + var errors = e.shiftKey ? + allLintErrors : + [ resultJson ]; + var fixed = markdownlint.applyFixes(markdown.value, errors); + markdown.value = fixed; + onMarkdownInput(); + e.preventDefault(); + break; + case "#line": + // eslint-disable-next-line unicorn/no-useless-spread + for (const element of [ ...document.getElementsByClassName("highlight") ]) { + element.classList.remove("highlight"); + } + highlightRanges([ resultJson ], "highlight"); + var line = document.getElementById(`l${resultJson.lineNumber}`); + line.scrollIntoView(); + e.preventDefault(); + break; + default: + break; } } + // Updates the URL hash and copies the URL to the clipboard + function onCopyLinkClick(e) { + globalThis.location.hash = encodeURIComponent(hashPrefix + markdown.value); + if (navigator.clipboard && navigator.clipboard.writeText) { + navigator.clipboard.writeText(globalThis.location).then(noop, noop); + } else { + /* eslint-disable-next-line no-alert */ + alert("Document URL updated, select and copy it now."); + } + e.preventDefault(); + } + + // Show library version + var version = markdownlint.getVersion(); + document.getElementById("version").textContent = "(v" + version + ")"; + // Add event listeners document.body.addEventListener("dragover", onDragOver); document.body.addEventListener("drop", onDrop); openFile.addEventListener("change", onOpenFileChange); markdown.addEventListener("input", onMarkdownInput); - violations.addEventListener("click", onLineNumberClick, true); + violations.addEventListener("click", onViolationClick, true); + copyLink.addEventListener("click", onCopyLinkClick); - /*eslint-disable max-len */ markdown.value = [ "## Introduction", "", - "`markdownlint` is a [Node.js](https://nodejs.org/)/[io.js](https://iojs.org/) style checker and lint tool for [Markdown](http://en.wikipedia.org/wiki/Markdown) files to automatically validate content, prevent rendering problems, and promote consistency.", + "`markdownlint` is a [Node.js](https://nodejs.org/) style checker and lint tool for [Markdown](https://en.wikipedia.org/wiki/Markdown)/[CommonMark](https://commonmark.org/) files to automatically validate content, prevent rendering problems, and promote consistency.", "This page offers an easy way to try it out interactively!", "", "#### Instructions", @@ -127,19 +266,45 @@ "Content gets parsed and displayed in the upper-right box; rule violations (if any) show up in the lower-right box.", "Click a violation for information about it or click its line number to highlighted it in the lower-left box.", "", - "> *Note*: [All rules](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md) are enabled except for [MD013 Line length](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013---line-length). ", + "> *Note*: [All rules](https://github.com/DavidAnson/markdownlint/blob/v" + version + "/doc/Rules.md) are enabled except [MD013/line-length](https://github.com/DavidAnson/markdownlint/blob/v" + version + "/doc/md013.md).", "", "", "#### Resources", "* [`markdownlint` on GitHub](https://github.com/DavidAnson/markdownlint)", "* [`markdownlint` on npm](https://www.npmjs.com/package/markdownlint)", - "* [Markdown specification](http://daringfireball.net/projects/markdown/)", - "*\t[CommonMark specification](http://commonmark.org/)", + "* [Markdown specification](https://daringfireball.net/projects/markdown/)", + "*\t[CommonMark specification](https://commonmark.org/)", "", "#### Thanks", "", - "[`markdownlint/Ruby`](https://github.com/mivok/markdownlint) for the inspiration and [`markdown-it`](https://github.com/markdown-it/markdown-it) for the parser and interactive demo idea!" + "[`markdownlint/Ruby`](https://github.com/markdownlint/markdownlint) for the inspiration and [`markdown-it`](https://github.com/markdown-it/markdown-it) for the parser and interactive demo idea!", + "" ].join("\n"); - /*eslint-enable max-len */ + + // Update Markdown from hash (if present) + if (globalThis.location.hash) { + try { + var decodedHash = decodeURIComponent(globalThis.location.hash.substring(1)); + if (hashPrefix === decodedHash.substring(0, hashPrefix.length)) { + markdown.value = decodedHash.substring(hashPrefix.length); + } + } catch { + // Invalid + } + } + + // Detect legacy browsers + try { + /* eslint-disable-next-line no-new */ + new URL("https://example.com/"); + } catch { + markdown.value = [ + "# Sorry", + "", + "This browser is not supported." + ].join("\n"); + } + + // Initialize onMarkdownInput(); }()); diff --git a/demo/favicon.svg b/demo/favicon.svg new file mode 100644 index 00000000..8d3acbca --- /dev/null +++ b/demo/favicon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/demo/file-header.js b/demo/file-header.js deleted file mode 100644 index fe9347be..00000000 --- a/demo/file-header.js +++ /dev/null @@ -1,2 +0,0 @@ -/* markdownlint - https://github.com/DavidAnson/markdownlint - @license MIT */ - diff --git a/demo/markdown-it-stub.js b/demo/markdown-it-stub.js deleted file mode 100644 index 88fc2f41..00000000 --- a/demo/markdown-it-stub.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -// Alias "markdown-it" (expected) to "markdownit" (exported) -module.exports = window.markdownit; -if (!module.exports) { - console.error("markdown-it must be loaded before markdownlint."); -} diff --git a/demo/offline.appcache b/demo/offline.appcache deleted file mode 100644 index d0c0effb..00000000 --- a/demo/offline.appcache +++ /dev/null @@ -1,10 +0,0 @@ -CACHE MANIFEST -# 2015-06-17 -default.css -default.htm -default.js -favicon.ico -markdown-it.min.js -markdownlint-browser.min.js -NETWORK: -* diff --git a/demo/webpack.config.mjs b/demo/webpack.config.mjs new file mode 100644 index 00000000..de05a602 --- /dev/null +++ b/demo/webpack.config.mjs @@ -0,0 +1,81 @@ +// @ts-check + +import webpack from "webpack"; +import TerserPlugin from "terser-webpack-plugin"; +import { __dirname, importWithTypeJson } from "../test/esm-helpers.mjs"; +const libraryPackageJson = await importWithTypeJson(import.meta, "../package.json"); + +// eslint-disable-next-line jsdoc/require-jsdoc +function config(options) { + const { entry, filename, mode, optimization, packageJson } = options; + const { name, version, homepage, license } = packageJson; + return { + "devtool": false, + "entry": entry, + "externals": { + "markdown-it": "markdownit" + }, + "mode": mode, + "name": name, + "optimization": optimization, + "output": { + "filename": filename, + "library": { + "name": name.replace(/(-\w)/g, (m) => m.slice(1).toUpperCase()), + "type": "var" + }, + "path": __dirname(import.meta) + }, + "plugins": [ + new webpack.BannerPlugin({ + "banner": `${name} ${version} ${homepage} @license ${license}` + }) + ], + "ignoreWarnings": [ + { + "message": /(asset|entrypoint) size limit/ + }, + { + "message": /dependencies cannot be statically extracted/ + }, + { + "message": /lazy load some parts of your application/ + } + ] + }; +} + +const modeDevelopment = { + "mode": "development" +}; +const modeProduction = { + "mode": "production", + "optimization": { + "minimizer": [ + new TerserPlugin({ + "extractComments": false, + "terserOptions": { + "compress": { + "passes": 2 + } + } + }) + ] + } +}; +const entryLibrary = { + "entry": "./browser-exports.mjs", + "packageJson": libraryPackageJson +}; +export default [ + config({ + ...entryLibrary, + ...modeDevelopment, + "filename": "markdownlint-browser.js" + }), + config({ + ...entryLibrary, + ...modeProduction, + "filename": "markdownlint-browser.min.js" + }) +]; diff --git a/doc-build/.markdownlint.jsonc b/doc-build/.markdownlint.jsonc new file mode 100644 index 00000000..a9ab083c --- /dev/null +++ b/doc-build/.markdownlint.jsonc @@ -0,0 +1,6 @@ +{ + "extends": "../.markdownlint.json", + + // Headings are added by the "build-docs" script (build-rules.mjs) + "first-line-heading": false +} diff --git a/doc-build/build-rules.mjs b/doc-build/build-rules.mjs new file mode 100644 index 00000000..274fe5a5 --- /dev/null +++ b/doc-build/build-rules.mjs @@ -0,0 +1,121 @@ +import { readFile, writeFile } from "node:fs/promises"; +import { EOL } from "node:os"; +import rules from "../lib/rules.mjs"; +import { newLineRe } from "../helpers/helpers.cjs"; +import { deprecatedRuleNames, fixableRuleNames } from "../lib/constants.mjs"; + +const maxLineLength = 80; + +const pathFor = (relativePath) => new URL(relativePath, import.meta.url); +const inCode = (items) => items.map((item) => `\`${item}\``); +const sortedComma = (items) => items.toSorted().join(", "); +const linesFrom = (text) => text.split(newLineRe); +const wrapListItem = (line) => { + const wrappedLines = []; + let remainingLine = line; + while (remainingLine.length > maxLineLength) { + let index = maxLineLength - 1; + while (remainingLine[index] !== " ") { + index--; + } + wrappedLines.push(remainingLine.slice(0, index + 1).trimEnd()); + remainingLine = " " + remainingLine.slice(index + 1).trimStart(); + } + wrappedLines.push(remainingLine); + return wrappedLines; +}; + +// import { default as schema } from "file.json" assert { type: "json" }; +const importJson = + async(file) => JSON.parse(await readFile(pathFor(file))); +const schema = await importJson("../schema/markdownlint-config-schema.json"); + +const lines = []; + +const heading = await readFile(pathFor("./heading.md"), "utf8"); +lines.push(...linesFrom(heading)); + +for (const rule of rules) { + const name = rule.names[0]; + const deprecated = deprecatedRuleNames.includes(name); + const decorator = deprecated ? "~~" : ""; + lines.push( + ``, + "" + ); + const section = [ + `## ${decorator}\`${name}\` - ${rule.description}${decorator}`, + "" + ]; + if (deprecated) { + section.push( + "> This rule is deprecated and provided for backward-compatibility", + "" + ); + } + section.push( + `Tags: ${sortedComma(inCode(rule.tags))}`, + "", + `Aliases: ${sortedComma(inCode(rule.names.slice(1)))}`, + "" + ); + const ruleData = schema.properties[name]; + const ruleProperties = Object.fromEntries( + Object.entries( + ruleData.oneOf.at(-1).properties + ).filter(([ key ]) => ((key !== "enabled") && (key !== "severity"))) + ); + if (Object.keys(ruleProperties).length > 0) { + section.push( + "Parameters:", + "" + ); + for (const property of Object.keys(ruleProperties).toSorted()) { + const propData = ruleProperties[property]; + const propType = [ propData.type ] + .flat() + .map((type) => ((type === "array") ? `${propData.items.type}[]` : type)) + .join("|"); + const defaultValue = Array.isArray(propData.default) ? + JSON.stringify(propData.default) : + propData.default; + const allValues = propData.enum?.toSorted(); + const listItem = `- \`${property}\`: ${propData.description} (` + + `\`${propType}\`, default \`${defaultValue}\`` + + (propData.enum ? + `, values ${allValues.map((value) => `\`${value}\``).join(" / ")}` : + "" + ) + + ")"; + section.push(...wrapListItem(listItem)); + } + section.push( + "" + ); + } + if (fixableRuleNames.includes(name)) { + section.push( + "Fixable: Some violations can be fixed by tooling", + "" + ); + } + const contents = + // eslint-disable-next-line no-await-in-loop + await readFile(pathFor(`./${name.toLowerCase()}.md`), "utf8"); + section.push(...linesFrom(contents)); + + // eslint-disable-next-line no-await-in-loop + await writeFile( + pathFor(`../doc/${name.toLowerCase()}.md`), + section.join(EOL).slice(1), + "utf8" + ); + + lines.push(...section); +} + +const footing = await readFile(pathFor("./footing.md"), "utf8"); +lines.push(...linesFrom(footing)); + +const content = lines.join(EOL); +await writeFile(pathFor("../doc/Rules.md"), content, "utf8"); diff --git a/doc-build/footing.md b/doc-build/footing.md new file mode 100644 index 00000000..c0ea00fb --- /dev/null +++ b/doc-build/footing.md @@ -0,0 +1,7 @@ + diff --git a/doc-build/heading.md b/doc-build/heading.md new file mode 100644 index 00000000..384d491a --- /dev/null +++ b/doc-build/heading.md @@ -0,0 +1,5 @@ +# Rules + +This document contains a description of all rules, what they are checking for, +as well as examples of documents that break the rule and corrected +versions of the examples. diff --git a/doc-build/md001.md b/doc-build/md001.md new file mode 100644 index 00000000..51903bf0 --- /dev/null +++ b/doc-build/md001.md @@ -0,0 +1,40 @@ +This rule is triggered when you skip heading levels in a Markdown document, for +example: + +```markdown +# Heading 1 + +### Heading 3 + +We skipped out a 2nd level heading in this document +``` + +When using multiple heading levels, nested headings should increase by only one +level at a time: + +```markdown +# Heading 1 + +## Heading 2 + +### Heading 3 + +#### Heading 4 + +## Another Heading 2 + +### Another Heading 3 +``` + +If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and +contains a `title` property (commonly used with blog posts), this rule treats +that as a top level heading and will report a violation if the actual first +heading is not a level 2 heading. To use a different property name in the +front matter, specify the text of a regular expression via the +`front_matter_title` parameter. To disable the use of front matter by this +rule, specify `""` for `front_matter_title`. When front matter is not present, +the first heading can be any level. + +Rationale: Headings represent the structure of a document and can be confusing +when skipped - especially for accessibility scenarios. More information: +. diff --git a/doc-build/md003.md b/doc-build/md003.md new file mode 100644 index 00000000..420b2a2d --- /dev/null +++ b/doc-build/md003.md @@ -0,0 +1,47 @@ +This rule is triggered when different heading styles are used in the same +document: + +```markdown +# ATX style H1 + +## Closed ATX style H2 ## + +Setext style H1 +=============== +``` + +To fix the issue, use consistent heading styles throughout the document: + +```markdown +# ATX style H1 + +## ATX style H2 +``` + +The `setext_with_atx` and `setext_with_atx_closed` settings allow ATX-style +headings of level 3 or more in documents with setext-style headings (which only +support level 1 and 2 headings): + +```markdown +Setext style H1 +=============== + +Setext style H2 +--------------- + +### ATX style H3 +``` + +Note: The configured heading style can be a specific style to require (`atx`, +`atx_closed`, `setext`, `setext_with_atx`, `setext_with_atx_closed`), or can +require that all heading styles match the first heading style via `consistent`. + +Note: The placement of a horizontal rule directly below a line of text can +trigger this rule by turning that text into a level 2 setext-style heading: + +```markdown +A line of text followed by a horizontal rule becomes a heading +--- +``` + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md004.md b/doc-build/md004.md new file mode 100644 index 00000000..7eb9bae9 --- /dev/null +++ b/doc-build/md004.md @@ -0,0 +1,37 @@ +This rule is triggered when the symbols used in the document for unordered +list items do not match the configured unordered list style: + +```markdown +* Item 1 ++ Item 2 +- Item 3 +``` + +To fix this issue, use the configured style for list items throughout the +document: + +```markdown +* Item 1 +* Item 2 +* Item 3 +``` + +The configured list style can ensure all list styling is a specific symbol +(`asterisk`, `plus`, `dash`), ensure each sublist has a consistent symbol that +differs from its parent list (`sublist`), or ensure all list styles match the +first list style (`consistent`). + +For example, the following is valid for the `sublist` style because the +outer-most indent uses asterisk, the middle indent uses plus, and the inner-most +indent uses dash: + +```markdown +* Item 1 + + Item 2 + - Item 3 + + Item 4 +* Item 4 + + Item 5 +``` + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md005.md b/doc-build/md005.md new file mode 100644 index 00000000..9c667074 --- /dev/null +++ b/doc-build/md005.md @@ -0,0 +1,45 @@ +This rule is triggered when list items are parsed as being at the same level, +but don't have the same indentation: + +```markdown +* Item 1 + * Nested Item 1 + * Nested Item 2 + * A misaligned item +``` + +Usually, this rule will be triggered because of a typo. Correct the indentation +for the list to fix it: + +```markdown +* Item 1 + * Nested Item 1 + * Nested Item 2 + * Nested Item 3 +``` + +Sequentially-ordered list markers are usually left-aligned such that all items +have the same starting column: + +```markdown +... +8. Item +9. Item +10. Item +11. Item +... +``` + +This rule also supports right-alignment of list markers such that all items have +the same ending column: + +```markdown +... + 8. Item + 9. Item +10. Item +11. Item +... +``` + +Rationale: Violations of this rule can lead to improperly rendered content. diff --git a/doc-build/md007.md b/doc-build/md007.md new file mode 100644 index 00000000..7e1cb208 --- /dev/null +++ b/doc-build/md007.md @@ -0,0 +1,36 @@ +This rule is triggered when list items are not indented by the configured +number of spaces (default: 2). + +Example: + +```markdown +* List item + * Nested list item indented by 3 spaces +``` + +Corrected Example: + +```markdown +* List item + * Nested list item indented by 2 spaces +``` + +Note: This rule applies to a sublist only if its parent lists are all also +unordered (otherwise, extra indentation of ordered lists interferes with the +rule). + +The `start_indented` parameter allows the first level of lists to be indented by +the configured number of spaces rather than starting at zero. The `start_indent` +parameter allows the first level of lists to be indented by a different number +of spaces than the rest (ignored when `start_indented` is not set). + +Rationale: Indenting by 2 spaces allows the content of a nested list to be in +line with the start of the content of the parent list when a single space is +used after the list marker. Indenting by 4 spaces is consistent with code blocks +and simpler for editors to implement. Additionally, this can be a compatibility +issue for other Markdown parsers, which require 4-space indents. More +information: [Markdown Style Guide][markdown-style-guide]. + +Note: See [Prettier.md](Prettier.md) for compatibility information. + +[markdown-style-guide]: https://cirosantilli.com/markdown-style-guide#indentation-of-content-inside-lists diff --git a/doc-build/md009.md b/doc-build/md009.md new file mode 100644 index 00000000..8ff10ca6 --- /dev/null +++ b/doc-build/md009.md @@ -0,0 +1,34 @@ +This rule is triggered on any lines that end with unexpected whitespace. To fix +this, remove the trailing space from the end of the line. + +The `br_spaces` parameter allows an exception to this rule for a specific number +of trailing spaces, typically used to insert an explicit line break. The default +value allows 2 spaces to indicate a hard break (\
element). (You must set +`br_spaces` to a value >= 2 for this parameter to take effect. Setting +`br_spaces` to 1 behaves the same as 0, disallowing any trailing spaces.) + +By default, trailing space is allowed in indented and fenced code blocks because +some programming languages require that. To report such instances, set the +`code_blocks` parameter to `true`. + +By default, this rule will not trigger when the allowed number of spaces is +used, even when it doesn't create a hard break (for example, at the end of a +paragraph). To report such instances, set the `strict` parameter to `true`. + +```markdown +Text text text +text[2 spaces] +``` + +Using spaces to indent blank lines inside a list item is usually not necessary, +but some parsers require it. Set the `list_item_empty_lines` parameter to `true` +to allow this (even when `strict` is `true`): + +```markdown +- list item text + [2 spaces] + list item text +``` + +Rationale: Except when being used to create a line break, trailing whitespace +has no purpose and does not affect the rendering of content. diff --git a/doc-build/md010.md b/doc-build/md010.md new file mode 100644 index 00000000..023f737d --- /dev/null +++ b/doc-build/md010.md @@ -0,0 +1,47 @@ +This rule is triggered by any lines that contain hard tab characters instead +of using spaces for indentation. To fix this, replace any hard tab characters +with spaces instead. + +Example: + + + +```markdown +Some text + + * hard tab character used to indent the list item +``` + + + +Corrected example: + +```markdown +Some text + + * Spaces used to indent the list item instead +``` + +You have the option to exclude this rule for code blocks and spans. To do so, +set the `code_blocks` parameter to `false`. Code blocks and spans are included +by default since handling of tabs by Markdown tools can be inconsistent (e.g., +using 4 vs. 8 spaces). + +When code blocks are scanned (e.g., by default or if `code_blocks` is `true`), +the `ignore_code_languages` parameter can be set to a list of languages that +should be ignored (i.e., hard tabs will be allowed, though not required). This +makes it easier for documents to include code for languages that require hard +tabs. + +By default, violations of this rule are fixed by replacing the tab with 1 space +character. To use a different number of spaces, set the `spaces_per_tab` +parameter to the desired value. + +Rationale: Hard tabs are often rendered inconsistently by different editors and +can be harder to work with than spaces. + +More information: + +- +- +- diff --git a/doc-build/md011.md b/doc-build/md011.md new file mode 100644 index 00000000..fcc25e8e --- /dev/null +++ b/doc-build/md011.md @@ -0,0 +1,22 @@ +This rule is triggered when text that appears to be a link is encountered, but +where the syntax appears to have been reversed (the `[]` and `()` are +reversed): + +```markdown +(Incorrect link syntax)[https://www.example.com/] +``` + +To fix this, swap the `[]` and `()` around: + +```markdown +[Correct link syntax](https://www.example.com/) +``` + +Note: [Markdown Extra](https://en.wikipedia.org/wiki/Markdown_Extra)-style +footnotes do not trigger this rule: + +```markdown +For (example)[^1] +``` + +Rationale: Reversed links are not rendered as usable links. diff --git a/doc-build/md012.md b/doc-build/md012.md new file mode 100644 index 00000000..7a5291e2 --- /dev/null +++ b/doc-build/md012.md @@ -0,0 +1,26 @@ +This rule is triggered when there are multiple consecutive blank lines in the +document: + +```markdown +Some text here + + +Some more text here +``` + +To fix this, delete the offending lines: + +```markdown +Some text here + +Some more text here +``` + +Note: this rule will not be triggered if there are multiple consecutive blank +lines inside code blocks. + +Note: The `maximum` parameter can be used to configure the maximum number of +consecutive blank lines. + +Rationale: Except in a code block, blank lines serve no purpose and do not +affect the rendering of content. diff --git a/doc-build/md013.md b/doc-build/md013.md new file mode 100644 index 00000000..c129a003 --- /dev/null +++ b/doc-build/md013.md @@ -0,0 +1,39 @@ +This rule is triggered when there are lines that are longer than the +configured `line_length` (default: 80 characters). To fix this, split the line +up into multiple lines. To set a different maximum length for headings, use +`heading_line_length`. To set a different maximum length for code blocks, use +`code_block_line_length` + +This rule has an exception when there is no whitespace beyond the configured +line length. This allows you to include items such as long URLs without being +forced to break them in the middle. To disable this exception, set the `strict` +parameter to `true` and an issue will be reported when any line is too long. To +warn for lines that are too long and could be fixed but allow long lines +without spaces, set the `stern` parameter to `true`. + +For example (assuming normal behavior): + +```markdown +IF THIS LINE IS THE MAXIMUM LENGTH +This line is okay because there are-no-spaces-beyond-that-length +This line is a violation because there are spaces beyond that length +This-line-is-okay-because-there-are-no-spaces-anywhere-within +``` + +In `strict` mode, the last three lines above are all violations. In `stern` +mode, the middle two lines above are both violations, but the last is okay. + +You have the option to exclude this rule for code blocks, tables, or headings. +To do so, set the `code_blocks`, `tables`, or `headings` parameter(s) to false. + +Code blocks are included in this rule by default since it is often a +requirement for document readability, and tentatively compatible with code +rules. Still, some languages do not lend themselves to short lines. + +Lines with link/image reference definitions and standalone lines (i.e., not part +of a paragraph) with only a link/image (possibly using (strong) emphasis) are +always exempted from this rule (even in `strict` mode) because there is often no +way to split such lines without breaking the URL. + +Rationale: Extremely long lines can be difficult to work with in some editors. +More information: . diff --git a/doc-build/md014.md b/doc-build/md014.md new file mode 100644 index 00000000..51e380c4 --- /dev/null +++ b/doc-build/md014.md @@ -0,0 +1,46 @@ +This rule is triggered when there are code blocks showing shell commands to be +typed, and *all* of the shell commands are preceded by dollar signs ($): + + + +```markdown +$ ls +$ cat foo +$ less bar +``` + + + +The dollar signs are unnecessary in this situation, and should not be +included: + +```markdown +ls +cat foo +less bar +``` + +Showing output for commands preceded by dollar signs does not trigger this rule: + +```markdown +$ ls +foo bar +$ cat foo +Hello world +$ cat bar +baz +``` + +Because some commands do not produce output, it is not a violation if *some* +commands do not have output: + +```markdown +$ mkdir test +mkdir: created directory 'test' +$ ls test +``` + +Rationale: It is easier to copy/paste and less noisy if the dollar signs +are omitted when they are not needed. See + +for more information. diff --git a/doc-build/md018.md b/doc-build/md018.md new file mode 100644 index 00000000..65c7a8dc --- /dev/null +++ b/doc-build/md018.md @@ -0,0 +1,19 @@ +This rule is triggered when spaces are missing after the hash characters +in an atx style heading: + +```markdown +#Heading 1 + +##Heading 2 +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 + +## Heading 2 +``` + +Rationale: Violations of this rule can lead to improperly rendered content. diff --git a/doc-build/md019.md b/doc-build/md019.md new file mode 100644 index 00000000..2ca6f34b --- /dev/null +++ b/doc-build/md019.md @@ -0,0 +1,20 @@ +This rule is triggered when more than one space is used to separate the +heading text from the hash characters in an atx style heading: + +```markdown +# Heading 1 + +## Heading 2 +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 + +## Heading 2 +``` + +Rationale: Extra space has no purpose and does not affect the rendering of +content. diff --git a/doc-build/md020.md b/doc-build/md020.md new file mode 100644 index 00000000..4e87320d --- /dev/null +++ b/doc-build/md020.md @@ -0,0 +1,21 @@ +This rule is triggered when spaces are missing inside the hash characters +in a closed atx style heading: + +```markdown +#Heading 1# + +##Heading 2## +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 # + +## Heading 2 ## +``` + +Note: this rule will fire if either side of the heading is missing spaces. + +Rationale: Violations of this rule can lead to improperly rendered content. diff --git a/doc-build/md021.md b/doc-build/md021.md new file mode 100644 index 00000000..07d97750 --- /dev/null +++ b/doc-build/md021.md @@ -0,0 +1,23 @@ +This rule is triggered when more than one space is used to separate the +heading text from the hash characters in a closed atx style heading: + +```markdown +# Heading 1 # + +## Heading 2 ## +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 # + +## Heading 2 ## +``` + +Note: this rule will fire if either side of the heading contains multiple +spaces. + +Rationale: Extra space has no purpose and does not affect the rendering of +content. diff --git a/doc-build/md022.md b/doc-build/md022.md new file mode 100644 index 00000000..7d82c795 --- /dev/null +++ b/doc-build/md022.md @@ -0,0 +1,39 @@ +This rule is triggered when headings (any style) are either not preceded or not +followed by at least one blank line: + +```markdown +# Heading 1 +Some text + +Some more text +## Heading 2 +``` + +To fix this, ensure that all headings have a blank line both before and after +(except where the heading is at the beginning or end of the document): + +```markdown +# Heading 1 + +Some text + +Some more text + +## Heading 2 +``` + +The `lines_above` and `lines_below` parameters can be used to specify a +different number of blank lines (including `0`) above or below each heading. +If the value `-1` is used for either parameter, any number of blank lines is +allowed. To customize the number of lines above or below each heading level +individually, specify a `number[]` where values correspond to heading levels +1-6 (in order). + +Notes: If `lines_above` or `lines_below` are configured to require more than one +blank line, [MD012/no-multiple-blanks](md012.md) should also be customized. This +rule checks for *at least* as many blank lines as specified; any extra blank +lines are ignored. + +Rationale: Aside from aesthetic reasons, some parsers, including `kramdown`, +will not parse headings that don't have a blank line before, and will parse them +as regular text. diff --git a/doc-build/md023.md b/doc-build/md023.md new file mode 100644 index 00000000..9a5a3556 --- /dev/null +++ b/doc-build/md023.md @@ -0,0 +1,25 @@ +This rule is triggered when a heading is indented by one or more spaces: + +```markdown +Some text + + # Indented heading +``` + +To fix this, ensure that all headings start at the beginning of the line: + +```markdown +Some text + +# Heading +``` + +Note that scenarios like block quotes "indent" the start of the line, so the +following is also correct: + +```markdown +> # Heading in Block Quote +``` + +Rationale: Headings that don't start at the beginning of the line will not be +parsed as headings, and will instead appear as regular text. diff --git a/doc-build/md024.md b/doc-build/md024.md new file mode 100644 index 00000000..142b2035 --- /dev/null +++ b/doc-build/md024.md @@ -0,0 +1,34 @@ +This rule is triggered if there are multiple headings in the document that have +the same text: + +```markdown +# Some text + +## Some text +``` + +To fix this, ensure that the content of each heading is different: + +```markdown +# Some text + +## Some more text +``` + +If the parameter `siblings_only` is set to `true`, duplication is allowed for +headings with different parents (as is common in changelogs): + +```markdown +# Change log + +## 1.0.0 + +### Features + +## 2.0.0 + +### Features +``` + +Rationale: Some Markdown parsers generate anchors for headings based on the +heading name; headings with the same content can cause problems with that. diff --git a/doc-build/md025.md b/doc-build/md025.md new file mode 100644 index 00000000..a0de384b --- /dev/null +++ b/doc-build/md025.md @@ -0,0 +1,37 @@ +This rule is triggered when a top-level heading is in use (the first line of +the file is an h1 heading), and more than one h1 heading is in use in the +document: + +```markdown +# Top level heading + +# Another top-level heading +``` + +To fix, structure your document so there is a single h1 heading that is +the title for the document. Subsequent headings must be +lower-level headings (h2, h3, etc.): + +```markdown +# Title + +## Heading + +## Another heading +``` + +Note: The `level` parameter can be used to change the top-level (ex: to h2) in +cases where an h1 is added externally. + +If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and +contains a `title` property (commonly used with blog posts), this rule treats +that as a top level heading and will report a violation for any subsequent +top-level headings. To use a different property name in the front matter, +specify the text of a regular expression via the `front_matter_title` parameter. +To disable the use of front matter by this rule, specify `""` for +`front_matter_title`. + +Rationale: A top-level heading is an h1 on the first line of the file, and +serves as the title for the document. If this convention is in use, then there +can not be more than one title for the document, and the entire document should +be contained within this heading. diff --git a/doc-build/md026.md b/doc-build/md026.md new file mode 100644 index 00000000..f7111dbe --- /dev/null +++ b/doc-build/md026.md @@ -0,0 +1,28 @@ +This rule is triggered on any heading that has one of the specified normal or +full-width punctuation characters as the last character in the line: + +```markdown +# This is a heading. +``` + +To fix this, remove the trailing punctuation: + +```markdown +# This is a heading +``` + +Note: The `punctuation` parameter can be used to specify what characters count +as punctuation at the end of a heading. For example, you can change it to +`".,;:"` to allow headings that end with an exclamation point. `?` is +allowed by default because of how common it is in headings of FAQ-style +documents. Setting the `punctuation` parameter to `""` allows all characters - +and is equivalent to disabling the rule. + +Note: The trailing semicolon of [HTML entity references][html-entity-references] +like `©`, `©`, and `©` is ignored by this rule. + +Rationale: Headings are not meant to be full sentences. More information: +[Punctuation at the end of headers][end-punctuation]. + +[end-punctuation]: https://cirosantilli.com/markdown-style-guide#punctuation-at-the-end-of-headers +[html-entity-references]: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references diff --git a/doc-build/md027.md b/doc-build/md027.md new file mode 100644 index 00000000..bf5ce174 --- /dev/null +++ b/doc-build/md027.md @@ -0,0 +1,20 @@ +This rule is triggered when blockquotes have more than one space after the +blockquote (`>`) symbol: + +```markdown +> This is a blockquote with bad indentation +> there should only be one. +``` + +To fix, remove any extraneous space: + +```markdown +> This is a blockquote with correct +> indentation. +``` + +Inferring intended list indentation within a blockquote can be challenging; +setting the `list_items` parameter to `false` disables this rule for ordered +and unordered list items. + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md028.md b/doc-build/md028.md new file mode 100644 index 00000000..4272ce53 --- /dev/null +++ b/doc-build/md028.md @@ -0,0 +1,34 @@ +This rule is triggered when two blockquote blocks are separated by nothing +except for a blank line: + +```markdown +> This is a blockquote +> which is immediately followed by + +> this blockquote. Unfortunately +> In some parsers, these are treated as the same blockquote. +``` + +To fix this, ensure that any blockquotes that are right next to each other +have some text in between: + +```markdown +> This is a blockquote. + +And Jimmy also said: + +> This too is a blockquote. +``` + +Alternatively, if they are supposed to be the same quote, then add the +blockquote symbol at the beginning of the blank line: + +```markdown +> This is a blockquote. +> +> This is the same blockquote. +``` + +Rationale: Some Markdown parsers will treat two blockquotes separated by one +or more blank lines as the same blockquote, while others will treat them as +separate blockquotes. diff --git a/doc-build/md029.md b/doc-build/md029.md new file mode 100644 index 00000000..3921cfa7 --- /dev/null +++ b/doc-build/md029.md @@ -0,0 +1,87 @@ +This rule is triggered for ordered lists that do not either start with '1.' or +do not have a prefix that increases in numerical order (depending on the +configured style). The less-common pattern of using '0.' as a first prefix or +for all prefixes is also supported. + +Example valid list if the style is configured as 'one': + +```markdown +1. Do this. +1. Do that. +1. Done. +``` + +Examples of valid lists if the style is configured as 'ordered': + +```markdown +1. Do this. +2. Do that. +3. Done. +``` + +```markdown +0. Do this. +1. Do that. +2. Done. +``` + +All three examples are valid when the style is configured as 'one_or_ordered'. + +Example valid list if the style is configured as 'zero': + +```markdown +0. Do this. +0. Do that. +0. Done. +``` + +Example invalid list for all styles: + +```markdown +1. Do this. +3. Done. +``` + +This rule supports 0-prefixing ordered list items for uniform indentation: + +```markdown +... +08. Item +09. Item +10. Item +11. Item +... +``` + +Note: This rule will report violations for cases like the following where an +improperly-indented code block (or similar) appears between two list items and +"breaks" the list in two: + + + +~~~markdown +1. First list + +```text +Code block +``` + +1. Second list +~~~ + +The fix is to indent the code block so it becomes part of the preceding list +item as intended: + +~~~markdown +1. First list + + ```text + Code block + ``` + +2. Still first list +~~~ + + + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md030.md b/doc-build/md030.md new file mode 100644 index 00000000..dae56eda --- /dev/null +++ b/doc-build/md030.md @@ -0,0 +1,64 @@ +This rule checks for the number of spaces between a list marker (e.g. '`-`', +'`*`', '`+`' or '`1.`') and the text of the list item. + +The number of spaces checked for depends on the document style in use, but the +default is 1 space after any list marker: + +```markdown +* Foo +* Bar +* Baz + +1. Foo +1. Bar +1. Baz + +1. Foo + * Bar +1. Baz +``` + +A document style may change the number of spaces after unordered list items +and ordered list items independently, as well as based on whether the content +of every item in the list consists of a single paragraph or multiple +paragraphs (including sub-lists and code blocks). + +For example, the style guide at + +specifies that 1 space after the list marker should be used if every item in +the list fits within a single paragraph, but to use 2 or 3 spaces (for ordered +and unordered lists respectively) if there are multiple paragraphs of content +inside the list: + +```markdown +* Foo +* Bar +* Baz +``` + +vs. + +```markdown +* Foo + + Second paragraph + +* Bar +``` + +or + +```markdown +1. Foo + + Second paragraph + +1. Bar +``` + +To fix this, ensure the correct number of spaces are used after the list marker +for your selected document style. + +Rationale: Violations of this rule can lead to improperly rendered content. + +Note: See [Prettier.md](Prettier.md) for compatibility information. diff --git a/doc-build/md031.md b/doc-build/md031.md new file mode 100644 index 00000000..4cc1fb0a --- /dev/null +++ b/doc-build/md031.md @@ -0,0 +1,38 @@ +This rule is triggered when fenced code blocks are either not preceded or not +followed by a blank line: + +````markdown +Some text +``` +Code block +``` + +``` +Another code block +``` +Some more text +```` + +To fix this, ensure that all fenced code blocks have a blank line both before +and after (except where the block is at the beginning or end of the document): + +````markdown +Some text + +``` +Code block +``` + +``` +Another code block +``` + +Some more text +```` + +Set the `list_items` parameter to `false` to disable this rule for list items. +Disabling this behavior for lists can be useful if it is necessary to create a +[tight](https://spec.commonmark.org/0.29/#tight) list containing a code fence. + +Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will +not parse fenced code blocks that don't have blank lines before and after them. diff --git a/doc-build/md032.md b/doc-build/md032.md new file mode 100644 index 00000000..43d6e6db --- /dev/null +++ b/doc-build/md032.md @@ -0,0 +1,47 @@ +This rule is triggered when lists (of any kind) are either not preceded or not +followed by a blank line: + +```markdown +Some text +* List item +* List item + +1. List item +2. List item +*** +``` + +In the first case above, text immediately precedes the unordered list. In the +second case above, a thematic break immediately follows the ordered list. To fix +violations of this rule, ensure that all lists have a blank line both before and +after (except when the list is at the very beginning or end of the document): + +```markdown +Some text + +* List item +* List item + +1. List item +2. List item + +*** +``` + +Note that the following case is **not** a violation of this rule: + +```markdown +1. List item + More item 1 +2. List item +More item 2 +``` + +Although it is not indented, the text "More item 2" is referred to as a +[lazy continuation line][lazy-continuation] and considered part of the second +list item. + +Rationale: In addition to aesthetic reasons, some parsers, including kramdown, +will not parse lists that don't have blank lines before and after them. + +[lazy-continuation]: https://spec.commonmark.org/0.30/#lazy-continuation-line diff --git a/doc-build/md033.md b/doc-build/md033.md new file mode 100644 index 00000000..583ab668 --- /dev/null +++ b/doc-build/md033.md @@ -0,0 +1,21 @@ +This rule is triggered whenever raw HTML is used in a Markdown document: + +```markdown +

Inline HTML heading

+``` + +To fix this, use 'pure' Markdown instead of including raw HTML: + +```markdown +# Markdown heading +``` + +To allow specific HTML elements anywhere in Markdown content, set the +`allowed_elements` parameter to a list of HTML element names. To allow a +specific set of HTML elements within Markdown tables, set the +`table_allowed_elements` parameter to a list of HTML element names. This can be +used to permit the use of `
`-style line breaks only within Markdown tables. + +Rationale: Raw HTML is allowed in Markdown, but this rule is included for +those who want their documents to only include "pure" Markdown, or for those +who are rendering Markdown documents into something other than HTML. diff --git a/doc-build/md034.md b/doc-build/md034.md new file mode 100644 index 00000000..d1823c6c --- /dev/null +++ b/doc-build/md034.md @@ -0,0 +1,47 @@ +This rule is triggered whenever a URL or email address appears without +surrounding angle brackets: + +```markdown +For more info, visit https://www.example.com/ or email user@example.com. +``` + +To fix this, add angle brackets around the URL or email address: + +```markdown +For more info, visit or email . +``` + +If a URL or email address contains non-ASCII characters, it may be not be +handled as intended even when angle brackets are present. In such cases, +[percent-encoding](https://en.m.wikipedia.org/wiki/Percent-encoding) can be used +to comply with the required syntax for URL and email. + +Note: To include a bare URL or email without it being converted into a link, +wrap it in a code span: + +```markdown +Not a clickable link: `https://www.example.com` +``` + +Note: The following scenario does not trigger this rule because it could be a +shortcut link: + +```markdown +[https://www.example.com] +``` + +Note: The following syntax triggers this rule because the nested link could be +a shortcut link (which takes precedence): + +```markdown +[text [shortcut] text](https://example.com) +``` + +To avoid this, escape both inner brackets: + +```markdown +[link \[text\] link](https://example.com) +``` + +Rationale: Without angle brackets, a bare URL or email isn't converted into a +link by some Markdown parsers. diff --git a/doc-build/md035.md b/doc-build/md035.md new file mode 100644 index 00000000..c5fc8740 --- /dev/null +++ b/doc-build/md035.md @@ -0,0 +1,27 @@ +This rule is triggered when inconsistent styles of horizontal rules are used +in the document: + +```markdown +--- + +- - - + +*** + +* * * + +**** +``` + +To fix this, use the same horizontal rule everywhere: + +```markdown +--- + +--- +``` + +The configured style can ensure all horizontal rules use a specific string or it +can ensure all horizontal rules match the first horizontal rule (`consistent`). + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md036.md b/doc-build/md036.md new file mode 100644 index 00000000..4b39bf37 --- /dev/null +++ b/doc-build/md036.md @@ -0,0 +1,35 @@ +This check looks for instances where emphasized (i.e. bold or italic) text is +used to separate sections, where a heading should be used instead: + +```markdown +**My document** + +Lorem ipsum dolor sit amet... + +_Another section_ + +Consectetur adipiscing elit, sed do eiusmod. +``` + +To fix this, use Markdown headings instead of emphasized text to denote +sections: + +```markdown +# My document + +Lorem ipsum dolor sit amet... + +## Another section + +Consectetur adipiscing elit, sed do eiusmod. +``` + +Note: This rule looks for single-line paragraphs that consist entirely +of emphasized text. It won't fire on emphasis used within regular text, +multi-line emphasized paragraphs, or paragraphs ending in punctuation +(normal or full-width). Similarly to rule MD026, you can configure what +characters are recognized as punctuation. + +Rationale: Using emphasis instead of a heading prevents tools from inferring +the structure of a document. More information: +. diff --git a/doc-build/md037.md b/doc-build/md037.md new file mode 100644 index 00000000..683d5f0e --- /dev/null +++ b/doc-build/md037.md @@ -0,0 +1,29 @@ +This rule is triggered when emphasis markers (bold, italic) are used, but they +have spaces between the markers and the text: + +```markdown +Here is some ** bold ** text. + +Here is some * italic * text. + +Here is some more __ bold __ text. + +Here is some more _ italic _ text. +``` + +To fix this, remove the spaces around the emphasis markers: + +```markdown +Here is some **bold** text. + +Here is some *italic* text. + +Here is some more __bold__ text. + +Here is some more _italic_ text. +``` + +Rationale: Emphasis is only parsed as such when the asterisks/underscores +aren't surrounded by spaces. This rule attempts to detect where +they were surrounded by spaces, but it appears that emphasized text was +intended by the author. diff --git a/doc-build/md038.md b/doc-build/md038.md new file mode 100644 index 00000000..6880ecf9 --- /dev/null +++ b/doc-build/md038.md @@ -0,0 +1,44 @@ +This rule is triggered for code spans containing content with unnecessary space +next to the beginning or ending backticks: + +```markdown +`some text ` + +` some text` + +` some text ` +``` + +To fix this, remove the extra space characters from the beginning and ending: + +```markdown +`some text` +``` + +Note: A single leading *and* trailing space is allowed by the specification and +trimmed by the parser to support code spans that begin or end with a backtick: + +```markdown +`` `backticks` `` + +`` backtick` `` +``` + +Note: When single-space padding is present in the input, it will be preserved +(even if unnecessary): + +```markdown +` code ` +``` + +Note: Code spans containing only spaces are allowed by the specification and are +also preserved: + +```markdown +` ` + +` ` +``` + +Rationale: Violations of this rule are usually unintentional and can lead to +improperly-rendered content. diff --git a/doc-build/md039.md b/doc-build/md039.md new file mode 100644 index 00000000..e6f5903d --- /dev/null +++ b/doc-build/md039.md @@ -0,0 +1,13 @@ +This rule is triggered on links that have spaces surrounding the link text: + +```markdown +[ a link ](https://www.example.com/) +``` + +To fix this, remove the spaces surrounding the link text: + +```markdown +[a link](https://www.example.com/) +``` + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md040.md b/doc-build/md040.md new file mode 100644 index 00000000..5c70143c --- /dev/null +++ b/doc-build/md040.md @@ -0,0 +1,41 @@ +This rule is triggered when fenced code blocks are used, but a language isn't +specified: + +````markdown +``` +#!/bin/bash +echo Hello world +``` +```` + +To fix this, add a language specifier to the code block: + +````markdown +```bash +#!/bin/bash +echo Hello world +``` +```` + +To display a code block without syntax highlighting, use: + +````markdown +```text +Plain text in a code block +``` +```` + +You can configure the `allowed_languages` parameter to specify a list of +languages code blocks could use. Languages are case sensitive. The default value +is `[]` which means any language specifier is valid. + +You can prevent extra data from being present in the info string of fenced code +blocks. To do so, set the `language_only` parameter to `true`. + + +Info strings with leading/trailing whitespace (ex: `js `) or other content (ex: +`ruby startline=3`) will trigger this rule. + +Rationale: Specifying a language improves content rendering by using the +correct syntax highlighting for code. More information: +. diff --git a/doc-build/md041.md b/doc-build/md041.md new file mode 100644 index 00000000..a86dd989 --- /dev/null +++ b/doc-build/md041.md @@ -0,0 +1,50 @@ +This rule is intended to ensure documents have a title and is triggered when +the first line in a document is not a top-level ([HTML][HTML] `h1`) heading: + +```markdown +This is a document without a heading +``` + +To fix this, add a top-level heading to the beginning of the document: + +```markdown +# Document Heading + +This is a document with a top-level heading +``` + +Because it is common for projects on GitHub to use an image for the heading of +`README.md` and that pattern is not well-supported by Markdown, HTML headings +are also permitted by this rule. For example: + +```markdown +

+ +This is a document with a top-level HTML heading +``` + +In some cases, a document's title heading may be preceded by text like a table +of contents. This is not ideal for accessibility, but can be allowed by setting +the `allow_preamble` parameter to `true`. + +```markdown +This is a document with preamble text + +# Document Heading +``` + +If [YAML][YAML] front matter is present and contains a `title` property +(commonly used with blog posts), this rule will not report a violation. To use a +different property name in the front matter, specify the text of a [regular +expression][RegExp] via the `front_matter_title` parameter. To disable the use +of front matter by this rule, specify `""` for `front_matter_title`. + +The `level` parameter can be used to change the top-level heading (ex: to `h2`) +in cases where an `h1` is added externally. + +Rationale: The top-level heading often acts as the title of a document. More +information: . + +[HTML]: https://en.wikipedia.org/wiki/HTML +[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions +[YAML]: https://en.wikipedia.org/wiki/YAML diff --git a/doc-build/md042.md b/doc-build/md042.md new file mode 100644 index 00000000..271b3ec8 --- /dev/null +++ b/doc-build/md042.md @@ -0,0 +1,26 @@ +This rule is triggered when an empty link is encountered: + +```markdown +[an empty link]() +``` + +To fix the violation, provide a destination for the link: + +```markdown +[a valid link](https://example.com/) +``` + +Empty fragments will trigger this rule: + +```markdown +[an empty fragment](#) +``` + +But non-empty fragments will not: + +```markdown +[a valid fragment](#fragment) +``` + +Rationale: Empty links do not lead anywhere and therefore don't function as +links. diff --git a/doc-build/md043.md b/doc-build/md043.md new file mode 100644 index 00000000..be274d2a --- /dev/null +++ b/doc-build/md043.md @@ -0,0 +1,76 @@ +This rule is triggered when the headings in a file do not match the array of +headings passed to the rule. It can be used to enforce a standard heading +structure for a set of files. + +To require exactly the following structure: + +```markdown +# Heading +## Item +### Detail +``` + +Set the `headings` parameter to: + +```json +[ + "# Heading", + "## Item", + "### Detail" +] +``` + +To allow optional headings as with the following structure: + +```markdown +# Heading +## Item +### Detail (optional) +## Foot +### Notes (optional) +``` + +Use the special value `"*"` meaning "zero or more unspecified headings" or the +special value `"+"` meaning "one or more unspecified headings" and set the +`headings` parameter to: + +```json +[ + "# Heading", + "## Item", + "*", + "## Foot", + "*" +] +``` + +To allow a single required heading to vary as with a project name: + +```markdown +# Project Name +## Description +## Examples +``` + +Use the special value `"?"` meaning "exactly one unspecified heading": + +```json +[ + "?", + "## Description", + "## Examples" +] +``` + +When an error is detected, this rule outputs the line number of the first +problematic heading (otherwise, it outputs the last line number of the file). + +Note that while the `headings` parameter uses the "## Text" ATX heading style +for simplicity, a file may use any supported heading style. + +By default, the case of headings in the document is not required to match that +of `headings`. To require that case match exactly, set the `match_case` +parameter to `true`. + +Rationale: Projects may wish to enforce a consistent document structure across +a set of similar content. diff --git a/doc-build/md044.md b/doc-build/md044.md new file mode 100644 index 00000000..7d78ea4a --- /dev/null +++ b/doc-build/md044.md @@ -0,0 +1,31 @@ +This rule is triggered when any of the strings in the `names` array do not have +the specified capitalization. It can be used to enforce a standard letter case +for the names of projects and products. + +For example, the language "JavaScript" is usually written with both the 'J' and +'S' capitalized - though sometimes the 's' or 'j' appear in lower-case. To +enforce the proper capitalization, specify the desired letter case in the +`names` array: + +```json +[ + "JavaScript" +] +``` + +Sometimes a proper name is capitalized differently in certain contexts. In such +cases, add both forms to the `names` array: + +```json +[ + "GitHub", + "github.com" +] +``` + +Set the `code_blocks` parameter to `false` to disable this rule for code blocks +and spans. Set the `html_elements` parameter to `false` to disable this rule +for HTML elements and attributes (such as when using a proper name as part of +a path for `a`/`href` or `img`/`src`). + +Rationale: Incorrect capitalization of proper names is usually a mistake. diff --git a/doc-build/md045.md b/doc-build/md045.md new file mode 100644 index 00000000..9dba6eb9 --- /dev/null +++ b/doc-build/md045.md @@ -0,0 +1,42 @@ +This rule reports a violation when an image is missing alternate text (alt text) +information. + +Alternate text is commonly specified inline as: + +```markdown +![Alternate text](image.jpg) +``` + +Or with reference syntax as: + +```markdown +![Alternate text][ref] + +... + +[ref]: image.jpg "Optional title" +``` + +Or with HTML as: + +```html +Alternate text +``` + +Note: If the [HTML `aria-hidden` attribute][aria-hidden] is used to hide the +image from assistive technology, this rule does not report a violation: + +```html + +``` + +Guidance for writing alternate text is available from the [W3C][w3c], +[Wikipedia][wikipedia], and [other locations][phase2technology]. + +Rationale: Alternate text is important for accessibility and describes the +content of an image for people who may not be able to see it. + +[aria-hidden]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden +[phase2technology]: https://www.phase2technology.com/blog/no-more-excuses +[w3c]: https://www.w3.org/WAI/alt/ +[wikipedia]: https://en.wikipedia.org/wiki/Alt_attribute diff --git a/doc-build/md046.md b/doc-build/md046.md new file mode 100644 index 00000000..f08c737a --- /dev/null +++ b/doc-build/md046.md @@ -0,0 +1,29 @@ +This rule is triggered when unwanted or different code block styles are used in +the same document. + +In the default configuration this rule reports a violation for the following +document: + + + + Some text. + + # Indented code + + More text. + + ```ruby + # Fenced code + ``` + + More text. + + + +To fix violations of this rule, use a consistent style (either indenting or code +fences). + +The configured code block style can be specific (`fenced`, `indented`) or can +require all code blocks match the first code block (`consistent`). + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md047.md b/doc-build/md047.md new file mode 100644 index 00000000..be01e75c --- /dev/null +++ b/doc-build/md047.md @@ -0,0 +1,26 @@ +This rule is triggered when there is not a single newline character at the end +of a file. + +An example that triggers the rule: + +```markdown +# Heading + +This file ends without a newline.[EOF] +``` + +To fix the violation, add a newline character to the end of the file: + +```markdown +# Heading + +This file ends with a newline. +[EOF] +``` + +Rationale: Some programs have trouble with files that do not end with a newline. + +More information: [What's the point in adding a new line to the end of a +file?][stack-exchange] + +[stack-exchange]: https://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file diff --git a/doc-build/md048.md b/doc-build/md048.md new file mode 100644 index 00000000..a2c9509e --- /dev/null +++ b/doc-build/md048.md @@ -0,0 +1,31 @@ +This rule is triggered when the symbols used in the document for fenced code +blocks do not match the configured code fence style: + +````markdown +```ruby +# Fenced code +``` + +~~~ruby +# Fenced code +~~~ +```` + +To fix this issue, use the configured code fence style throughout the +document: + +````markdown +```ruby +# Fenced code +``` + +```ruby +# Fenced code +``` +```` + +The configured code fence style can be a specific symbol to use (`backtick`, +`tilde`) or it can require all code fences match the first code fence +(`consistent`). + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md049.md b/doc-build/md049.md new file mode 100644 index 00000000..1f4a665b --- /dev/null +++ b/doc-build/md049.md @@ -0,0 +1,23 @@ +This rule is triggered when the symbols used in the document for emphasis do not +match the configured emphasis style: + +```markdown +*Text* +_Text_ +``` + +To fix this issue, use the configured emphasis style throughout the document: + +```markdown +*Text* +*Text* +``` + +The configured emphasis style can be a specific symbol to use (`asterisk`, +`underscore`) or can require all emphasis matches the first emphasis +(`consistent`). + +Note: Emphasis within a word is restricted to `asterisk` in order to avoid +unwanted emphasis for words containing internal underscores like_this_one. + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md050.md b/doc-build/md050.md new file mode 100644 index 00000000..60356f21 --- /dev/null +++ b/doc-build/md050.md @@ -0,0 +1,22 @@ +This rule is triggered when the symbols used in the document for strong do not +match the configured strong style: + +```markdown +**Text** +__Text__ +``` + +To fix this issue, use the configured strong style throughout the document: + +```markdown +**Text** +**Text** +``` + +The configured strong style can be a specific symbol to use (`asterisk`, +`underscore`) or can require all strong matches the first strong (`consistent`). + +Note: Emphasis within a word is restricted to `asterisk` in order to avoid +unwanted emphasis for words containing internal underscores like__this__one. + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc-build/md051.md b/doc-build/md051.md new file mode 100644 index 00000000..9584bfd5 --- /dev/null +++ b/doc-build/md051.md @@ -0,0 +1,103 @@ +This rule is triggered when a link fragment does not match any of the fragments +that are automatically generated for headings in a document: + +```markdown +# Heading Name + +[Link](#fragment) +``` + +To fix this issue, change the link fragment to reference an existing heading's +generated name (see below): + +```markdown +# Heading Name + +[Link](#heading-name) +``` + +For consistency, this rule requires fragments to exactly match the [GitHub +heading algorithm][github-heading-algorithm] which converts letters to +lowercase. Therefore, the following example is reported as a violation: + +```markdown +# Heading Name + +[Link](#Heading-Name) +``` + +To ignore case when comparing fragments with heading names, the `ignore_case` +parameter can be set to `true`. In this configuration, the previous example is +not reported as a violation. + +Alternatively, some platforms allow the syntax `{#named-anchor}` to be used +within a heading to provide a specific name (consisting of only lower-case +letters, numbers, `-`, and `_`): + +```markdown +# Heading Name {#custom-name} + +[Link](#custom-name) +``` + +Alternatively, any HTML tag with an `id` attribute or an `a` tag with a `name` +attribute can be used to define a fragment: + +```markdown + + +[Link](#bookmark) +``` + +An `a` tag can be useful in scenarios where a heading is not appropriate or for +control over the text of the fragment identifier. + +[HTML links to `#top` scroll to the top of a document][html-top-fragment]. This +rule allows that syntax (using lower-case for consistency): + +```markdown +[Link](#top) +``` + +This rule also recognizes the custom fragment syntax used by GitHub to highlight +[specific content in a document][github-linking-to-content]. + +For example, this link to line 20: + +```markdown +[Link](#L20) +``` + +And this link to content starting within line 19 running into line 21: + +```markdown +[Link](#L19C5-L21C11) +``` + +Some Markdown generators dynamically create and insert headings when building +documents, for example by combining a fixed prefix like `figure-` and an +incrementing numeric counter. To ignore such generated fragments, set the +`ignored_pattern` [regular expression][RegEx] parameter to a pattern that +matches (e.g., `^figure-`). + +Rationale: [GitHub section links][github-section-links] are created +automatically for every heading when Markdown content is displayed on GitHub. +This makes it easy to link directly to different sections within a document. +However, section links change if headings are renamed or removed. This rule +helps identify broken section links within a document. + +Note: Section links are **not** part of the CommonMark specification; this rule +enforces the [GitHub heading algorithm][github-heading-algorithm]: + +1. Convert text to lowercase +2. Remove punctuation characters +3. Convert spaces to dashes +4. Append an incrementing integer (as needed for uniqueness) +5. [URI-encode][encodeURIComponent] the result + +[encodeURIComponent]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent +[github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links +[github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb +[github-linking-to-content]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown +[html-top-fragment]: https://html.spec.whatwg.org/multipage/browsing-the-web.html#scrolling-to-a-fragment +[RegEx]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions diff --git a/doc-build/md052.md b/doc-build/md052.md new file mode 100644 index 00000000..064b8dbd --- /dev/null +++ b/doc-build/md052.md @@ -0,0 +1,41 @@ +Links and images in Markdown can provide the link destination or image source +at the time of use or can define it elsewhere and use a label for reference. +The reference format is convenient for keeping paragraph text clutter-free +and makes it easy to reuse the same URL in multiple places. + +There are three kinds of reference links and images: + +```markdown +Full: [text][label] +Collapsed: [label][] +Shortcut: [label] + +Full: ![text][image] +Collapsed: ![image][] +Shortcut: ![image] + +[label]: https://example.com/label +[image]: https://example.com/image +``` + +A link or image renders correctly when the corresponding label is defined, but +displays as text with brackets when the label is not present. By default, this +rule warns of undefined labels for "full" and "collapsed" reference syntax but +not for "shortcut" syntax because it is ambiguous. + +The text `[example]` could be a shortcut link or the text "example" in brackets, +so "shortcut" syntax is ignored by default. To include "shortcut" syntax, set +the `include_shortcut` parameter to `true`. Note that doing so produces warnings +for *all* text in the document that *could* be a shortcut. If bracketed text is +intentional, brackets can be escaped with the `\` character: `\[example\]`. + +If there are link labels that are deliberately unreferenced, they can be ignored +by setting the `ignored_labels` parameter to the list of strings to ignore. The +default value of this parameter ignores the checkbox syntax used by +[GitHub Flavored Markdown task list items][gfm-tasklist]: + +```markdown +- [x] Checked task list item +``` + +[gfm-tasklist]: https://github.github.com/gfm/#task-list-items-extension- diff --git a/doc-build/md053.md b/doc-build/md053.md new file mode 100644 index 00000000..1da909c7 --- /dev/null +++ b/doc-build/md053.md @@ -0,0 +1,26 @@ +Links and images in Markdown can provide the link destination or image source +at the time of use or can use a label to reference a definition elsewhere in +the document. The latter reference format is convenient for keeping paragraph +text clutter-free and makes it easy to reuse the same URL in multiple places. + +Because link and image reference definitions are located separately from +where they are used, there are two scenarios where a definition can be +unnecessary: + +1. If a label is not referenced by any link or image in a document, that + definition is unused and can be deleted. +2. If a label is defined multiple times in a document, the first definition is + used and the others can be deleted. + +This rule considers a reference definition to be used if any link or image +reference has the corresponding label. The "full", "collapsed", and "shortcut" +formats are all supported. + +If there are reference definitions that are deliberately unreferenced, they can +be ignored by setting the `ignored_definitions` parameter to the list of strings +to ignore. The default value of this parameter ignores the following convention +for adding non-HTML comments to Markdown: + +```markdown +[//]: # (This behaves like a comment) +``` diff --git a/doc-build/md054.md b/doc-build/md054.md new file mode 100644 index 00000000..23a1d6f1 --- /dev/null +++ b/doc-build/md054.md @@ -0,0 +1,81 @@ +Links and images in Markdown can provide the link destination or image source at +the time of use or can use a label to reference a definition elsewhere in the +document. The three reference formats are convenient for keeping paragraph text +clutter-free and make it easy to reuse the same URL in multiple places. + +By default, this rule allows all link/image styles. + +Setting the `autolink` parameter to `false` disables autolinks: + +```markdown + +``` + +Setting the `inline` parameter to `false` disables inline links and images: + +```markdown +[link](https://example.com) + +![image](https://example.com) +``` + +Setting the `full` parameter to `false` disables full reference links and +images: + +```markdown +[link][url] + +![image][url] + +[url]: https://example.com +``` + +Setting the `collapsed` parameter to `false` disables collapsed reference links +and images: + +```markdown +[url][] + +![url][] + +[url]: https://example.com +``` + +Setting the `shortcut` parameter to `false` disables shortcut reference links +and images: + +```markdown +[url] + +![url] + +[url]: https://example.com +``` + +To fix violations of this rule, change the link or image to use an allowed +style. This rule can automatically fix violations when a link or image can be +converted to the `inline` style (preferred) or a link can be converted to the +`autolink` style (which does not support images and must be an absolute URL). +This rule does *not* fix scenarios that require converting a link or image to +the `full`, `collapsed`, or `shortcut` reference styles because that involves +naming the reference and determining where to insert it in the document. + +Setting the `url_inline` parameter to `false` prevents the use of inline links +with the same absolute URL text/destination and no title because such links can +be converted to autolinks: + +```markdown +[https://example.com](https://example.com) +``` + +To fix `url_inline` violations, use the simpler autolink syntax instead: + +```markdown + +``` + +Rationale: Consistent formatting makes it easier to understand a document. +Autolinks are concise, but appear as URLs which can be long and confusing. +Inline links and images can include descriptive text, but take up more space in +Markdown form. Reference links and images can be easier to read and manipulate +in Markdown form, but require a separate link reference definition. diff --git a/doc-build/md055.md b/doc-build/md055.md new file mode 100644 index 00000000..52e0979b --- /dev/null +++ b/doc-build/md055.md @@ -0,0 +1,43 @@ +This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-055] +is inconsistent about its use of leading and trailing pipe characters (`|`). + +By default (`consistent` style), the header row of the first table in a document +is used to determine the style that is enforced for every table in the document. +A specific style can be used instead (`leading_and_trailing`, `leading_only`, +`no_leading_or_trailing`, `trailing_only`). + +This table's header row has leading and trailing pipes, but its delimiter row is +missing the trailing pipe and its first row of cells is missing the leading +pipe: + +```markdown +| Header | Header | +| ------ | ------ + Cell | Cell | +``` + +To fix these issues, make sure there is a pipe character at the beginning and +end of every row: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +``` + +Note that text immediately following a table (i.e., not separated by an empty +line) is treated as part of the table (per the specification) and may also +trigger this rule: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +This text is part of the table +``` + +Rationale: Some parsers have difficulty with tables that are missing their +leading or trailing pipe characters. The use of leading/trailing pipes can also +help provide visual clarity. + +[gfm-table-055]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables diff --git a/doc-build/md056.md b/doc-build/md056.md new file mode 100644 index 00000000..8d8f72f6 --- /dev/null +++ b/doc-build/md056.md @@ -0,0 +1,31 @@ +This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-056] +does not have the same number of cells in every row. + +This table's second data row has too few cells and its third data row has too +many cells: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +| Cell | +| Cell | Cell | Cell | +``` + +To fix these issues, ensure every row has the same number of cells: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +| Cell | Cell | +| Cell | Cell | +``` + +Note that a table's header row and its delimiter row must have the same number +of cells or it will not be recognized as a table (per specification). + +Rationale: Extra cells in a row are usually not shown, so their data is lost. +Missing cells in a row create holes in the table and suggest an omission. + +[gfm-table-056]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables diff --git a/doc-build/md058.md b/doc-build/md058.md new file mode 100644 index 00000000..f836adc1 --- /dev/null +++ b/doc-build/md058.md @@ -0,0 +1,40 @@ +This rule is triggered when tables are either not preceded or not followed by a +blank line: + +```markdown +Some text +| Header | Header | +| ------ | ------ | +| Cell | Cell | +> Blockquote +``` + +To fix violations of this rule, ensure that all tables have a blank line both +before and after (except when the table is at the very beginning or end of the +document): + +```markdown +Some text + +| Header | Header | +| ------ | ------ | +| Cell | Cell | + +> Blockquote +``` + +Note that text immediately following a table (i.e., not separated by an empty +line) is treated as part of the table (per the specification) and will not +trigger this rule: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +This text is part of the table and the next line is blank + +Some text +``` + +Rationale: In addition to aesthetic reasons, some parsers will incorrectly parse +tables that don't have blank lines before and after them. diff --git a/doc-build/md059.md b/doc-build/md059.md new file mode 100644 index 00000000..7d5548fb --- /dev/null +++ b/doc-build/md059.md @@ -0,0 +1,22 @@ +This rule is triggered when a link has generic text like `[click here](...)` or +`[link](...)`. + +Link text should be descriptive and communicate the purpose of the link (e.g., +`[Download the budget document](...)` or `[CommonMark Specification](...)`). +This is especially important for screen readers which sometimes present links +without context. + +By default, this rule prohibits a small number of common English words/phrases. +To customize that list of words/phrases, set the `prohibited_texts` parameter to +an `Array` of `string`s. + +Note: For languages other than English, use the `prohibited_texts` parameter to +customize the list for that language. It is *not* a goal for this rule to have +translations for every language. + +Note: This rule checks Markdown links; HTML links are ignored. + +More information: + +- +- diff --git a/doc-build/md060.md b/doc-build/md060.md new file mode 100644 index 00000000..34a92708 --- /dev/null +++ b/doc-build/md060.md @@ -0,0 +1,106 @@ +This rule is triggered when the column separator pipe characters (`|`) of a +[GitHub Flavored Markdown table][gfm-table-060] are used inconsistently. + +This rule recognizes three table column styles based on popular use. + +Style `aligned` ensures pipe characters are vertically aligned: + +```markdown +| Character | Meaning | +| --------- | ------- | +| Y | Yes | +| N | No | +``` + +The `aligned` style ignores cell content, so the following is also valid: + +```markdown +| Character | Meaning | +|-----------|---------| +| Y | Yes | +| N | No | +``` + +Style `compact` avoids extra padding with a single space around cell content: + +```markdown +| Character | Meaning | +| --- | --- | +| Y | Yes | +| N | No | +``` + +Style `tight` uses no padding at all for cell content: + +```markdown +|Character|Meaning| +|---|---| +|Y|Yes| +|N|No| +``` + +When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`, +every table must match the corresponding pattern and any violations will be +reported. By default, or when the `any` style is used, each table is analyzed to +see if it satisfies any supported style. If so, no violations are reported. If +not, violations are be reported for whichever style would produce the *fewest* +issues (i.e., whichever style is the closest match). + +Setting the `aligned_delimiter` parameter to `true` requires pipe characters in +the delimiter row to align with those in the header row. This can be used with +`compact` and `tight` tables to make the header text more obvious. (It's already +required for tables with style `aligned`.) + +Style `compact` with `aligned_delimiter`: + +```markdown +| Character | Meaning | +| --------- | ------- | +| Y | Yes | +| N | No | +``` + +Style `tight` with `aligned_delimiter`: + +```markdown +|Character|Meaning| +|---------|-------| +|Y|Yes| +|N|No| +``` + +**Note**: This rule does not require leading/trailing pipe characters, so this +is also a valid table for style `compact`: + +```markdown +Character | Meaning +--- | --- +Y | Yes +N | No +``` + +**Note**: Pipe alignment for the `aligned` style is based on visual appearance +and not character count. Because editors typically render [emoji][emoji] and +[CJK characters][cjk-characters] at *twice* the width of +[Latin characters][latin-script], this rule takes that into account for tables +using the `aligned` style. The following table is correctly formatted and will +appear aligned in most editors and monospaced fonts: + + + + +```markdown +| Response | Emoji | +| -------- | ----- | +| Yes | ✅ | +| No | ❎ | +``` + + + +Rationale: Consistent formatting makes it easier to understand a document. + +[cjk-characters]: https://en.wikipedia.org/wiki/CJK_characters +[emoji]: https://en.wikipedia.org/wiki/Emoji +[gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables +[latin-script]: https://en.wikipedia.org/wiki/Latin_script diff --git a/doc/CustomRules.md b/doc/CustomRules.md new file mode 100644 index 00000000..8f696ac4 --- /dev/null +++ b/doc/CustomRules.md @@ -0,0 +1,194 @@ +# Custom Rules + +In addition to its built-in rules, `markdownlint` lets you enhance the linting +experience by passing an array of custom rules using the [`options.customRules` +property][options-custom-rules]. Custom rules can do everything the built-in +rules can and are defined inline or imported from another package ([keyword +`markdownlint-rule` on npm][markdownlint-rule]). When defined by a file or +package, the export can be a single rule object (see below) or an array of them. +Custom rules can be disabled, enabled, and customized using the same syntax as +built-in rules. + +## Implementing Simple Rules + +For simple requirements like disallowing certain characters or patterns, +the community-developed +[markdownlint-rule-search-replace][markdownlint-rule-search-replace] +plug-in can be used. This plug-in allows anyone to create a set of simple +text-replacement rules without needing to write code. + +[markdownlint-rule-search-replace]: https://www.npmjs.com/package/markdownlint-rule-search-replace + +## Authoring + +Rules are defined by a name (or multiple names), a description, an optional link +to more information, one or more tags, and a function that implements the rule's +behavior. That function is called once for each file/string input and is passed +the parsed input and a function to log any violations. + +Custom rules can (should) operate on a structured set of tokens based on the +[`micromark`][micromark] `parser` (this is preferred). Alternatively, custom +rules can operate on a structured set of tokens based on the +[`markdown-it`][markdown-it] `parser` (legacy support). Finally, custom rules +can operate directly on text with the `none` `parser`. + +A simple rule implementation using the `micromark` parser to report a violation +for any use of blockquotes might look like: + +```javascript +/** @type {import("markdownlint").Rule} */ +module.exports = { + "names": [ "any-blockquote-micromark" ], + "description": "Rule that reports an error for any blockquote", + "information": new URL("https://example.com/rules/any-blockquote"), + "tags": [ "test" ], + "parser": "micromark", + "function": (params, onError) => { + const blockquotes = params.parsers.micromark.tokens + .filter((token) => token.type === "blockQuote"); + for (const blockquote of blockquotes) { + const lines = blockquote.endLine - blockquote.startLine + 1; + onError({ + "lineNumber": blockquote.startLine, + "detail": "Blockquote spans " + lines + " line(s).", + "context": params.lines[blockquote.startLine - 1] + }); + } + } +} +``` + +That same rule implemented using the `markdown-it` parser might look like: + +```javascript +/** @type {import("markdownlint").Rule} */ +module.exports = { + "names": [ "any-blockquote-markdown-it" ], + "description": "Rule that reports an error for any blockquote", + "information": new URL("https://example.com/rules/any-blockquote"), + "tags": [ "test" ], + "parser": "markdownit", + "function": (params, onError) => { + const blockquotes = params.parsers.markdownit.tokens + .filter((token) => token.type === "blockquote_open"); + for (const blockquote of blockquotes) { + const [ startIndex, endIndex ] = blockquote.map; + const lines = endIndex - startIndex; + onError({ + "lineNumber": blockquote.lineNumber, + "detail": "Blockquote spans " + lines + " line(s).", + "context": blockquote.line + }); + } + } +} +``` + +A rule is implemented as an `Object`: + +- `names` is a required `Array` of `String` values that identify the rule in + output messages and config. +- `description` is a required `String` value that describes the rule in output + messages. +- `information` is an optional (absolute) `URL` of a link to more information + about the rule. +- `tags` is a required `Array` of `String` values that groups related rules for + easier customization. +- `parser` is a required `String` value `"markdownit" | "micromark" | "none"` + that specifies the parser data used via `params.parsers` (see below). +- `asynchronous` is an optional `Boolean` value that indicates whether the rule + returns a `Promise` and runs asynchronously. +- `function` is a required `Function` that implements the rule and is passed two + parameters: + - `params` is an `Object` with properties that describe the content being + analyzed: + - `name` is a `String` that identifies the input file/string. + - `parsers` is an `Object` with properties corresponding to the value of + `parser` in the rule definition (see above). + - `markdownit` is an `Object` that provides access to output from the + [`markdown-it`][markdown-it] parser. + - `tokens` is an `Array` of [`markdown-it` `Token`s][markdown-it-token] + with added `line` and `lineNumber` properties. (This property was + previously on the `params` object.) + - `micromark` is an `Object` that provides access to output from the + [`micromark`][micromark] parser. + - `tokens` is an `Array` of [`MicromarkToken`][micromark-token] objects. + - Samples for both `tokens` are available via [test snapshots][tokens]. + - `lines` is an `Array` of `String` values corresponding to the lines of the + input file/string. + - `frontMatterLines` is an `Array` of `String` values corresponding to any + front matter (not present in `lines`). + - `config` is an `Object` corresponding to the rule's entry in + `options.config` (if present). + - `version` is a `String` that corresponds to the version of `markdownlint` + - `onError` is a function that takes a single `Object` parameter with one + required and four optional properties: + - `lineNumber` is a required `Number` specifying the 1-based line number of + the error. + - `detail` is an optional `String` with information about what caused the + error. + - `context` is an optional `String` with relevant text surrounding the error + location. + - `information` is an optional (absolute) `URL` of a link to override the + same-named value provided by the rule definition. (Uncommon) + - `range` is an optional `Array` with two `Number` values identifying the + 1-based column and length of the error. + - `fixInfo` is an optional `Object` with information about how to fix the + error (all properties are optional, but at least one of `deleteCount` and + `insertText` should be present; when applying a fix, the delete should be + performed before the insert): + - `lineNumber` is an optional `Number` specifying the 1-based line number + of the edit. + - `editColumn` is an optional `Number` specifying the 1-based column + number of the edit. + - `deleteCount` is an optional `Number` specifying the number of + characters to delete (the value `-1` is used to delete the line). + - `insertText` is an optional `String` specifying the text to insert. `\n` + is the platform-independent way to add a line break; line breaks should + be added at the beginning of a line instead of at the end. + +The collection of helper functions shared by the built-in rules is available for +use by custom rules in the [markdownlint-rule-helpers package][rule-helpers]. + +### Asynchronous Rules + +If a rule needs to perform asynchronous operations (such as fetching a network +resource), it can specify the value `true` for its `asynchronous` property. +Asynchronous rules should return a `Promise` from their `function` +implementation that is resolved when the rule completes. (The value passed to +`resolve(...)` is ignored.) Linting violations from asynchronous rules are +reported via the `onError` function just like for synchronous rules. + +**Note**: Asynchronous rules cannot be referenced in a synchronous calling +context (i.e., `import { lint } from "markdownlint/sync"`). Attempting to do so +throws an exception. + +## Examples + +- [Simple rules used by the project's test cases][test-rules] +- [Code for all `markdownlint` built-in rules][lib] +- [Complete example rule including npm configuration][extended-ascii] +- [Custom rules from the github/docs repository][github-docs] +- [Custom rules from the electron/lint-roller repository][electron] +- [Custom rules from the webhintio/hint repository][hint] + +## References + +- [CommonMark documentation and specification][commonmark] +- [`markdown-it` Markdown parser project page][markdown-it] + +[commonmark]: https://commonmark.org/ +[electron]: https://github.com/electron/lint-roller/tree/main/markdownlint-rules +[extended-ascii]: https://github.com/DavidAnson/markdownlint-rule-extended-ascii +[github-docs]: https://github.com/github/docs/tree/main/src/content-linter/lib/linting-rules +[hint]: https://github.com/webhintio/hint/blob/main/scripts/lint-markdown.js +[lib]: ../lib +[markdown-it]: https://github.com/markdown-it/markdown-it +[markdown-it-token]: https://markdown-it.github.io/markdown-it/#Token +[markdownlint-rule]: https://www.npmjs.com/search?q=keywords:markdownlint-rule +[micromark]: https://github.com/micromark/micromark +[micromark-token]: ../lib/markdownlint.d.mts +[rule-helpers]: https://www.npmjs.com/package/markdownlint-rule-helpers +[options-custom-rules]: ../README.md#optionscustomrules +[test-rules]: ../test/rules +[tokens]: ../test/snapshots/markdownlint-test-custom-rules.mjs.md diff --git a/doc/Prettier.md b/doc/Prettier.md new file mode 100644 index 00000000..0ebde95d --- /dev/null +++ b/doc/Prettier.md @@ -0,0 +1,27 @@ +# Using `markdownlint` with Prettier + +[`Prettier`](https://prettier.io) is a popular code formatter. +For the most part, Prettier works seamlessly with `markdownlint`. + +You can `extend` the [`prettier.json`](../style/prettier.json) style to disable +all `markdownlint` rules that overlap with Prettier. + +Other scenarios are documented below. + +## List item indentation + +The default settings of `markdownlint` and `Prettier` are compatible and don't +result in any linting violations. If `Prettier` is used with `--tab-width` set +to `4` (vs. `2`), the following `markdownlint` configuration can be used: + +```json +{ + "list-marker-space": { + "ul_multi": 3, + "ul_single": 3 + }, + "ul-indent": { + "indent": 4 + } +} +``` diff --git a/doc/ReleaseProcess.md b/doc/ReleaseProcess.md new file mode 100644 index 00000000..05c7b700 --- /dev/null +++ b/doc/ReleaseProcess.md @@ -0,0 +1,20 @@ +# Release Process + +The `markdownlint` library has some related dependencies that are updated along +with it. To prevent possible regressions from having a widespread impact, these +releases are separated by a few days to provide an opportunity to find issues. + +1. [`markdownlint`][markdownlint] +2. [`markdownlint-cli2`][markdownlint-cli2] +3. [`markdownlint-cli2-action`][markdownlint-cli2-action] +4. [`vscode-markdownlint`][vscode-markdownlint] +5. [`markdownlint-cli`][markdownlint-cli] + +This sequence is not strict and may be adjusted based on the content of the +release and the scope of feature work in each dependency. + +[markdownlint]: https://github.com/DavidAnson/markdownlint +[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2 +[markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action +[vscode-markdownlint]: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint +[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli diff --git a/doc/Rules.md b/doc/Rules.md index 852cd842..43f7f972 100644 --- a/doc/Rules.md +++ b/doc/Rules.md @@ -1,215 +1,358 @@ # Rules This document contains a description of all rules, what they are checking for, -as well as an examples of documents that break the rule and corrected +as well as examples of documents that break the rule and corrected versions of the examples. -## MD001 - Header levels should only increment by one level at a time + -Tags: headers +## `MD001` - Heading levels should only increment by one level at a time -This rule is triggered when you skip header levels in a markdown document, for +Tags: `headings` + +Aliases: `heading-increment` + +Parameters: + +- `front_matter_title`: RegExp for matching title in front matter (`string`, + default `^\s*title\s*[:=]`) + +This rule is triggered when you skip heading levels in a Markdown document, for example: - # Header 1 +```markdown +# Heading 1 - ### Header 3 +### Heading 3 - We skipped out a 2nd level header in this document +We skipped out a 2nd level heading in this document +``` -When using multiple header levels, nested headers should increase by only one +When using multiple heading levels, nested headings should increase by only one level at a time: - # Header 1 +```markdown +# Heading 1 - ## Header 2 +## Heading 2 - ### Header 3 +### Heading 3 - #### Header 4 +#### Heading 4 - ## Another Header 2 +## Another Heading 2 - ### Another Header 3 +### Another Heading 3 +``` +If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and +contains a `title` property (commonly used with blog posts), this rule treats +that as a top level heading and will report a violation if the actual first +heading is not a level 2 heading. To use a different property name in the +front matter, specify the text of a regular expression via the +`front_matter_title` parameter. To disable the use of front matter by this +rule, specify `""` for `front_matter_title`. When front matter is not present, +the first heading can be any level. -## MD002 - First header should be a h1 header +Rationale: Headings represent the structure of a document and can be confusing +when skipped - especially for accessibility scenarios. More information: +. -Tags: headers + -This rule is triggered when the first header in the document isn't a h1 header: +## `MD003` - Heading style - ## This isn't a H1 header +Tags: `headings` - ### Another header +Aliases: `heading-style` -The first header in the document should be a h1 header: +Parameters: - # Start with a H1 header +- `style`: Heading style (`string`, default `consistent`, values `atx` / + `atx_closed` / `consistent` / `setext` / `setext_with_atx` / + `setext_with_atx_closed`) - ## Then use a H2 for subsections +This rule is triggered when different heading styles are used in the same +document: -## MD003 - Header style +```markdown +# ATX style H1 -Tags: headers +## Closed ATX style H2 ## -Parameters: style ("consistent", "atx", "atx_closed", "setext", "setext_with_atx"; default "consistent") +Setext style H1 +=============== +``` -This rule is triggered when different header styles (atx, setext, and 'closed' -atx) are used in the same document: +To fix the issue, use consistent heading styles throughout the document: - # ATX style H1 +```markdown +# ATX style H1 - ## Closed ATX style H2 ## +## ATX style H2 +``` - Setext style H1 - =============== +The `setext_with_atx` and `setext_with_atx_closed` settings allow ATX-style +headings of level 3 or more in documents with setext-style headings (which only +support level 1 and 2 headings): -Be consistent with the style of header used in a document: +```markdown +Setext style H1 +=============== - # ATX style H1 +Setext style H2 +--------------- - ## ATX style H2 +### ATX style H3 +``` -The setext_with_atx doc style allows atx-style headers of level 3 or more in -documents with setext style headers: +Note: The configured heading style can be a specific style to require (`atx`, +`atx_closed`, `setext`, `setext_with_atx`, `setext_with_atx_closed`), or can +require that all heading styles match the first heading style via `consistent`. - Setext style H1 - =============== +Note: The placement of a horizontal rule directly below a line of text can +trigger this rule by turning that text into a level 2 setext-style heading: - Setext style H2 - --------------- +```markdown +A line of text followed by a horizontal rule becomes a heading +--- +``` - ### ATX style H3 +Rationale: Consistent formatting makes it easier to understand a document. -Note: the configured header style can be a specific style to use (atx, -atx_closed, setext, setext_with_atx), or simply require that the usage be -consistent within the document. + -## MD004 - Unordered list style +## `MD004` - Unordered list style -Tags: bullet, ul +Tags: `bullet`, `ul` -Parameters: style ("consistent", "asterisk", "plus", "dash"; default "consistent") +Aliases: `ul-style` + +Parameters: + +- `style`: List style (`string`, default `consistent`, values `asterisk` / + `consistent` / `dash` / `plus` / `sublist`) + +Fixable: Some violations can be fixed by tooling This rule is triggered when the symbols used in the document for unordered list items do not match the configured unordered list style: - * Item 1 - + Item 2 - - Item 3 +```markdown +* Item 1 ++ Item 2 +- Item 3 +``` To fix this issue, use the configured style for list items throughout the document: - * Item 1 - * Item 2 - * Item 3 +```markdown +* Item 1 +* Item 2 +* Item 3 +``` -Note: the configured list style can be a specific symbol to use (asterisk, -plus, dash), or simply require that the usage be consistent within the -document. +The configured list style can ensure all list styling is a specific symbol +(`asterisk`, `plus`, `dash`), ensure each sublist has a consistent symbol that +differs from its parent list (`sublist`), or ensure all list styles match the +first list style (`consistent`). -## MD005 - Inconsistent indentation for list items at the same level +For example, the following is valid for the `sublist` style because the +outer-most indent uses asterisk, the middle indent uses plus, and the inner-most +indent uses dash: -Tags: bullet, ul, indentation +```markdown +* Item 1 + + Item 2 + - Item 3 + + Item 4 +* Item 4 + + Item 5 +``` + +Rationale: Consistent formatting makes it easier to understand a document. + + + +## `MD005` - Inconsistent indentation for list items at the same level + +Tags: `bullet`, `indentation`, `ul` + +Aliases: `list-indent` + +Fixable: Some violations can be fixed by tooling This rule is triggered when list items are parsed as being at the same level, but don't have the same indentation: - * Item 1 - * Nested Item 1 - * Nested Item 2 - * A misaligned item +```markdown +* Item 1 + * Nested Item 1 + * Nested Item 2 + * A misaligned item +``` -Usually this rule will be triggered because of a typo. Correct the indentation +Usually, this rule will be triggered because of a typo. Correct the indentation for the list to fix it: - * Item 1 - * Nested Item 1 - * Nested Item 2 - * Nested Item 3 +```markdown +* Item 1 + * Nested Item 1 + * Nested Item 2 + * Nested Item 3 +``` -## MD006 - Consider starting bulleted lists at the beginning of the line +Sequentially-ordered list markers are usually left-aligned such that all items +have the same starting column: -Tags: bullet, ul, indentation +```markdown +... +8. Item +9. Item +10. Item +11. Item +... +``` -This rule is triggered when top level lists don't start at the beginning of a -line: +This rule also supports right-alignment of list markers such that all items have +the same ending column: - Some text +```markdown +... + 8. Item + 9. Item +10. Item +11. Item +... +``` - * List item - * List item +Rationale: Violations of this rule can lead to improperly rendered content. -To fix, ensure that top level list items are not indented: + +## `MD007` - Unordered list indentation - Some test +Tags: `bullet`, `indentation`, `ul` - * List item - * List item +Aliases: `ul-indent` -Rationale: Starting lists at the beginning of the line means that nested list -items can all be indented by the same amount when an editor's indent function -or the tab key is used to indent. Starting a list 1 space in means that the -indent of the first nested list is less than the indent of the second level (3 -characters if you use 4 space tabs, or 1 character if you use 2 space tabs). +Parameters: -## MD007 - Unordered list indentation +- `indent`: Spaces for indent (`integer`, default `2`) +- `start_indent`: Spaces for first level indent (when start_indented is set) + (`integer`, default `2`) +- `start_indented`: Whether to indent the first level of the list (`boolean`, + default `false`) -Tags: bullet, ul, indentation - -Parameters: indent (number; default 2) +Fixable: Some violations can be fixed by tooling This rule is triggered when list items are not indented by the configured number of spaces (default: 2). Example: - * List item - * Nested list item indented by 3 spaces +```markdown +* List item + * Nested list item indented by 3 spaces +``` Corrected Example: - * List item - * Nested list item indented by 2 spaces +```markdown +* List item + * Nested list item indented by 2 spaces +``` -Rationale (2 space indent): indenting by 2 spaces allows the content of a -nested list to be in line with the start of the content of the parent list -when a single space is used after the list marker. +Note: This rule applies to a sublist only if its parent lists are all also +unordered (otherwise, extra indentation of ordered lists interferes with the +rule). -Rationale (4 space indent): Same indent as code blocks, simpler for editors to -implement. See - for more -information. +The `start_indented` parameter allows the first level of lists to be indented by +the configured number of spaces rather than starting at zero. The `start_indent` +parameter allows the first level of lists to be indented by a different number +of spaces than the rest (ignored when `start_indented` is not set). -In addition, this is a compatibility issue with multi-markdown parsers, which -require a 4 space indents. See - -for a description of the problem. +Rationale: Indenting by 2 spaces allows the content of a nested list to be in +line with the start of the content of the parent list when a single space is +used after the list marker. Indenting by 4 spaces is consistent with code blocks +and simpler for editors to implement. Additionally, this can be a compatibility +issue for other Markdown parsers, which require 4-space indents. More +information: [Markdown Style Guide][markdown-style-guide]. -## MD009 - Trailing spaces +Note: See [Prettier.md](Prettier.md) for compatibility information. -Tags: whitespace +[markdown-style-guide]: https://cirosantilli.com/markdown-style-guide#indentation-of-content-inside-lists -Parameters: br_spaces (number; default: 0) + -This rule is triggered on any lines that end with whitespace. To fix this, -find the line that is triggered and remove any trailing spaces from the end. +## `MD009` - Trailing spaces -The br_spaces parameter allows an exception to this rule for a specific amount -of trailing spaces used to insert an explicit line break/br element. For -example, set br_spaces to 2 to allow exactly 2 spaces at the end of a line. +Tags: `whitespace` -Note: you have to set br_spaces to 2 or higher for this exception to take -effect - you can't insert a br element with just a single trailing space, so -if you set br_spaces to 1, the exception will be disabled, just as if it was -set to the default of 0. +Aliases: `no-trailing-spaces` -## MD010 - Hard tabs +Parameters: -Tags: whitespace, hard_tab +- `br_spaces`: Spaces for line break (`integer`, default `2`) +- `code_blocks`: Include code blocks (`boolean`, default `false`) +- `list_item_empty_lines`: Allow spaces for empty lines in list items + (`boolean`, default `false`) +- `strict`: Include unnecessary breaks (`boolean`, default `false`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered on any lines that end with unexpected whitespace. To fix +this, remove the trailing space from the end of the line. + +The `br_spaces` parameter allows an exception to this rule for a specific number +of trailing spaces, typically used to insert an explicit line break. The default +value allows 2 spaces to indicate a hard break (\
element). (You must set +`br_spaces` to a value >= 2 for this parameter to take effect. Setting +`br_spaces` to 1 behaves the same as 0, disallowing any trailing spaces.) + +By default, trailing space is allowed in indented and fenced code blocks because +some programming languages require that. To report such instances, set the +`code_blocks` parameter to `true`. + +By default, this rule will not trigger when the allowed number of spaces is +used, even when it doesn't create a hard break (for example, at the end of a +paragraph). To report such instances, set the `strict` parameter to `true`. + +```markdown +Text text text +text[2 spaces] +``` + +Using spaces to indent blank lines inside a list item is usually not necessary, +but some parsers require it. Set the `list_item_empty_lines` parameter to `true` +to allow this (even when `strict` is `true`): + +```markdown +- list item text + [2 spaces] + list item text +``` + +Rationale: Except when being used to create a line break, trailing whitespace +has no purpose and does not affect the rendering of content. + + + +## `MD010` - Hard tabs + +Tags: `hard_tab`, `whitespace` + +Aliases: `no-hard-tabs` + +Parameters: + +- `code_blocks`: Include code blocks (`boolean`, default `true`) +- `ignore_code_languages`: Fenced code languages to ignore (`string[]`, default + `[]`) +- `spaces_per_tab`: Number of spaces for each hard tab (`integer`, default `1`) + +Fixable: Some violations can be fixed by tooling This rule is triggered by any lines that contain hard tab characters instead of using spaces for indentation. To fix this, replace any hard tab characters @@ -217,365 +360,800 @@ with spaces instead. Example: - Some text + - * hard tab character used to indent the list item +```markdown +Some text + + * hard tab character used to indent the list item +``` + + Corrected example: - Some text +```markdown +Some text - * Spaces used to indent the list item instead + * Spaces used to indent the list item instead +``` -## MD011 - Reversed link syntax +You have the option to exclude this rule for code blocks and spans. To do so, +set the `code_blocks` parameter to `false`. Code blocks and spans are included +by default since handling of tabs by Markdown tools can be inconsistent (e.g., +using 4 vs. 8 spaces). -Tags: links +When code blocks are scanned (e.g., by default or if `code_blocks` is `true`), +the `ignore_code_languages` parameter can be set to a list of languages that +should be ignored (i.e., hard tabs will be allowed, though not required). This +makes it easier for documents to include code for languages that require hard +tabs. + +By default, violations of this rule are fixed by replacing the tab with 1 space +character. To use a different number of spaces, set the `spaces_per_tab` +parameter to the desired value. + +Rationale: Hard tabs are often rendered inconsistently by different editors and +can be harder to work with than spaces. + +More information: + +- +- +- + + + +## `MD011` - Reversed link syntax + +Tags: `links` + +Aliases: `no-reversed-links` + +Fixable: Some violations can be fixed by tooling This rule is triggered when text that appears to be a link is encountered, but where the syntax appears to have been reversed (the `[]` and `()` are reversed): - (Incorrect link syntax)[http://www.example.com/] +```markdown +(Incorrect link syntax)[https://www.example.com/] +``` To fix this, swap the `[]` and `()` around: - [Correct link syntax](http://www.example.com/) +```markdown +[Correct link syntax](https://www.example.com/) +``` -## MD012 - Multiple consecutive blank lines +Note: [Markdown Extra](https://en.wikipedia.org/wiki/Markdown_Extra)-style +footnotes do not trigger this rule: -Tags: whitespace, blank_lines +```markdown +For (example)[^1] +``` + +Rationale: Reversed links are not rendered as usable links. + + + +## `MD012` - Multiple consecutive blank lines + +Tags: `blank_lines`, `whitespace` + +Aliases: `no-multiple-blanks` + +Parameters: + +- `maximum`: Consecutive blank lines (`integer`, default `1`) + +Fixable: Some violations can be fixed by tooling This rule is triggered when there are multiple consecutive blank lines in the document: - Some text here +```markdown +Some text here - Some more text here +Some more text here +``` To fix this, delete the offending lines: - Some text here +```markdown +Some text here - Some more text here +Some more text here +``` Note: this rule will not be triggered if there are multiple consecutive blank lines inside code blocks. -## MD013 - Line length +Note: The `maximum` parameter can be used to configure the maximum number of +consecutive blank lines. -Tags: line_length +Rationale: Except in a code block, blank lines serve no purpose and do not +affect the rendering of content. -Parameters: line_length (number; default 80) + + +## `MD013` - Line length + +Tags: `line_length` + +Aliases: `line-length` + +Parameters: + +- `code_block_line_length`: Number of characters for code blocks (`integer`, + default `80`) +- `code_blocks`: Include code blocks (`boolean`, default `true`) +- `heading_line_length`: Number of characters for headings (`integer`, default + `80`) +- `headings`: Include headings (`boolean`, default `true`) +- `line_length`: Number of characters (`integer`, default `80`) +- `stern`: Stern length checking (`boolean`, default `false`) +- `strict`: Strict length checking (`boolean`, default `false`) +- `tables`: Include tables (`boolean`, default `true`) This rule is triggered when there are lines that are longer than the -configured line length (default: 80 characters). To fix this, split the line -up into multiple lines. +configured `line_length` (default: 80 characters). To fix this, split the line +up into multiple lines. To set a different maximum length for headings, use +`heading_line_length`. To set a different maximum length for code blocks, use +`code_block_line_length` -This rule has an exception where there is no whitespace beyond the configured -line length. This allows you to still include items such as long URLs without -being forced to break them in the middle. +This rule has an exception when there is no whitespace beyond the configured +line length. This allows you to include items such as long URLs without being +forced to break them in the middle. To disable this exception, set the `strict` +parameter to `true` and an issue will be reported when any line is too long. To +warn for lines that are too long and could be fixed but allow long lines +without spaces, set the `stern` parameter to `true`. -## MD014 - Dollar signs used before commands without showing output +For example (assuming normal behavior): -Tags: code +```markdown +IF THIS LINE IS THE MAXIMUM LENGTH +This line is okay because there are-no-spaces-beyond-that-length +This line is a violation because there are spaces beyond that length +This-line-is-okay-because-there-are-no-spaces-anywhere-within +``` + +In `strict` mode, the last three lines above are all violations. In `stern` +mode, the middle two lines above are both violations, but the last is okay. + +You have the option to exclude this rule for code blocks, tables, or headings. +To do so, set the `code_blocks`, `tables`, or `headings` parameter(s) to false. + +Code blocks are included in this rule by default since it is often a +requirement for document readability, and tentatively compatible with code +rules. Still, some languages do not lend themselves to short lines. + +Lines with link/image reference definitions and standalone lines (i.e., not part +of a paragraph) with only a link/image (possibly using (strong) emphasis) are +always exempted from this rule (even in `strict` mode) because there is often no +way to split such lines without breaking the URL. + +Rationale: Extremely long lines can be difficult to work with in some editors. +More information: . + + + +## `MD014` - Dollar signs used before commands without showing output + +Tags: `code` + +Aliases: `commands-show-output` + +Fixable: Some violations can be fixed by tooling This rule is triggered when there are code blocks showing shell commands to be -typed, and the shell commands are preceded by dollar signs ($): +typed, and *all* of the shell commands are preceded by dollar signs ($): - $ ls - $ cat foo - $ less bar + -The dollar signs are unnecessary in the above situation, and should not be +```markdown +$ ls +$ cat foo +$ less bar +``` + + + +The dollar signs are unnecessary in this situation, and should not be included: - ls - cat foo - less bar +```markdown +ls +cat foo +less bar +``` -However, an exception is made when there is a need to distinguish between -typed commands and command output, as in the following example: +Showing output for commands preceded by dollar signs does not trigger this rule: - $ ls - foo bar - $ cat foo - Hello world - $ cat bar - baz +```markdown +$ ls +foo bar +$ cat foo +Hello world +$ cat bar +baz +``` -Rationale: it is easier to copy and paste and less noisy if the dollar signs +Because some commands do not produce output, it is not a violation if *some* +commands do not have output: + +```markdown +$ mkdir test +mkdir: created directory 'test' +$ ls test +``` + +Rationale: It is easier to copy/paste and less noisy if the dollar signs are omitted when they are not needed. See - + for more information. -## MD018 - No space after hash on atx style header + -Tags: headers, atx, spaces +## `MD018` - No space after hash on atx style heading + +Tags: `atx`, `headings`, `spaces` + +Aliases: `no-missing-space-atx` + +Fixable: Some violations can be fixed by tooling This rule is triggered when spaces are missing after the hash characters -in an atx style header: +in an atx style heading: - #Header 1 +```markdown +#Heading 1 - ##Header 2 +##Heading 2 +``` -To fix this, separate the header text from the hash character by a single +To fix this, separate the heading text from the hash character by a single space: - # Header 1 +```markdown +# Heading 1 - ## Header 2 +## Heading 2 +``` -## MD019 - Multiple spaces after hash on atx style header +Rationale: Violations of this rule can lead to improperly rendered content. -Tags: headers, atx, spaces + + +## `MD019` - Multiple spaces after hash on atx style heading + +Tags: `atx`, `headings`, `spaces` + +Aliases: `no-multiple-space-atx` + +Fixable: Some violations can be fixed by tooling This rule is triggered when more than one space is used to separate the -header text from the hash characters in an atx style header: +heading text from the hash characters in an atx style heading: - # Header 1 +```markdown +# Heading 1 - ## Header 2 +## Heading 2 +``` -To fix this, separate the header text from the hash character by a single +To fix this, separate the heading text from the hash character by a single space: - # Header 1 +```markdown +# Heading 1 - ## Header 2 +## Heading 2 +``` -## MD020 - No space inside hashes on closed atx style header +Rationale: Extra space has no purpose and does not affect the rendering of +content. -Tags: headers, atx_closed, spaces + + +## `MD020` - No space inside hashes on closed atx style heading + +Tags: `atx_closed`, `headings`, `spaces` + +Aliases: `no-missing-space-closed-atx` + +Fixable: Some violations can be fixed by tooling This rule is triggered when spaces are missing inside the hash characters -in a closed atx style header: +in a closed atx style heading: - #Header 1# +```markdown +#Heading 1# - ##Header 2## +##Heading 2## +``` -To fix this, separate the header text from the hash character by a single +To fix this, separate the heading text from the hash character by a single space: - # Header 1 # +```markdown +# Heading 1 # - ## Header 2 ## +## Heading 2 ## +``` -Note: this rule will fire if either side of the header is missing spaces. +Note: this rule will fire if either side of the heading is missing spaces. -## MD021 - Multiple spaces inside hashes on closed atx style header +Rationale: Violations of this rule can lead to improperly rendered content. -Tags: headers, atx_closed, spaces + + +## `MD021` - Multiple spaces inside hashes on closed atx style heading + +Tags: `atx_closed`, `headings`, `spaces` + +Aliases: `no-multiple-space-closed-atx` + +Fixable: Some violations can be fixed by tooling This rule is triggered when more than one space is used to separate the -header text from the hash characters in a closed atx style header: +heading text from the hash characters in a closed atx style heading: - # Header 1 # +```markdown +# Heading 1 # - ## Header 2 ## +## Heading 2 ## +``` -To fix this, separate the header text from the hash character by a single +To fix this, separate the heading text from the hash character by a single space: - # Header 1 # +```markdown +# Heading 1 # - ## Header 2 ## +## Heading 2 ## +``` -Note: this rule will fire if either side of the header contains multiple +Note: this rule will fire if either side of the heading contains multiple spaces. -## MD022 - Headers should be surrounded by blank lines +Rationale: Extra space has no purpose and does not affect the rendering of +content. -Tags: headers, blank_lines + -This rule is triggered when headers (any style) are either not preceded or not -followed by a blank line: +## `MD022` - Headings should be surrounded by blank lines - # Header 1 - Some text +Tags: `blank_lines`, `headings` - Some more text - ## Header 2 +Aliases: `blanks-around-headings` -To fix this, ensure that all headers have a blank line both before and after -(except where the header is at the beginning or end of the document): +Parameters: - # Header 1 +- `lines_above`: Blank lines above heading (`integer|integer[]`, default `1`) +- `lines_below`: Blank lines below heading (`integer|integer[]`, default `1`) - Some text +Fixable: Some violations can be fixed by tooling - Some more text +This rule is triggered when headings (any style) are either not preceded or not +followed by at least one blank line: - ## Header 2 +```markdown +# Heading 1 +Some text -Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will -not parse headers that don't have a blank line before, and will parse them as -regular text. +Some more text +## Heading 2 +``` -## MD023 - Headers must start at the beginning of the line +To fix this, ensure that all headings have a blank line both before and after +(except where the heading is at the beginning or end of the document): -Tags: headers, spaces +```markdown +# Heading 1 -This rule is triggered when a header is indented by one or more spaces: +Some text - Some text +Some more text - # Indented header +## Heading 2 +``` -To fix this, ensure that all headers start at the beginning of the line: +The `lines_above` and `lines_below` parameters can be used to specify a +different number of blank lines (including `0`) above or below each heading. +If the value `-1` is used for either parameter, any number of blank lines is +allowed. To customize the number of lines above or below each heading level +individually, specify a `number[]` where values correspond to heading levels +1-6 (in order). - Some text +Notes: If `lines_above` or `lines_below` are configured to require more than one +blank line, [MD012/no-multiple-blanks](md012.md) should also be customized. This +rule checks for *at least* as many blank lines as specified; any extra blank +lines are ignored. - # Header +Rationale: Aside from aesthetic reasons, some parsers, including `kramdown`, +will not parse headings that don't have a blank line before, and will parse them +as regular text. -Rationale: Headers that don't start at the beginning of the line will not be -parsed as headers, and will instead appear as regular text. + -## MD024 - Multiple headers with the same content +## `MD023` - Headings must start at the beginning of the line -Tags: headers +Tags: `headings`, `spaces` -This rule is triggered if there are multiple headers in the document that have +Aliases: `heading-start-left` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when a heading is indented by one or more spaces: + +```markdown +Some text + + # Indented heading +``` + +To fix this, ensure that all headings start at the beginning of the line: + +```markdown +Some text + +# Heading +``` + +Note that scenarios like block quotes "indent" the start of the line, so the +following is also correct: + +```markdown +> # Heading in Block Quote +``` + +Rationale: Headings that don't start at the beginning of the line will not be +parsed as headings, and will instead appear as regular text. + + + +## `MD024` - Multiple headings with the same content + +Tags: `headings` + +Aliases: `no-duplicate-heading` + +Parameters: + +- `siblings_only`: Only check sibling headings (`boolean`, default `false`) + +This rule is triggered if there are multiple headings in the document that have the same text: - # Some text +```markdown +# Some text - ## Some text +## Some text +``` -To fix this, ensure that the content of each header is different: +To fix this, ensure that the content of each heading is different: - # Some text +```markdown +# Some text - ## Some more text +## Some more text +``` -Rationale: Some markdown parses generate anchors for headers based on the -header name, and having headers with the same content can cause problems with -this. +If the parameter `siblings_only` is set to `true`, duplication is allowed for +headings with different parents (as is common in changelogs): -## MD025 - Multiple top level headers in the same document +```markdown +# Change log -Tags: headers +## 1.0.0 -This rule is triggered when a top level header is in use (the first line of -the file is a h1 header), and more than one h1 header is in use in the +### Features + +## 2.0.0 + +### Features +``` + +Rationale: Some Markdown parsers generate anchors for headings based on the +heading name; headings with the same content can cause problems with that. + + + +## `MD025` - Multiple top-level headings in the same document + +Tags: `headings` + +Aliases: `single-h1`, `single-title` + +Parameters: + +- `front_matter_title`: RegExp for matching title in front matter (`string`, + default `^\s*title\s*[:=]`) +- `level`: Heading level (`integer`, default `1`) + +This rule is triggered when a top-level heading is in use (the first line of +the file is an h1 heading), and more than one h1 heading is in use in the document: - # Top level header +```markdown +# Top level heading - # Another top level header +# Another top-level heading +``` -To fix, structure your document so that there is a single h1 header that is -the title for the document, and all later headers are h2 or lower level -headers: +To fix, structure your document so there is a single h1 heading that is +the title for the document. Subsequent headings must be +lower-level headings (h2, h3, etc.): - # Title +```markdown +# Title - ## Header +## Heading - ## Another header +## Another heading +``` -Rationale: A top level header is a h1 on the first line of the file, and +Note: The `level` parameter can be used to change the top-level (ex: to h2) in +cases where an h1 is added externally. + +If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and +contains a `title` property (commonly used with blog posts), this rule treats +that as a top level heading and will report a violation for any subsequent +top-level headings. To use a different property name in the front matter, +specify the text of a regular expression via the `front_matter_title` parameter. +To disable the use of front matter by this rule, specify `""` for +`front_matter_title`. + +Rationale: A top-level heading is an h1 on the first line of the file, and serves as the title for the document. If this convention is in use, then there -can not be more than one title for the document, and the entire document -should be contained within this header. +can not be more than one title for the document, and the entire document should +be contained within this heading. -## MD026 - Trailing punctuation in header + -Tags: headers +## `MD026` - Trailing punctuation in heading -Parameters: punctuation (string; default ".,;:!?") +Tags: `headings` -This rule is triggered on any header that has a punctuation character as the -last character in the line: +Aliases: `no-trailing-punctuation` - # This is a header. +Parameters: -To fix this, remove any trailing punctuation: +- `punctuation`: Punctuation characters (`string`, default `.,;:!。,;:!`) - # This is a header +Fixable: Some violations can be fixed by tooling -Note: The punctuation parameter can be used to specify what characters class -as punctuation at the end of the header. For example, you can set it to -`'.,;:!'` to allow headers with question marks in them, such as might be used -in an FAQ. +This rule is triggered on any heading that has one of the specified normal or +full-width punctuation characters as the last character in the line: -## MD027 - Multiple spaces after blockquote symbol +```markdown +# This is a heading. +``` -Tags: blockquote, whitespace, indentation +To fix this, remove the trailing punctuation: + +```markdown +# This is a heading +``` + +Note: The `punctuation` parameter can be used to specify what characters count +as punctuation at the end of a heading. For example, you can change it to +`".,;:"` to allow headings that end with an exclamation point. `?` is +allowed by default because of how common it is in headings of FAQ-style +documents. Setting the `punctuation` parameter to `""` allows all characters - +and is equivalent to disabling the rule. + +Note: The trailing semicolon of [HTML entity references][html-entity-references] +like `©`, `©`, and `©` is ignored by this rule. + +Rationale: Headings are not meant to be full sentences. More information: +[Punctuation at the end of headers][end-punctuation]. + +[end-punctuation]: https://cirosantilli.com/markdown-style-guide#punctuation-at-the-end-of-headers +[html-entity-references]: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references + + + +## `MD027` - Multiple spaces after blockquote symbol + +Tags: `blockquote`, `indentation`, `whitespace` + +Aliases: `no-multiple-space-blockquote` + +Parameters: + +- `list_items`: Include list items (`boolean`, default `true`) + +Fixable: Some violations can be fixed by tooling This rule is triggered when blockquotes have more than one space after the blockquote (`>`) symbol: - > This is a block quote with bad indentation - > there should only be one. +```markdown +> This is a blockquote with bad indentation +> there should only be one. +``` To fix, remove any extraneous space: - > This is a blockquote with correct - > indentation. +```markdown +> This is a blockquote with correct +> indentation. +``` -## MD028 - Blank line inside blockquote +Inferring intended list indentation within a blockquote can be challenging; +setting the `list_items` parameter to `false` disables this rule for ordered +and unordered list items. -Tags: blockquote, whitespace +Rationale: Consistent formatting makes it easier to understand a document. + + + +## `MD028` - Blank line inside blockquote + +Tags: `blockquote`, `whitespace` + +Aliases: `no-blanks-blockquote` This rule is triggered when two blockquote blocks are separated by nothing except for a blank line: - > This is a blockquote - > which is immediately followed by +```markdown +> This is a blockquote +> which is immediately followed by - > this blockquote. Unfortunately - > In some parsers, these are treated as the same blockquote. +> this blockquote. Unfortunately +> In some parsers, these are treated as the same blockquote. +``` To fix this, ensure that any blockquotes that are right next to each other have some text in between: - > This is a blockquote. +```markdown +> This is a blockquote. - And Jimmy also said: +And Jimmy also said: - > This too is a blockquote. +> This too is a blockquote. +``` Alternatively, if they are supposed to be the same quote, then add the blockquote symbol at the beginning of the blank line: - > This is a blockquote. - > - > This is the same blockquote. +```markdown +> This is a blockquote. +> +> This is the same blockquote. +``` -Rationale: Some markdown parsers will treat two blockquotes separated by one +Rationale: Some Markdown parsers will treat two blockquotes separated by one or more blank lines as the same blockquote, while others will treat them as separate blockquotes. -## MD029 - Ordered list item prefix + -Tags: ol +## `MD029` - Ordered list item prefix -Parameters: style ("one", "ordered"; default "one") +Tags: `ol` -This rule is triggered on ordered lists that do not either start with '1.' or +Aliases: `ol-prefix` + +Parameters: + +- `style`: List style (`string`, default `one_or_ordered`, values `one` / + `one_or_ordered` / `ordered` / `zero`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered for ordered lists that do not either start with '1.' or do not have a prefix that increases in numerical order (depending on the -configured style, which defaults to 'one'). +configured style). The less-common pattern of using '0.' as a first prefix or +for all prefixes is also supported. Example valid list if the style is configured as 'one': - 1. Do this. - 1. Do that. - 1. Done. +```markdown +1. Do this. +1. Do that. +1. Done. +``` -Example valid list if the style is configured as 'ordered': +Examples of valid lists if the style is configured as 'ordered': - 1. Do this. - 2. Do that. - 3. Done. +```markdown +1. Do this. +2. Do that. +3. Done. +``` -## MD030 - Spaces after list markers +```markdown +0. Do this. +1. Do that. +2. Done. +``` -Tags: ol, ul, whitespace +All three examples are valid when the style is configured as 'one_or_ordered'. -Parameters: ul_single, ol_single, ul_multi, ol_multi (number, default 1) +Example valid list if the style is configured as 'zero': + +```markdown +0. Do this. +0. Do that. +0. Done. +``` + +Example invalid list for all styles: + +```markdown +1. Do this. +3. Done. +``` + +This rule supports 0-prefixing ordered list items for uniform indentation: + +```markdown +... +08. Item +09. Item +10. Item +11. Item +... +``` + +Note: This rule will report violations for cases like the following where an +improperly-indented code block (or similar) appears between two list items and +"breaks" the list in two: + + + +~~~markdown +1. First list + +```text +Code block +``` + +1. Second list +~~~ + +The fix is to indent the code block so it becomes part of the preceding list +item as intended: + +~~~markdown +1. First list + + ```text + Code block + ``` + +2. Still first list +~~~ + + + +Rationale: Consistent formatting makes it easier to understand a document. + + + +## `MD030` - Spaces after list markers + +Tags: `ol`, `ul`, `whitespace` + +Aliases: `list-marker-space` + +Parameters: + +- `ol_multi`: Spaces for multi-line ordered list items (`integer`, default `1`) +- `ol_single`: Spaces for single-line ordered list items (`integer`, default + `1`) +- `ul_multi`: Spaces for multi-line unordered list items (`integer`, default + `1`) +- `ul_single`: Spaces for single-line unordered list items (`integer`, default + `1`) + +Fixable: Some violations can be fixed by tooling This rule checks for the number of spaces between a list marker (e.g. '`-`', '`*`', '`+`' or '`1.`') and the text of the list item. @@ -583,322 +1161,1654 @@ This rule checks for the number of spaces between a list marker (e.g. '`-`', The number of spaces checked for depends on the document style in use, but the default is 1 space after any list marker: - * Foo - * Bar - * Baz +```markdown +* Foo +* Bar +* Baz - 1. Foo - 1. Bar - 1. Baz +1. Foo +1. Bar +1. Baz - 1. Foo - * Bar - 1. Baz +1. Foo + * Bar +1. Baz +``` A document style may change the number of spaces after unordered list items and ordered list items independently, as well as based on whether the content -of every item in the list consists of a single paragraph, or multiple +of every item in the list consists of a single paragraph or multiple paragraphs (including sub-lists and code blocks). For example, the style guide at - + specifies that 1 space after the list marker should be used if every item in the list fits within a single paragraph, but to use 2 or 3 spaces (for ordered and unordered lists respectively) if there are multiple paragraphs of content inside the list: - * Foo - * Bar - * Baz +```markdown +* Foo +* Bar +* Baz +``` - vs. +vs. - * Foo +```markdown +* Foo - Second paragraph + Second paragraph - * Bar +* Bar +``` - or +or - 1. Foo +```markdown +1. Foo - Second paragraph + Second paragraph - 1. Bar +1. Bar +``` -To fix this, ensure the correct number of spaces are used after list marker +To fix this, ensure the correct number of spaces are used after the list marker for your selected document style. -## MD031 - Fenced code blocks should be surrounded by blank lines +Rationale: Violations of this rule can lead to improperly rendered content. -Tags: code, blank_lines +Note: See [Prettier.md](Prettier.md) for compatibility information. + + + +## `MD031` - Fenced code blocks should be surrounded by blank lines + +Tags: `blank_lines`, `code` + +Aliases: `blanks-around-fences` + +Parameters: + +- `list_items`: Include list items (`boolean`, default `true`) + +Fixable: Some violations can be fixed by tooling This rule is triggered when fenced code blocks are either not preceded or not followed by a blank line: - Some text - ``` - Code block - ``` +````markdown +Some text +``` +Code block +``` - ``` - Another code block - ``` - Some more text +``` +Another code block +``` +Some more text +```` To fix this, ensure that all fenced code blocks have a blank line both before and after (except where the block is at the beginning or end of the document): - Some text +````markdown +Some text - ``` - Code block - ``` +``` +Code block +``` - ``` - Another code block - ``` +``` +Another code block +``` - Some more text +Some more text +```` + +Set the `list_items` parameter to `false` to disable this rule for list items. +Disabling this behavior for lists can be useful if it is necessary to create a +[tight](https://spec.commonmark.org/0.29/#tight) list containing a code fence. Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse fenced code blocks that don't have blank lines before and after them. -## MD032 - Lists should be surrounded by blank lines + -Tags: bullet, ul, ol, blank_lines +## `MD032` - Lists should be surrounded by blank lines + +Tags: `blank_lines`, `bullet`, `ol`, `ul` + +Aliases: `blanks-around-lists` + +Fixable: Some violations can be fixed by tooling This rule is triggered when lists (of any kind) are either not preceded or not followed by a blank line: - Some text - * Some - * List +```markdown +Some text +* List item +* List item - 1. Some - 2. List - Some text +1. List item +2. List item +*** +``` -To fix this, ensure that all lists have a blank line both before and after -(except where the block is at the beginning or end of the document): +In the first case above, text immediately precedes the unordered list. In the +second case above, a thematic break immediately follows the ordered list. To fix +violations of this rule, ensure that all lists have a blank line both before and +after (except when the list is at the very beginning or end of the document): - Some text +```markdown +Some text - * Some - * List +* List item +* List item - 1. Some - 2. List +1. List item +2. List item - Some text +*** +``` -Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will -not parse lists that don't have blank lines before and after them. +Note that the following case is **not** a violation of this rule: -Note: List items without hanging indents are a violation of this rule; list -items with hanging indents are okay: +```markdown +1. List item + More item 1 +2. List item +More item 2 +``` - * This is - not okay +Although it is not indented, the text "More item 2" is referred to as a +[lazy continuation line][lazy-continuation] and considered part of the second +list item. - * This is - okay +Rationale: In addition to aesthetic reasons, some parsers, including kramdown, +will not parse lists that don't have blank lines before and after them. -## MD033 - Inline HTML +[lazy-continuation]: https://spec.commonmark.org/0.30/#lazy-continuation-line -Tags: html + -This rule is triggered whenever raw HTML is used in a markdown document: +## `MD033` - Inline HTML -

Inline HTML header

+Tags: `html` -To fix this, use 'pure' markdown instead of including raw HTML: +Aliases: `no-inline-html` - # Markdown header +Parameters: -Rationale: Raw HTML is allowed in markdown, but this rule is included for -those who want their documents to only include "pure" markdown, or for those -who are rendering markdown documents in something other than HTML. +- `allowed_elements`: Allowed elements (`string[]`, default `[]`) +- `table_allowed_elements`: Allowed elements in tables (`string[]`, default + `[]`) -## MD034 - Bare URL used +This rule is triggered whenever raw HTML is used in a Markdown document: -Tags: links, url +```markdown +

Inline HTML heading

+``` -This rule is triggered whenever a URL is given that isn't surrounded by angle -brackets: +To fix this, use 'pure' Markdown instead of including raw HTML: - For more information, see http://www.example.com/. +```markdown +# Markdown heading +``` -To fix this, add angle brackets around the URL: +To allow specific HTML elements anywhere in Markdown content, set the +`allowed_elements` parameter to a list of HTML element names. To allow a +specific set of HTML elements within Markdown tables, set the +`table_allowed_elements` parameter to a list of HTML element names. This can be +used to permit the use of `
`-style line breaks only within Markdown tables. - For more information, see . +Rationale: Raw HTML is allowed in Markdown, but this rule is included for +those who want their documents to only include "pure" Markdown, or for those +who are rendering Markdown documents into something other than HTML. -Rationale: Without angle brackets, the URL isn't converted into a link in many -markdown parsers. + -Note: if you do want a bare URL without it being converted into a link, -enclose it in a code block, otherwise in some markdown parsers it _will_ be -converted: +## `MD034` - Bare URL used - `http://www.example.com` +Tags: `links`, `url` -## MD035 - Horizontal rule style +Aliases: `no-bare-urls` -Tags: hr +Fixable: Some violations can be fixed by tooling -Parameters: style ("consistent", "---", "***", or other string specifying the -horizontal rule; default "consistent") +This rule is triggered whenever a URL or email address appears without +surrounding angle brackets: + +```markdown +For more info, visit https://www.example.com/ or email user@example.com. +``` + +To fix this, add angle brackets around the URL or email address: + +```markdown +For more info, visit or email . +``` + +If a URL or email address contains non-ASCII characters, it may be not be +handled as intended even when angle brackets are present. In such cases, +[percent-encoding](https://en.m.wikipedia.org/wiki/Percent-encoding) can be used +to comply with the required syntax for URL and email. + +Note: To include a bare URL or email without it being converted into a link, +wrap it in a code span: + +```markdown +Not a clickable link: `https://www.example.com` +``` + +Note: The following scenario does not trigger this rule because it could be a +shortcut link: + +```markdown +[https://www.example.com] +``` + +Note: The following syntax triggers this rule because the nested link could be +a shortcut link (which takes precedence): + +```markdown +[text [shortcut] text](https://example.com) +``` + +To avoid this, escape both inner brackets: + +```markdown +[link \[text\] link](https://example.com) +``` + +Rationale: Without angle brackets, a bare URL or email isn't converted into a +link by some Markdown parsers. + + + +## `MD035` - Horizontal rule style + +Tags: `hr` + +Aliases: `hr-style` + +Parameters: + +- `style`: Horizontal rule style (`string`, default `consistent`) This rule is triggered when inconsistent styles of horizontal rules are used in the document: - --- +```markdown +--- - - - - +- - - - *** +*** - * * * +* * * - **** +**** +``` -To fix this, ensure any horizontal rules used in the document are consistent, -or match the given style if the rule is so configured: +To fix this, use the same horizontal rule everywhere: - --- +```markdown +--- - --- +--- +``` -Note: by default, this rule is configured to just require that all horizontal -rules in the document are the same, and will trigger if any of the horizontal -rules are different than the first one encountered in the document. If you -want to configure the rule to match a specific style, the parameter given to -the 'style' option is a string containing the exact horizontal rule text that -is allowed. +The configured style can ensure all horizontal rules use a specific string or it +can ensure all horizontal rules match the first horizontal rule (`consistent`). -## MD036 - Emphasis used instead of a header +Rationale: Consistent formatting makes it easier to understand a document. -Tags: headers, emphasis + + +## `MD036` - Emphasis used instead of a heading + +Tags: `emphasis`, `headings` + +Aliases: `no-emphasis-as-heading` + +Parameters: + +- `punctuation`: Punctuation characters (`string`, default `.,;:!?。,;:!?`) This check looks for instances where emphasized (i.e. bold or italic) text is -used to separate sections, where a header should be used instead: +used to separate sections, where a heading should be used instead: - **My document** +```markdown +**My document** - Lorem ipsum dolor sit amet... +Lorem ipsum dolor sit amet... - _Another section_ +_Another section_ - Consectetur adipiscing elit, sed do eiusmod. +Consectetur adipiscing elit, sed do eiusmod. +``` -To fix this, use markdown headers instead of emphasized text to denote +To fix this, use Markdown headings instead of emphasized text to denote sections: - # My document +```markdown +# My document - Lorem ipsum dolor sit amet... +Lorem ipsum dolor sit amet... - ## Another section +## Another section - Consectetur adipiscing elit, sed do eiusmod. +Consectetur adipiscing elit, sed do eiusmod. +``` -Note: this rule looks for paragraphs that consist entirely of emphasized text. -It won't fire on emphasis used within regular text. +Note: This rule looks for single-line paragraphs that consist entirely +of emphasized text. It won't fire on emphasis used within regular text, +multi-line emphasized paragraphs, or paragraphs ending in punctuation +(normal or full-width). Similarly to rule MD026, you can configure what +characters are recognized as punctuation. -## MD037 - Spaces inside emphasis markers +Rationale: Using emphasis instead of a heading prevents tools from inferring +the structure of a document. More information: +. -Tags: whitespace, emphasis + + +## `MD037` - Spaces inside emphasis markers + +Tags: `emphasis`, `whitespace` + +Aliases: `no-space-in-emphasis` + +Fixable: Some violations can be fixed by tooling This rule is triggered when emphasis markers (bold, italic) are used, but they have spaces between the markers and the text: - Here is some ** bold ** text. +```markdown +Here is some ** bold ** text. - Here is some * italic * text. +Here is some * italic * text. - Here is some more __ bold __ text. +Here is some more __ bold __ text. - Here is some more _ italic _ text. +Here is some more _ italic _ text. +``` To fix this, remove the spaces around the emphasis markers: - Here is some **bold** text. +```markdown +Here is some **bold** text. - Here is some *italic* text. +Here is some *italic* text. - Here is some more __bold__ text. +Here is some more __bold__ text. - Here is some more _italic_ text. +Here is some more _italic_ text. +``` Rationale: Emphasis is only parsed as such when the asterisks/underscores -aren't completely surrounded by spaces. This rule attempts to detect where +aren't surrounded by spaces. This rule attempts to detect where they were surrounded by spaces, but it appears that emphasized text was intended by the author. -## MD038 - Spaces inside code span elements + -Tags: whitespace, code +## `MD038` - Spaces inside code span elements -This rule is triggered on code span elements that have spaces right inside the -backticks: +Tags: `code`, `whitespace` - ` some text ` +Aliases: `no-space-in-code` - `some text ` +Fixable: Some violations can be fixed by tooling - ` some text` +This rule is triggered for code spans containing content with unnecessary space +next to the beginning or ending backticks: -To fix this, remove the spaces inside the codespan markers: +```markdown +`some text ` - `some text` +` some text` -## MD039 - Spaces inside link text +` some text ` +``` -Tags: whitespace, links +To fix this, remove the extra space characters from the beginning and ending: + +```markdown +`some text` +``` + +Note: A single leading *and* trailing space is allowed by the specification and +trimmed by the parser to support code spans that begin or end with a backtick: + +```markdown +`` `backticks` `` + +`` backtick` `` +``` + +Note: When single-space padding is present in the input, it will be preserved +(even if unnecessary): + +```markdown +` code ` +``` + +Note: Code spans containing only spaces are allowed by the specification and are +also preserved: + +```markdown +` ` + +` ` +``` + +Rationale: Violations of this rule are usually unintentional and can lead to +improperly-rendered content. + + + +## `MD039` - Spaces inside link text + +Tags: `links`, `whitespace` + +Aliases: `no-space-in-links` + +Fixable: Some violations can be fixed by tooling This rule is triggered on links that have spaces surrounding the link text: - [ a link ](http://www.example.com/) +```markdown +[ a link ](https://www.example.com/) +``` To fix this, remove the spaces surrounding the link text: - [a link](http://www.example.com/) +```markdown +[a link](https://www.example.com/) +``` -## MD040 - Fenced code blocks should have a language specified +Rationale: Consistent formatting makes it easier to understand a document. -Tags: code, language + + +## `MD040` - Fenced code blocks should have a language specified + +Tags: `code`, `language` + +Aliases: `fenced-code-language` + +Parameters: + +- `allowed_languages`: List of languages (`string[]`, default `[]`) +- `language_only`: Require language only (`boolean`, default `false`) This rule is triggered when fenced code blocks are used, but a language isn't specified: - ``` - #!/bin/bash - echo Hello world - ``` +````markdown +``` +#!/bin/bash +echo Hello world +``` +```` To fix this, add a language specifier to the code block: - ```bash - #!/bin/bash - echo Hello world +````markdown +```bash +#!/bin/bash +echo Hello world +``` +```` + +To display a code block without syntax highlighting, use: + +````markdown +```text +Plain text in a code block +``` +```` + +You can configure the `allowed_languages` parameter to specify a list of +languages code blocks could use. Languages are case sensitive. The default value +is `[]` which means any language specifier is valid. + +You can prevent extra data from being present in the info string of fenced code +blocks. To do so, set the `language_only` parameter to `true`. + + +Info strings with leading/trailing whitespace (ex: `js `) or other content (ex: +`ruby startline=3`) will trigger this rule. + +Rationale: Specifying a language improves content rendering by using the +correct syntax highlighting for code. More information: +. + + + +## `MD041` - First line in a file should be a top-level heading + +Tags: `headings` + +Aliases: `first-line-h1`, `first-line-heading` + +Parameters: + +- `allow_preamble`: Allow content before first heading (`boolean`, default + `false`) +- `front_matter_title`: RegExp for matching title in front matter (`string`, + default `^\s*title\s*[:=]`) +- `level`: Heading level (`integer`, default `1`) + +This rule is intended to ensure documents have a title and is triggered when +the first line in a document is not a top-level ([HTML][HTML] `h1`) heading: + +```markdown +This is a document without a heading +``` + +To fix this, add a top-level heading to the beginning of the document: + +```markdown +# Document Heading + +This is a document with a top-level heading +``` + +Because it is common for projects on GitHub to use an image for the heading of +`README.md` and that pattern is not well-supported by Markdown, HTML headings +are also permitted by this rule. For example: + +```markdown +

+ +This is a document with a top-level HTML heading +``` + +In some cases, a document's title heading may be preceded by text like a table +of contents. This is not ideal for accessibility, but can be allowed by setting +the `allow_preamble` parameter to `true`. + +```markdown +This is a document with preamble text + +# Document Heading +``` + +If [YAML][YAML] front matter is present and contains a `title` property +(commonly used with blog posts), this rule will not report a violation. To use a +different property name in the front matter, specify the text of a [regular +expression][RegExp] via the `front_matter_title` parameter. To disable the use +of front matter by this rule, specify `""` for `front_matter_title`. + +The `level` parameter can be used to change the top-level heading (ex: to `h2`) +in cases where an `h1` is added externally. + +Rationale: The top-level heading often acts as the title of a document. More +information: . + +[HTML]: https://en.wikipedia.org/wiki/HTML +[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions +[YAML]: https://en.wikipedia.org/wiki/YAML + + + +## `MD042` - No empty links + +Tags: `links` + +Aliases: `no-empty-links` + +This rule is triggered when an empty link is encountered: + +```markdown +[an empty link]() +``` + +To fix the violation, provide a destination for the link: + +```markdown +[a valid link](https://example.com/) +``` + +Empty fragments will trigger this rule: + +```markdown +[an empty fragment](#) +``` + +But non-empty fragments will not: + +```markdown +[a valid fragment](#fragment) +``` + +Rationale: Empty links do not lead anywhere and therefore don't function as +links. + + + +## `MD043` - Required heading structure + +Tags: `headings` + +Aliases: `required-headings` + +Parameters: + +- `headings`: List of headings (`string[]`, default `[]`) +- `match_case`: Match case of headings (`boolean`, default `false`) + +This rule is triggered when the headings in a file do not match the array of +headings passed to the rule. It can be used to enforce a standard heading +structure for a set of files. + +To require exactly the following structure: + +```markdown +# Heading +## Item +### Detail +``` + +Set the `headings` parameter to: + +```json +[ + "# Heading", + "## Item", + "### Detail" +] +``` + +To allow optional headings as with the following structure: + +```markdown +# Heading +## Item +### Detail (optional) +## Foot +### Notes (optional) +``` + +Use the special value `"*"` meaning "zero or more unspecified headings" or the +special value `"+"` meaning "one or more unspecified headings" and set the +`headings` parameter to: + +```json +[ + "# Heading", + "## Item", + "*", + "## Foot", + "*" +] +``` + +To allow a single required heading to vary as with a project name: + +```markdown +# Project Name +## Description +## Examples +``` + +Use the special value `"?"` meaning "exactly one unspecified heading": + +```json +[ + "?", + "## Description", + "## Examples" +] +``` + +When an error is detected, this rule outputs the line number of the first +problematic heading (otherwise, it outputs the last line number of the file). + +Note that while the `headings` parameter uses the "## Text" ATX heading style +for simplicity, a file may use any supported heading style. + +By default, the case of headings in the document is not required to match that +of `headings`. To require that case match exactly, set the `match_case` +parameter to `true`. + +Rationale: Projects may wish to enforce a consistent document structure across +a set of similar content. + + + +## `MD044` - Proper names should have the correct capitalization + +Tags: `spelling` + +Aliases: `proper-names` + +Parameters: + +- `code_blocks`: Include code blocks (`boolean`, default `true`) +- `html_elements`: Include HTML elements (`boolean`, default `true`) +- `names`: List of proper names (`string[]`, default `[]`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when any of the strings in the `names` array do not have +the specified capitalization. It can be used to enforce a standard letter case +for the names of projects and products. + +For example, the language "JavaScript" is usually written with both the 'J' and +'S' capitalized - though sometimes the 's' or 'j' appear in lower-case. To +enforce the proper capitalization, specify the desired letter case in the +`names` array: + +```json +[ + "JavaScript" +] +``` + +Sometimes a proper name is capitalized differently in certain contexts. In such +cases, add both forms to the `names` array: + +```json +[ + "GitHub", + "github.com" +] +``` + +Set the `code_blocks` parameter to `false` to disable this rule for code blocks +and spans. Set the `html_elements` parameter to `false` to disable this rule +for HTML elements and attributes (such as when using a proper name as part of +a path for `a`/`href` or `img`/`src`). + +Rationale: Incorrect capitalization of proper names is usually a mistake. + + + +## `MD045` - Images should have alternate text (alt text) + +Tags: `accessibility`, `images` + +Aliases: `no-alt-text` + +This rule reports a violation when an image is missing alternate text (alt text) +information. + +Alternate text is commonly specified inline as: + +```markdown +![Alternate text](image.jpg) +``` + +Or with reference syntax as: + +```markdown +![Alternate text][ref] + +... + +[ref]: image.jpg "Optional title" +``` + +Or with HTML as: + +```html +Alternate text +``` + +Note: If the [HTML `aria-hidden` attribute][aria-hidden] is used to hide the +image from assistive technology, this rule does not report a violation: + +```html + +``` + +Guidance for writing alternate text is available from the [W3C][w3c], +[Wikipedia][wikipedia], and [other locations][phase2technology]. + +Rationale: Alternate text is important for accessibility and describes the +content of an image for people who may not be able to see it. + +[aria-hidden]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden +[phase2technology]: https://www.phase2technology.com/blog/no-more-excuses +[w3c]: https://www.w3.org/WAI/alt/ +[wikipedia]: https://en.wikipedia.org/wiki/Alt_attribute + + + +## `MD046` - Code block style + +Tags: `code` + +Aliases: `code-block-style` + +Parameters: + +- `style`: Block style (`string`, default `consistent`, values `consistent` / + `fenced` / `indented`) + +This rule is triggered when unwanted or different code block styles are used in +the same document. + +In the default configuration this rule reports a violation for the following +document: + + + + Some text. + + # Indented code + + More text. + + ```ruby + # Fenced code ``` -## MD041 - First line in file should be a top level header + More text. -Tags: headers + -This rule is triggered when the first line in the file isn't a top level (h1) -header: +To fix violations of this rule, use a consistent style (either indenting or code +fences). - ``` - This is a file without a header - ``` +The configured code block style can be specific (`fenced`, `indented`) or can +require all code blocks match the first code block (`consistent`). -To fix this, add a header to the top of your file: +Rationale: Consistent formatting makes it easier to understand a document. - ``` - # File with header + - This is a file with a top level header - ``` +## `MD047` - Files should end with a single newline character + +Tags: `blank_lines` + +Aliases: `single-trailing-newline` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when there is not a single newline character at the end +of a file. + +An example that triggers the rule: + +```markdown +# Heading + +This file ends without a newline.[EOF] +``` + +To fix the violation, add a newline character to the end of the file: + +```markdown +# Heading + +This file ends with a newline. +[EOF] +``` + +Rationale: Some programs have trouble with files that do not end with a newline. + +More information: [What's the point in adding a new line to the end of a +file?][stack-exchange] + +[stack-exchange]: https://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file + + + +## `MD048` - Code fence style + +Tags: `code` + +Aliases: `code-fence-style` + +Parameters: + +- `style`: Code fence style (`string`, default `consistent`, values `backtick` + / `consistent` / `tilde`) + +This rule is triggered when the symbols used in the document for fenced code +blocks do not match the configured code fence style: + +````markdown +```ruby +# Fenced code +``` + +~~~ruby +# Fenced code +~~~ +```` + +To fix this issue, use the configured code fence style throughout the +document: + +````markdown +```ruby +# Fenced code +``` + +```ruby +# Fenced code +``` +```` + +The configured code fence style can be a specific symbol to use (`backtick`, +`tilde`) or it can require all code fences match the first code fence +(`consistent`). + +Rationale: Consistent formatting makes it easier to understand a document. + + + +## `MD049` - Emphasis style + +Tags: `emphasis` + +Aliases: `emphasis-style` + +Parameters: + +- `style`: Emphasis style (`string`, default `consistent`, values `asterisk` / + `consistent` / `underscore`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when the symbols used in the document for emphasis do not +match the configured emphasis style: + +```markdown +*Text* +_Text_ +``` + +To fix this issue, use the configured emphasis style throughout the document: + +```markdown +*Text* +*Text* +``` + +The configured emphasis style can be a specific symbol to use (`asterisk`, +`underscore`) or can require all emphasis matches the first emphasis +(`consistent`). + +Note: Emphasis within a word is restricted to `asterisk` in order to avoid +unwanted emphasis for words containing internal underscores like_this_one. + +Rationale: Consistent formatting makes it easier to understand a document. + + + +## `MD050` - Strong style + +Tags: `emphasis` + +Aliases: `strong-style` + +Parameters: + +- `style`: Strong style (`string`, default `consistent`, values `asterisk` / + `consistent` / `underscore`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when the symbols used in the document for strong do not +match the configured strong style: + +```markdown +**Text** +__Text__ +``` + +To fix this issue, use the configured strong style throughout the document: + +```markdown +**Text** +**Text** +``` + +The configured strong style can be a specific symbol to use (`asterisk`, +`underscore`) or can require all strong matches the first strong (`consistent`). + +Note: Emphasis within a word is restricted to `asterisk` in order to avoid +unwanted emphasis for words containing internal underscores like__this__one. + +Rationale: Consistent formatting makes it easier to understand a document. + + + +## `MD051` - Link fragments should be valid + +Tags: `links` + +Aliases: `link-fragments` + +Parameters: + +- `ignore_case`: Ignore case of fragments (`boolean`, default `false`) +- `ignored_pattern`: Pattern for ignoring additional fragments (`string`, + default ``) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when a link fragment does not match any of the fragments +that are automatically generated for headings in a document: + +```markdown +# Heading Name + +[Link](#fragment) +``` + +To fix this issue, change the link fragment to reference an existing heading's +generated name (see below): + +```markdown +# Heading Name + +[Link](#heading-name) +``` + +For consistency, this rule requires fragments to exactly match the [GitHub +heading algorithm][github-heading-algorithm] which converts letters to +lowercase. Therefore, the following example is reported as a violation: + +```markdown +# Heading Name + +[Link](#Heading-Name) +``` + +To ignore case when comparing fragments with heading names, the `ignore_case` +parameter can be set to `true`. In this configuration, the previous example is +not reported as a violation. + +Alternatively, some platforms allow the syntax `{#named-anchor}` to be used +within a heading to provide a specific name (consisting of only lower-case +letters, numbers, `-`, and `_`): + +```markdown +# Heading Name {#custom-name} + +[Link](#custom-name) +``` + +Alternatively, any HTML tag with an `id` attribute or an `a` tag with a `name` +attribute can be used to define a fragment: + +```markdown + + +[Link](#bookmark) +``` + +An `a` tag can be useful in scenarios where a heading is not appropriate or for +control over the text of the fragment identifier. + +[HTML links to `#top` scroll to the top of a document][html-top-fragment]. This +rule allows that syntax (using lower-case for consistency): + +```markdown +[Link](#top) +``` + +This rule also recognizes the custom fragment syntax used by GitHub to highlight +[specific content in a document][github-linking-to-content]. + +For example, this link to line 20: + +```markdown +[Link](#L20) +``` + +And this link to content starting within line 19 running into line 21: + +```markdown +[Link](#L19C5-L21C11) +``` + +Some Markdown generators dynamically create and insert headings when building +documents, for example by combining a fixed prefix like `figure-` and an +incrementing numeric counter. To ignore such generated fragments, set the +`ignored_pattern` [regular expression][RegEx] parameter to a pattern that +matches (e.g., `^figure-`). + +Rationale: [GitHub section links][github-section-links] are created +automatically for every heading when Markdown content is displayed on GitHub. +This makes it easy to link directly to different sections within a document. +However, section links change if headings are renamed or removed. This rule +helps identify broken section links within a document. + +Note: Section links are **not** part of the CommonMark specification; this rule +enforces the [GitHub heading algorithm][github-heading-algorithm]: + +1. Convert text to lowercase +2. Remove punctuation characters +3. Convert spaces to dashes +4. Append an incrementing integer (as needed for uniqueness) +5. [URI-encode][encodeURIComponent] the result + +[encodeURIComponent]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent +[github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links +[github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb +[github-linking-to-content]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown +[html-top-fragment]: https://html.spec.whatwg.org/multipage/browsing-the-web.html#scrolling-to-a-fragment +[RegEx]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions + + + +## `MD052` - Reference links and images should use a label that is defined + +Tags: `images`, `links` + +Aliases: `reference-links-images` + +Parameters: + +- `ignored_labels`: Ignored link labels (`string[]`, default `["x"]`) +- `shortcut_syntax`: Include shortcut syntax (`boolean`, default `false`) + +Links and images in Markdown can provide the link destination or image source +at the time of use or can define it elsewhere and use a label for reference. +The reference format is convenient for keeping paragraph text clutter-free +and makes it easy to reuse the same URL in multiple places. + +There are three kinds of reference links and images: + +```markdown +Full: [text][label] +Collapsed: [label][] +Shortcut: [label] + +Full: ![text][image] +Collapsed: ![image][] +Shortcut: ![image] + +[label]: https://example.com/label +[image]: https://example.com/image +``` + +A link or image renders correctly when the corresponding label is defined, but +displays as text with brackets when the label is not present. By default, this +rule warns of undefined labels for "full" and "collapsed" reference syntax but +not for "shortcut" syntax because it is ambiguous. + +The text `[example]` could be a shortcut link or the text "example" in brackets, +so "shortcut" syntax is ignored by default. To include "shortcut" syntax, set +the `include_shortcut` parameter to `true`. Note that doing so produces warnings +for *all* text in the document that *could* be a shortcut. If bracketed text is +intentional, brackets can be escaped with the `\` character: `\[example\]`. + +If there are link labels that are deliberately unreferenced, they can be ignored +by setting the `ignored_labels` parameter to the list of strings to ignore. The +default value of this parameter ignores the checkbox syntax used by +[GitHub Flavored Markdown task list items][gfm-tasklist]: + +```markdown +- [x] Checked task list item +``` + +[gfm-tasklist]: https://github.github.com/gfm/#task-list-items-extension- + + + +## `MD053` - Link and image reference definitions should be needed + +Tags: `images`, `links` + +Aliases: `link-image-reference-definitions` + +Parameters: + +- `ignored_definitions`: Ignored definitions (`string[]`, default `["//"]`) + +Fixable: Some violations can be fixed by tooling + +Links and images in Markdown can provide the link destination or image source +at the time of use or can use a label to reference a definition elsewhere in +the document. The latter reference format is convenient for keeping paragraph +text clutter-free and makes it easy to reuse the same URL in multiple places. + +Because link and image reference definitions are located separately from +where they are used, there are two scenarios where a definition can be +unnecessary: + +1. If a label is not referenced by any link or image in a document, that + definition is unused and can be deleted. +2. If a label is defined multiple times in a document, the first definition is + used and the others can be deleted. + +This rule considers a reference definition to be used if any link or image +reference has the corresponding label. The "full", "collapsed", and "shortcut" +formats are all supported. + +If there are reference definitions that are deliberately unreferenced, they can +be ignored by setting the `ignored_definitions` parameter to the list of strings +to ignore. The default value of this parameter ignores the following convention +for adding non-HTML comments to Markdown: + +```markdown +[//]: # (This behaves like a comment) +``` + + + +## `MD054` - Link and image style + +Tags: `images`, `links` + +Aliases: `link-image-style` + +Parameters: + +- `autolink`: Allow autolinks (`boolean`, default `true`) +- `collapsed`: Allow collapsed reference links and images (`boolean`, default + `true`) +- `full`: Allow full reference links and images (`boolean`, default `true`) +- `inline`: Allow inline links and images (`boolean`, default `true`) +- `shortcut`: Allow shortcut reference links and images (`boolean`, default + `true`) +- `url_inline`: Allow URLs as inline links (`boolean`, default `true`) + +Fixable: Some violations can be fixed by tooling + +Links and images in Markdown can provide the link destination or image source at +the time of use or can use a label to reference a definition elsewhere in the +document. The three reference formats are convenient for keeping paragraph text +clutter-free and make it easy to reuse the same URL in multiple places. + +By default, this rule allows all link/image styles. + +Setting the `autolink` parameter to `false` disables autolinks: + +```markdown + +``` + +Setting the `inline` parameter to `false` disables inline links and images: + +```markdown +[link](https://example.com) + +![image](https://example.com) +``` + +Setting the `full` parameter to `false` disables full reference links and +images: + +```markdown +[link][url] + +![image][url] + +[url]: https://example.com +``` + +Setting the `collapsed` parameter to `false` disables collapsed reference links +and images: + +```markdown +[url][] + +![url][] + +[url]: https://example.com +``` + +Setting the `shortcut` parameter to `false` disables shortcut reference links +and images: + +```markdown +[url] + +![url] + +[url]: https://example.com +``` + +To fix violations of this rule, change the link or image to use an allowed +style. This rule can automatically fix violations when a link or image can be +converted to the `inline` style (preferred) or a link can be converted to the +`autolink` style (which does not support images and must be an absolute URL). +This rule does *not* fix scenarios that require converting a link or image to +the `full`, `collapsed`, or `shortcut` reference styles because that involves +naming the reference and determining where to insert it in the document. + +Setting the `url_inline` parameter to `false` prevents the use of inline links +with the same absolute URL text/destination and no title because such links can +be converted to autolinks: + +```markdown +[https://example.com](https://example.com) +``` + +To fix `url_inline` violations, use the simpler autolink syntax instead: + +```markdown + +``` + +Rationale: Consistent formatting makes it easier to understand a document. +Autolinks are concise, but appear as URLs which can be long and confusing. +Inline links and images can include descriptive text, but take up more space in +Markdown form. Reference links and images can be easier to read and manipulate +in Markdown form, but require a separate link reference definition. + + + +## `MD055` - Table pipe style + +Tags: `table` + +Aliases: `table-pipe-style` + +Parameters: + +- `style`: Table pipe style (`string`, default `consistent`, values + `consistent` / `leading_and_trailing` / `leading_only` / + `no_leading_or_trailing` / `trailing_only`) + +This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-055] +is inconsistent about its use of leading and trailing pipe characters (`|`). + +By default (`consistent` style), the header row of the first table in a document +is used to determine the style that is enforced for every table in the document. +A specific style can be used instead (`leading_and_trailing`, `leading_only`, +`no_leading_or_trailing`, `trailing_only`). + +This table's header row has leading and trailing pipes, but its delimiter row is +missing the trailing pipe and its first row of cells is missing the leading +pipe: + +```markdown +| Header | Header | +| ------ | ------ + Cell | Cell | +``` + +To fix these issues, make sure there is a pipe character at the beginning and +end of every row: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +``` + +Note that text immediately following a table (i.e., not separated by an empty +line) is treated as part of the table (per the specification) and may also +trigger this rule: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +This text is part of the table +``` + +Rationale: Some parsers have difficulty with tables that are missing their +leading or trailing pipe characters. The use of leading/trailing pipes can also +help provide visual clarity. + +[gfm-table-055]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables + + + +## `MD056` - Table column count + +Tags: `table` + +Aliases: `table-column-count` + +This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-056] +does not have the same number of cells in every row. + +This table's second data row has too few cells and its third data row has too +many cells: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +| Cell | +| Cell | Cell | Cell | +``` + +To fix these issues, ensure every row has the same number of cells: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +| Cell | Cell | +| Cell | Cell | +``` + +Note that a table's header row and its delimiter row must have the same number +of cells or it will not be recognized as a table (per specification). + +Rationale: Extra cells in a row are usually not shown, so their data is lost. +Missing cells in a row create holes in the table and suggest an omission. + +[gfm-table-056]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables + + + +## `MD058` - Tables should be surrounded by blank lines + +Tags: `table` + +Aliases: `blanks-around-tables` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when tables are either not preceded or not followed by a +blank line: + +```markdown +Some text +| Header | Header | +| ------ | ------ | +| Cell | Cell | +> Blockquote +``` + +To fix violations of this rule, ensure that all tables have a blank line both +before and after (except when the table is at the very beginning or end of the +document): + +```markdown +Some text + +| Header | Header | +| ------ | ------ | +| Cell | Cell | + +> Blockquote +``` + +Note that text immediately following a table (i.e., not separated by an empty +line) is treated as part of the table (per the specification) and will not +trigger this rule: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +This text is part of the table and the next line is blank + +Some text +``` + +Rationale: In addition to aesthetic reasons, some parsers will incorrectly parse +tables that don't have blank lines before and after them. + + + +## `MD059` - Link text should be descriptive + +Tags: `accessibility`, `links` + +Aliases: `descriptive-link-text` + +Parameters: + +- `prohibited_texts`: Prohibited link texts (`string[]`, default `["click + here","here","link","more"]`) + +This rule is triggered when a link has generic text like `[click here](...)` or +`[link](...)`. + +Link text should be descriptive and communicate the purpose of the link (e.g., +`[Download the budget document](...)` or `[CommonMark Specification](...)`). +This is especially important for screen readers which sometimes present links +without context. + +By default, this rule prohibits a small number of common English words/phrases. +To customize that list of words/phrases, set the `prohibited_texts` parameter to +an `Array` of `string`s. + +Note: For languages other than English, use the `prohibited_texts` parameter to +customize the list for that language. It is *not* a goal for this rule to have +translations for every language. + +Note: This rule checks Markdown links; HTML links are ignored. + +More information: + +- +- + + + +## `MD060` - Table column style + +Tags: `table` + +Aliases: `table-column-style` + +Parameters: + +- `aligned_delimiter`: Aligned delimiter columns (`boolean`, default `false`) +- `style`: Table column style (`string`, default `any`, values `aligned` / + `any` / `compact` / `tight`) + +This rule is triggered when the column separator pipe characters (`|`) of a +[GitHub Flavored Markdown table][gfm-table-060] are used inconsistently. + +This rule recognizes three table column styles based on popular use. + +Style `aligned` ensures pipe characters are vertically aligned: + +```markdown +| Character | Meaning | +| --------- | ------- | +| Y | Yes | +| N | No | +``` + +The `aligned` style ignores cell content, so the following is also valid: + +```markdown +| Character | Meaning | +|-----------|---------| +| Y | Yes | +| N | No | +``` + +Style `compact` avoids extra padding with a single space around cell content: + +```markdown +| Character | Meaning | +| --- | --- | +| Y | Yes | +| N | No | +``` + +Style `tight` uses no padding at all for cell content: + +```markdown +|Character|Meaning| +|---|---| +|Y|Yes| +|N|No| +``` + +When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`, +every table must match the corresponding pattern and any violations will be +reported. By default, or when the `any` style is used, each table is analyzed to +see if it satisfies any supported style. If so, no violations are reported. If +not, violations are be reported for whichever style would produce the *fewest* +issues (i.e., whichever style is the closest match). + +Setting the `aligned_delimiter` parameter to `true` requires pipe characters in +the delimiter row to align with those in the header row. This can be used with +`compact` and `tight` tables to make the header text more obvious. (It's already +required for tables with style `aligned`.) + +Style `compact` with `aligned_delimiter`: + +```markdown +| Character | Meaning | +| --------- | ------- | +| Y | Yes | +| N | No | +``` + +Style `tight` with `aligned_delimiter`: + +```markdown +|Character|Meaning| +|---------|-------| +|Y|Yes| +|N|No| +``` + +**Note**: This rule does not require leading/trailing pipe characters, so this +is also a valid table for style `compact`: + +```markdown +Character | Meaning +--- | --- +Y | Yes +N | No +``` + +**Note**: Pipe alignment for the `aligned` style is based on visual appearance +and not character count. Because editors typically render [emoji][emoji] and +[CJK characters][cjk-characters] at *twice* the width of +[Latin characters][latin-script], this rule takes that into account for tables +using the `aligned` style. The following table is correctly formatted and will +appear aligned in most editors and monospaced fonts: + + + + +```markdown +| Response | Emoji | +| -------- | ----- | +| Yes | ✅ | +| No | ❎ | +``` + + + +Rationale: Consistent formatting makes it easier to understand a document. + +[cjk-characters]: https://en.wikipedia.org/wiki/CJK_characters +[emoji]: https://en.wikipedia.org/wiki/Emoji +[gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables +[latin-script]: https://en.wikipedia.org/wiki/Latin_script + + diff --git a/doc/md001.md b/doc/md001.md new file mode 100644 index 00000000..e63ce1b5 --- /dev/null +++ b/doc/md001.md @@ -0,0 +1,51 @@ +# `MD001` - Heading levels should only increment by one level at a time + +Tags: `headings` + +Aliases: `heading-increment` + +Parameters: + +- `front_matter_title`: RegExp for matching title in front matter (`string`, + default `^\s*title\s*[:=]`) + +This rule is triggered when you skip heading levels in a Markdown document, for +example: + +```markdown +# Heading 1 + +### Heading 3 + +We skipped out a 2nd level heading in this document +``` + +When using multiple heading levels, nested headings should increase by only one +level at a time: + +```markdown +# Heading 1 + +## Heading 2 + +### Heading 3 + +#### Heading 4 + +## Another Heading 2 + +### Another Heading 3 +``` + +If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and +contains a `title` property (commonly used with blog posts), this rule treats +that as a top level heading and will report a violation if the actual first +heading is not a level 2 heading. To use a different property name in the +front matter, specify the text of a regular expression via the +`front_matter_title` parameter. To disable the use of front matter by this +rule, specify `""` for `front_matter_title`. When front matter is not present, +the first heading can be any level. + +Rationale: Headings represent the structure of a document and can be confusing +when skipped - especially for accessibility scenarios. More information: +. diff --git a/doc/md003.md b/doc/md003.md new file mode 100644 index 00000000..82da8775 --- /dev/null +++ b/doc/md003.md @@ -0,0 +1,59 @@ +# `MD003` - Heading style + +Tags: `headings` + +Aliases: `heading-style` + +Parameters: + +- `style`: Heading style (`string`, default `consistent`, values `atx` / + `atx_closed` / `consistent` / `setext` / `setext_with_atx` / + `setext_with_atx_closed`) + +This rule is triggered when different heading styles are used in the same +document: + +```markdown +# ATX style H1 + +## Closed ATX style H2 ## + +Setext style H1 +=============== +``` + +To fix the issue, use consistent heading styles throughout the document: + +```markdown +# ATX style H1 + +## ATX style H2 +``` + +The `setext_with_atx` and `setext_with_atx_closed` settings allow ATX-style +headings of level 3 or more in documents with setext-style headings (which only +support level 1 and 2 headings): + +```markdown +Setext style H1 +=============== + +Setext style H2 +--------------- + +### ATX style H3 +``` + +Note: The configured heading style can be a specific style to require (`atx`, +`atx_closed`, `setext`, `setext_with_atx`, `setext_with_atx_closed`), or can +require that all heading styles match the first heading style via `consistent`. + +Note: The placement of a horizontal rule directly below a line of text can +trigger this rule by turning that text into a level 2 setext-style heading: + +```markdown +A line of text followed by a horizontal rule becomes a heading +--- +``` + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md004.md b/doc/md004.md new file mode 100644 index 00000000..fa1576b5 --- /dev/null +++ b/doc/md004.md @@ -0,0 +1,50 @@ +# `MD004` - Unordered list style + +Tags: `bullet`, `ul` + +Aliases: `ul-style` + +Parameters: + +- `style`: List style (`string`, default `consistent`, values `asterisk` / + `consistent` / `dash` / `plus` / `sublist`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when the symbols used in the document for unordered +list items do not match the configured unordered list style: + +```markdown +* Item 1 ++ Item 2 +- Item 3 +``` + +To fix this issue, use the configured style for list items throughout the +document: + +```markdown +* Item 1 +* Item 2 +* Item 3 +``` + +The configured list style can ensure all list styling is a specific symbol +(`asterisk`, `plus`, `dash`), ensure each sublist has a consistent symbol that +differs from its parent list (`sublist`), or ensure all list styles match the +first list style (`consistent`). + +For example, the following is valid for the `sublist` style because the +outer-most indent uses asterisk, the middle indent uses plus, and the inner-most +indent uses dash: + +```markdown +* Item 1 + + Item 2 + - Item 3 + + Item 4 +* Item 4 + + Item 5 +``` + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md005.md b/doc/md005.md new file mode 100644 index 00000000..375b6438 --- /dev/null +++ b/doc/md005.md @@ -0,0 +1,53 @@ +# `MD005` - Inconsistent indentation for list items at the same level + +Tags: `bullet`, `indentation`, `ul` + +Aliases: `list-indent` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when list items are parsed as being at the same level, +but don't have the same indentation: + +```markdown +* Item 1 + * Nested Item 1 + * Nested Item 2 + * A misaligned item +``` + +Usually, this rule will be triggered because of a typo. Correct the indentation +for the list to fix it: + +```markdown +* Item 1 + * Nested Item 1 + * Nested Item 2 + * Nested Item 3 +``` + +Sequentially-ordered list markers are usually left-aligned such that all items +have the same starting column: + +```markdown +... +8. Item +9. Item +10. Item +11. Item +... +``` + +This rule also supports right-alignment of list markers such that all items have +the same ending column: + +```markdown +... + 8. Item + 9. Item +10. Item +11. Item +... +``` + +Rationale: Violations of this rule can lead to improperly rendered content. diff --git a/doc/md007.md b/doc/md007.md new file mode 100644 index 00000000..7dd7ed71 --- /dev/null +++ b/doc/md007.md @@ -0,0 +1,52 @@ +# `MD007` - Unordered list indentation + +Tags: `bullet`, `indentation`, `ul` + +Aliases: `ul-indent` + +Parameters: + +- `indent`: Spaces for indent (`integer`, default `2`) +- `start_indent`: Spaces for first level indent (when start_indented is set) + (`integer`, default `2`) +- `start_indented`: Whether to indent the first level of the list (`boolean`, + default `false`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when list items are not indented by the configured +number of spaces (default: 2). + +Example: + +```markdown +* List item + * Nested list item indented by 3 spaces +``` + +Corrected Example: + +```markdown +* List item + * Nested list item indented by 2 spaces +``` + +Note: This rule applies to a sublist only if its parent lists are all also +unordered (otherwise, extra indentation of ordered lists interferes with the +rule). + +The `start_indented` parameter allows the first level of lists to be indented by +the configured number of spaces rather than starting at zero. The `start_indent` +parameter allows the first level of lists to be indented by a different number +of spaces than the rest (ignored when `start_indented` is not set). + +Rationale: Indenting by 2 spaces allows the content of a nested list to be in +line with the start of the content of the parent list when a single space is +used after the list marker. Indenting by 4 spaces is consistent with code blocks +and simpler for editors to implement. Additionally, this can be a compatibility +issue for other Markdown parsers, which require 4-space indents. More +information: [Markdown Style Guide][markdown-style-guide]. + +Note: See [Prettier.md](Prettier.md) for compatibility information. + +[markdown-style-guide]: https://cirosantilli.com/markdown-style-guide#indentation-of-content-inside-lists diff --git a/doc/md009.md b/doc/md009.md new file mode 100644 index 00000000..115a2e88 --- /dev/null +++ b/doc/md009.md @@ -0,0 +1,50 @@ +# `MD009` - Trailing spaces + +Tags: `whitespace` + +Aliases: `no-trailing-spaces` + +Parameters: + +- `br_spaces`: Spaces for line break (`integer`, default `2`) +- `code_blocks`: Include code blocks (`boolean`, default `false`) +- `list_item_empty_lines`: Allow spaces for empty lines in list items + (`boolean`, default `false`) +- `strict`: Include unnecessary breaks (`boolean`, default `false`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered on any lines that end with unexpected whitespace. To fix +this, remove the trailing space from the end of the line. + +The `br_spaces` parameter allows an exception to this rule for a specific number +of trailing spaces, typically used to insert an explicit line break. The default +value allows 2 spaces to indicate a hard break (\
element). (You must set +`br_spaces` to a value >= 2 for this parameter to take effect. Setting +`br_spaces` to 1 behaves the same as 0, disallowing any trailing spaces.) + +By default, trailing space is allowed in indented and fenced code blocks because +some programming languages require that. To report such instances, set the +`code_blocks` parameter to `true`. + +By default, this rule will not trigger when the allowed number of spaces is +used, even when it doesn't create a hard break (for example, at the end of a +paragraph). To report such instances, set the `strict` parameter to `true`. + +```markdown +Text text text +text[2 spaces] +``` + +Using spaces to indent blank lines inside a list item is usually not necessary, +but some parsers require it. Set the `list_item_empty_lines` parameter to `true` +to allow this (even when `strict` is `true`): + +```markdown +- list item text + [2 spaces] + list item text +``` + +Rationale: Except when being used to create a line break, trailing whitespace +has no purpose and does not affect the rendering of content. diff --git a/doc/md010.md b/doc/md010.md new file mode 100644 index 00000000..e1b23e74 --- /dev/null +++ b/doc/md010.md @@ -0,0 +1,62 @@ +# `MD010` - Hard tabs + +Tags: `hard_tab`, `whitespace` + +Aliases: `no-hard-tabs` + +Parameters: + +- `code_blocks`: Include code blocks (`boolean`, default `true`) +- `ignore_code_languages`: Fenced code languages to ignore (`string[]`, default + `[]`) +- `spaces_per_tab`: Number of spaces for each hard tab (`integer`, default `1`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered by any lines that contain hard tab characters instead +of using spaces for indentation. To fix this, replace any hard tab characters +with spaces instead. + +Example: + + + +```markdown +Some text + + * hard tab character used to indent the list item +``` + + + +Corrected example: + +```markdown +Some text + + * Spaces used to indent the list item instead +``` + +You have the option to exclude this rule for code blocks and spans. To do so, +set the `code_blocks` parameter to `false`. Code blocks and spans are included +by default since handling of tabs by Markdown tools can be inconsistent (e.g., +using 4 vs. 8 spaces). + +When code blocks are scanned (e.g., by default or if `code_blocks` is `true`), +the `ignore_code_languages` parameter can be set to a list of languages that +should be ignored (i.e., hard tabs will be allowed, though not required). This +makes it easier for documents to include code for languages that require hard +tabs. + +By default, violations of this rule are fixed by replacing the tab with 1 space +character. To use a different number of spaces, set the `spaces_per_tab` +parameter to the desired value. + +Rationale: Hard tabs are often rendered inconsistently by different editors and +can be harder to work with than spaces. + +More information: + +- +- +- diff --git a/doc/md011.md b/doc/md011.md new file mode 100644 index 00000000..d574b34a --- /dev/null +++ b/doc/md011.md @@ -0,0 +1,30 @@ +# `MD011` - Reversed link syntax + +Tags: `links` + +Aliases: `no-reversed-links` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when text that appears to be a link is encountered, but +where the syntax appears to have been reversed (the `[]` and `()` are +reversed): + +```markdown +(Incorrect link syntax)[https://www.example.com/] +``` + +To fix this, swap the `[]` and `()` around: + +```markdown +[Correct link syntax](https://www.example.com/) +``` + +Note: [Markdown Extra](https://en.wikipedia.org/wiki/Markdown_Extra)-style +footnotes do not trigger this rule: + +```markdown +For (example)[^1] +``` + +Rationale: Reversed links are not rendered as usable links. diff --git a/doc/md012.md b/doc/md012.md new file mode 100644 index 00000000..438c9fa6 --- /dev/null +++ b/doc/md012.md @@ -0,0 +1,38 @@ +# `MD012` - Multiple consecutive blank lines + +Tags: `blank_lines`, `whitespace` + +Aliases: `no-multiple-blanks` + +Parameters: + +- `maximum`: Consecutive blank lines (`integer`, default `1`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when there are multiple consecutive blank lines in the +document: + +```markdown +Some text here + + +Some more text here +``` + +To fix this, delete the offending lines: + +```markdown +Some text here + +Some more text here +``` + +Note: this rule will not be triggered if there are multiple consecutive blank +lines inside code blocks. + +Note: The `maximum` parameter can be used to configure the maximum number of +consecutive blank lines. + +Rationale: Except in a code block, blank lines serve no purpose and do not +affect the rendering of content. diff --git a/doc/md013.md b/doc/md013.md new file mode 100644 index 00000000..e4ac8ac1 --- /dev/null +++ b/doc/md013.md @@ -0,0 +1,58 @@ +# `MD013` - Line length + +Tags: `line_length` + +Aliases: `line-length` + +Parameters: + +- `code_block_line_length`: Number of characters for code blocks (`integer`, + default `80`) +- `code_blocks`: Include code blocks (`boolean`, default `true`) +- `heading_line_length`: Number of characters for headings (`integer`, default + `80`) +- `headings`: Include headings (`boolean`, default `true`) +- `line_length`: Number of characters (`integer`, default `80`) +- `stern`: Stern length checking (`boolean`, default `false`) +- `strict`: Strict length checking (`boolean`, default `false`) +- `tables`: Include tables (`boolean`, default `true`) + +This rule is triggered when there are lines that are longer than the +configured `line_length` (default: 80 characters). To fix this, split the line +up into multiple lines. To set a different maximum length for headings, use +`heading_line_length`. To set a different maximum length for code blocks, use +`code_block_line_length` + +This rule has an exception when there is no whitespace beyond the configured +line length. This allows you to include items such as long URLs without being +forced to break them in the middle. To disable this exception, set the `strict` +parameter to `true` and an issue will be reported when any line is too long. To +warn for lines that are too long and could be fixed but allow long lines +without spaces, set the `stern` parameter to `true`. + +For example (assuming normal behavior): + +```markdown +IF THIS LINE IS THE MAXIMUM LENGTH +This line is okay because there are-no-spaces-beyond-that-length +This line is a violation because there are spaces beyond that length +This-line-is-okay-because-there-are-no-spaces-anywhere-within +``` + +In `strict` mode, the last three lines above are all violations. In `stern` +mode, the middle two lines above are both violations, but the last is okay. + +You have the option to exclude this rule for code blocks, tables, or headings. +To do so, set the `code_blocks`, `tables`, or `headings` parameter(s) to false. + +Code blocks are included in this rule by default since it is often a +requirement for document readability, and tentatively compatible with code +rules. Still, some languages do not lend themselves to short lines. + +Lines with link/image reference definitions and standalone lines (i.e., not part +of a paragraph) with only a link/image (possibly using (strong) emphasis) are +always exempted from this rule (even in `strict` mode) because there is often no +way to split such lines without breaking the URL. + +Rationale: Extremely long lines can be difficult to work with in some editors. +More information: . diff --git a/doc/md014.md b/doc/md014.md new file mode 100644 index 00000000..0786dfa3 --- /dev/null +++ b/doc/md014.md @@ -0,0 +1,54 @@ +# `MD014` - Dollar signs used before commands without showing output + +Tags: `code` + +Aliases: `commands-show-output` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when there are code blocks showing shell commands to be +typed, and *all* of the shell commands are preceded by dollar signs ($): + + + +```markdown +$ ls +$ cat foo +$ less bar +``` + + + +The dollar signs are unnecessary in this situation, and should not be +included: + +```markdown +ls +cat foo +less bar +``` + +Showing output for commands preceded by dollar signs does not trigger this rule: + +```markdown +$ ls +foo bar +$ cat foo +Hello world +$ cat bar +baz +``` + +Because some commands do not produce output, it is not a violation if *some* +commands do not have output: + +```markdown +$ mkdir test +mkdir: created directory 'test' +$ ls test +``` + +Rationale: It is easier to copy/paste and less noisy if the dollar signs +are omitted when they are not needed. See + +for more information. diff --git a/doc/md018.md b/doc/md018.md new file mode 100644 index 00000000..870297a8 --- /dev/null +++ b/doc/md018.md @@ -0,0 +1,27 @@ +# `MD018` - No space after hash on atx style heading + +Tags: `atx`, `headings`, `spaces` + +Aliases: `no-missing-space-atx` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when spaces are missing after the hash characters +in an atx style heading: + +```markdown +#Heading 1 + +##Heading 2 +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 + +## Heading 2 +``` + +Rationale: Violations of this rule can lead to improperly rendered content. diff --git a/doc/md019.md b/doc/md019.md new file mode 100644 index 00000000..4bcb44f6 --- /dev/null +++ b/doc/md019.md @@ -0,0 +1,28 @@ +# `MD019` - Multiple spaces after hash on atx style heading + +Tags: `atx`, `headings`, `spaces` + +Aliases: `no-multiple-space-atx` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when more than one space is used to separate the +heading text from the hash characters in an atx style heading: + +```markdown +# Heading 1 + +## Heading 2 +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 + +## Heading 2 +``` + +Rationale: Extra space has no purpose and does not affect the rendering of +content. diff --git a/doc/md020.md b/doc/md020.md new file mode 100644 index 00000000..f711b260 --- /dev/null +++ b/doc/md020.md @@ -0,0 +1,29 @@ +# `MD020` - No space inside hashes on closed atx style heading + +Tags: `atx_closed`, `headings`, `spaces` + +Aliases: `no-missing-space-closed-atx` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when spaces are missing inside the hash characters +in a closed atx style heading: + +```markdown +#Heading 1# + +##Heading 2## +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 # + +## Heading 2 ## +``` + +Note: this rule will fire if either side of the heading is missing spaces. + +Rationale: Violations of this rule can lead to improperly rendered content. diff --git a/doc/md021.md b/doc/md021.md new file mode 100644 index 00000000..5aa99a61 --- /dev/null +++ b/doc/md021.md @@ -0,0 +1,31 @@ +# `MD021` - Multiple spaces inside hashes on closed atx style heading + +Tags: `atx_closed`, `headings`, `spaces` + +Aliases: `no-multiple-space-closed-atx` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when more than one space is used to separate the +heading text from the hash characters in a closed atx style heading: + +```markdown +# Heading 1 # + +## Heading 2 ## +``` + +To fix this, separate the heading text from the hash character by a single +space: + +```markdown +# Heading 1 # + +## Heading 2 ## +``` + +Note: this rule will fire if either side of the heading contains multiple +spaces. + +Rationale: Extra space has no purpose and does not affect the rendering of +content. diff --git a/doc/md022.md b/doc/md022.md new file mode 100644 index 00000000..c05edcc0 --- /dev/null +++ b/doc/md022.md @@ -0,0 +1,52 @@ +# `MD022` - Headings should be surrounded by blank lines + +Tags: `blank_lines`, `headings` + +Aliases: `blanks-around-headings` + +Parameters: + +- `lines_above`: Blank lines above heading (`integer|integer[]`, default `1`) +- `lines_below`: Blank lines below heading (`integer|integer[]`, default `1`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when headings (any style) are either not preceded or not +followed by at least one blank line: + +```markdown +# Heading 1 +Some text + +Some more text +## Heading 2 +``` + +To fix this, ensure that all headings have a blank line both before and after +(except where the heading is at the beginning or end of the document): + +```markdown +# Heading 1 + +Some text + +Some more text + +## Heading 2 +``` + +The `lines_above` and `lines_below` parameters can be used to specify a +different number of blank lines (including `0`) above or below each heading. +If the value `-1` is used for either parameter, any number of blank lines is +allowed. To customize the number of lines above or below each heading level +individually, specify a `number[]` where values correspond to heading levels +1-6 (in order). + +Notes: If `lines_above` or `lines_below` are configured to require more than one +blank line, [MD012/no-multiple-blanks](md012.md) should also be customized. This +rule checks for *at least* as many blank lines as specified; any extra blank +lines are ignored. + +Rationale: Aside from aesthetic reasons, some parsers, including `kramdown`, +will not parse headings that don't have a blank line before, and will parse them +as regular text. diff --git a/doc/md023.md b/doc/md023.md new file mode 100644 index 00000000..1644451b --- /dev/null +++ b/doc/md023.md @@ -0,0 +1,33 @@ +# `MD023` - Headings must start at the beginning of the line + +Tags: `headings`, `spaces` + +Aliases: `heading-start-left` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when a heading is indented by one or more spaces: + +```markdown +Some text + + # Indented heading +``` + +To fix this, ensure that all headings start at the beginning of the line: + +```markdown +Some text + +# Heading +``` + +Note that scenarios like block quotes "indent" the start of the line, so the +following is also correct: + +```markdown +> # Heading in Block Quote +``` + +Rationale: Headings that don't start at the beginning of the line will not be +parsed as headings, and will instead appear as regular text. diff --git a/doc/md024.md b/doc/md024.md new file mode 100644 index 00000000..5c26c712 --- /dev/null +++ b/doc/md024.md @@ -0,0 +1,44 @@ +# `MD024` - Multiple headings with the same content + +Tags: `headings` + +Aliases: `no-duplicate-heading` + +Parameters: + +- `siblings_only`: Only check sibling headings (`boolean`, default `false`) + +This rule is triggered if there are multiple headings in the document that have +the same text: + +```markdown +# Some text + +## Some text +``` + +To fix this, ensure that the content of each heading is different: + +```markdown +# Some text + +## Some more text +``` + +If the parameter `siblings_only` is set to `true`, duplication is allowed for +headings with different parents (as is common in changelogs): + +```markdown +# Change log + +## 1.0.0 + +### Features + +## 2.0.0 + +### Features +``` + +Rationale: Some Markdown parsers generate anchors for headings based on the +heading name; headings with the same content can cause problems with that. diff --git a/doc/md025.md b/doc/md025.md new file mode 100644 index 00000000..7c764b33 --- /dev/null +++ b/doc/md025.md @@ -0,0 +1,49 @@ +# `MD025` - Multiple top-level headings in the same document + +Tags: `headings` + +Aliases: `single-h1`, `single-title` + +Parameters: + +- `front_matter_title`: RegExp for matching title in front matter (`string`, + default `^\s*title\s*[:=]`) +- `level`: Heading level (`integer`, default `1`) + +This rule is triggered when a top-level heading is in use (the first line of +the file is an h1 heading), and more than one h1 heading is in use in the +document: + +```markdown +# Top level heading + +# Another top-level heading +``` + +To fix, structure your document so there is a single h1 heading that is +the title for the document. Subsequent headings must be +lower-level headings (h2, h3, etc.): + +```markdown +# Title + +## Heading + +## Another heading +``` + +Note: The `level` parameter can be used to change the top-level (ex: to h2) in +cases where an h1 is added externally. + +If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and +contains a `title` property (commonly used with blog posts), this rule treats +that as a top level heading and will report a violation for any subsequent +top-level headings. To use a different property name in the front matter, +specify the text of a regular expression via the `front_matter_title` parameter. +To disable the use of front matter by this rule, specify `""` for +`front_matter_title`. + +Rationale: A top-level heading is an h1 on the first line of the file, and +serves as the title for the document. If this convention is in use, then there +can not be more than one title for the document, and the entire document should +be contained within this heading. diff --git a/doc/md026.md b/doc/md026.md new file mode 100644 index 00000000..cf7161cd --- /dev/null +++ b/doc/md026.md @@ -0,0 +1,40 @@ +# `MD026` - Trailing punctuation in heading + +Tags: `headings` + +Aliases: `no-trailing-punctuation` + +Parameters: + +- `punctuation`: Punctuation characters (`string`, default `.,;:!。,;:!`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered on any heading that has one of the specified normal or +full-width punctuation characters as the last character in the line: + +```markdown +# This is a heading. +``` + +To fix this, remove the trailing punctuation: + +```markdown +# This is a heading +``` + +Note: The `punctuation` parameter can be used to specify what characters count +as punctuation at the end of a heading. For example, you can change it to +`".,;:"` to allow headings that end with an exclamation point. `?` is +allowed by default because of how common it is in headings of FAQ-style +documents. Setting the `punctuation` parameter to `""` allows all characters - +and is equivalent to disabling the rule. + +Note: The trailing semicolon of [HTML entity references][html-entity-references] +like `©`, `©`, and `©` is ignored by this rule. + +Rationale: Headings are not meant to be full sentences. More information: +[Punctuation at the end of headers][end-punctuation]. + +[end-punctuation]: https://cirosantilli.com/markdown-style-guide#punctuation-at-the-end-of-headers +[html-entity-references]: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references diff --git a/doc/md027.md b/doc/md027.md new file mode 100644 index 00000000..ac4dfdf8 --- /dev/null +++ b/doc/md027.md @@ -0,0 +1,32 @@ +# `MD027` - Multiple spaces after blockquote symbol + +Tags: `blockquote`, `indentation`, `whitespace` + +Aliases: `no-multiple-space-blockquote` + +Parameters: + +- `list_items`: Include list items (`boolean`, default `true`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when blockquotes have more than one space after the +blockquote (`>`) symbol: + +```markdown +> This is a blockquote with bad indentation +> there should only be one. +``` + +To fix, remove any extraneous space: + +```markdown +> This is a blockquote with correct +> indentation. +``` + +Inferring intended list indentation within a blockquote can be challenging; +setting the `list_items` parameter to `false` disables this rule for ordered +and unordered list items. + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md028.md b/doc/md028.md new file mode 100644 index 00000000..94972ed2 --- /dev/null +++ b/doc/md028.md @@ -0,0 +1,40 @@ +# `MD028` - Blank line inside blockquote + +Tags: `blockquote`, `whitespace` + +Aliases: `no-blanks-blockquote` + +This rule is triggered when two blockquote blocks are separated by nothing +except for a blank line: + +```markdown +> This is a blockquote +> which is immediately followed by + +> this blockquote. Unfortunately +> In some parsers, these are treated as the same blockquote. +``` + +To fix this, ensure that any blockquotes that are right next to each other +have some text in between: + +```markdown +> This is a blockquote. + +And Jimmy also said: + +> This too is a blockquote. +``` + +Alternatively, if they are supposed to be the same quote, then add the +blockquote symbol at the beginning of the blank line: + +```markdown +> This is a blockquote. +> +> This is the same blockquote. +``` + +Rationale: Some Markdown parsers will treat two blockquotes separated by one +or more blank lines as the same blockquote, while others will treat them as +separate blockquotes. diff --git a/doc/md029.md b/doc/md029.md new file mode 100644 index 00000000..8c3c5d32 --- /dev/null +++ b/doc/md029.md @@ -0,0 +1,100 @@ +# `MD029` - Ordered list item prefix + +Tags: `ol` + +Aliases: `ol-prefix` + +Parameters: + +- `style`: List style (`string`, default `one_or_ordered`, values `one` / + `one_or_ordered` / `ordered` / `zero`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered for ordered lists that do not either start with '1.' or +do not have a prefix that increases in numerical order (depending on the +configured style). The less-common pattern of using '0.' as a first prefix or +for all prefixes is also supported. + +Example valid list if the style is configured as 'one': + +```markdown +1. Do this. +1. Do that. +1. Done. +``` + +Examples of valid lists if the style is configured as 'ordered': + +```markdown +1. Do this. +2. Do that. +3. Done. +``` + +```markdown +0. Do this. +1. Do that. +2. Done. +``` + +All three examples are valid when the style is configured as 'one_or_ordered'. + +Example valid list if the style is configured as 'zero': + +```markdown +0. Do this. +0. Do that. +0. Done. +``` + +Example invalid list for all styles: + +```markdown +1. Do this. +3. Done. +``` + +This rule supports 0-prefixing ordered list items for uniform indentation: + +```markdown +... +08. Item +09. Item +10. Item +11. Item +... +``` + +Note: This rule will report violations for cases like the following where an +improperly-indented code block (or similar) appears between two list items and +"breaks" the list in two: + + + +~~~markdown +1. First list + +```text +Code block +``` + +1. Second list +~~~ + +The fix is to indent the code block so it becomes part of the preceding list +item as intended: + +~~~markdown +1. First list + + ```text + Code block + ``` + +2. Still first list +~~~ + + + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md030.md b/doc/md030.md new file mode 100644 index 00000000..59454d29 --- /dev/null +++ b/doc/md030.md @@ -0,0 +1,82 @@ +# `MD030` - Spaces after list markers + +Tags: `ol`, `ul`, `whitespace` + +Aliases: `list-marker-space` + +Parameters: + +- `ol_multi`: Spaces for multi-line ordered list items (`integer`, default `1`) +- `ol_single`: Spaces for single-line ordered list items (`integer`, default + `1`) +- `ul_multi`: Spaces for multi-line unordered list items (`integer`, default + `1`) +- `ul_single`: Spaces for single-line unordered list items (`integer`, default + `1`) + +Fixable: Some violations can be fixed by tooling + +This rule checks for the number of spaces between a list marker (e.g. '`-`', +'`*`', '`+`' or '`1.`') and the text of the list item. + +The number of spaces checked for depends on the document style in use, but the +default is 1 space after any list marker: + +```markdown +* Foo +* Bar +* Baz + +1. Foo +1. Bar +1. Baz + +1. Foo + * Bar +1. Baz +``` + +A document style may change the number of spaces after unordered list items +and ordered list items independently, as well as based on whether the content +of every item in the list consists of a single paragraph or multiple +paragraphs (including sub-lists and code blocks). + +For example, the style guide at + +specifies that 1 space after the list marker should be used if every item in +the list fits within a single paragraph, but to use 2 or 3 spaces (for ordered +and unordered lists respectively) if there are multiple paragraphs of content +inside the list: + +```markdown +* Foo +* Bar +* Baz +``` + +vs. + +```markdown +* Foo + + Second paragraph + +* Bar +``` + +or + +```markdown +1. Foo + + Second paragraph + +1. Bar +``` + +To fix this, ensure the correct number of spaces are used after the list marker +for your selected document style. + +Rationale: Violations of this rule can lead to improperly rendered content. + +Note: See [Prettier.md](Prettier.md) for compatibility information. diff --git a/doc/md031.md b/doc/md031.md new file mode 100644 index 00000000..9663e5da --- /dev/null +++ b/doc/md031.md @@ -0,0 +1,50 @@ +# `MD031` - Fenced code blocks should be surrounded by blank lines + +Tags: `blank_lines`, `code` + +Aliases: `blanks-around-fences` + +Parameters: + +- `list_items`: Include list items (`boolean`, default `true`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when fenced code blocks are either not preceded or not +followed by a blank line: + +````markdown +Some text +``` +Code block +``` + +``` +Another code block +``` +Some more text +```` + +To fix this, ensure that all fenced code blocks have a blank line both before +and after (except where the block is at the beginning or end of the document): + +````markdown +Some text + +``` +Code block +``` + +``` +Another code block +``` + +Some more text +```` + +Set the `list_items` parameter to `false` to disable this rule for list items. +Disabling this behavior for lists can be useful if it is necessary to create a +[tight](https://spec.commonmark.org/0.29/#tight) list containing a code fence. + +Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will +not parse fenced code blocks that don't have blank lines before and after them. diff --git a/doc/md032.md b/doc/md032.md new file mode 100644 index 00000000..41c8b411 --- /dev/null +++ b/doc/md032.md @@ -0,0 +1,55 @@ +# `MD032` - Lists should be surrounded by blank lines + +Tags: `blank_lines`, `bullet`, `ol`, `ul` + +Aliases: `blanks-around-lists` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when lists (of any kind) are either not preceded or not +followed by a blank line: + +```markdown +Some text +* List item +* List item + +1. List item +2. List item +*** +``` + +In the first case above, text immediately precedes the unordered list. In the +second case above, a thematic break immediately follows the ordered list. To fix +violations of this rule, ensure that all lists have a blank line both before and +after (except when the list is at the very beginning or end of the document): + +```markdown +Some text + +* List item +* List item + +1. List item +2. List item + +*** +``` + +Note that the following case is **not** a violation of this rule: + +```markdown +1. List item + More item 1 +2. List item +More item 2 +``` + +Although it is not indented, the text "More item 2" is referred to as a +[lazy continuation line][lazy-continuation] and considered part of the second +list item. + +Rationale: In addition to aesthetic reasons, some parsers, including kramdown, +will not parse lists that don't have blank lines before and after them. + +[lazy-continuation]: https://spec.commonmark.org/0.30/#lazy-continuation-line diff --git a/doc/md033.md b/doc/md033.md new file mode 100644 index 00000000..e90fdb73 --- /dev/null +++ b/doc/md033.md @@ -0,0 +1,33 @@ +# `MD033` - Inline HTML + +Tags: `html` + +Aliases: `no-inline-html` + +Parameters: + +- `allowed_elements`: Allowed elements (`string[]`, default `[]`) +- `table_allowed_elements`: Allowed elements in tables (`string[]`, default + `[]`) + +This rule is triggered whenever raw HTML is used in a Markdown document: + +```markdown +

Inline HTML heading

+``` + +To fix this, use 'pure' Markdown instead of including raw HTML: + +```markdown +# Markdown heading +``` + +To allow specific HTML elements anywhere in Markdown content, set the +`allowed_elements` parameter to a list of HTML element names. To allow a +specific set of HTML elements within Markdown tables, set the +`table_allowed_elements` parameter to a list of HTML element names. This can be +used to permit the use of `
`-style line breaks only within Markdown tables. + +Rationale: Raw HTML is allowed in Markdown, but this rule is included for +those who want their documents to only include "pure" Markdown, or for those +who are rendering Markdown documents into something other than HTML. diff --git a/doc/md034.md b/doc/md034.md new file mode 100644 index 00000000..dc9c3cf6 --- /dev/null +++ b/doc/md034.md @@ -0,0 +1,55 @@ +# `MD034` - Bare URL used + +Tags: `links`, `url` + +Aliases: `no-bare-urls` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered whenever a URL or email address appears without +surrounding angle brackets: + +```markdown +For more info, visit https://www.example.com/ or email user@example.com. +``` + +To fix this, add angle brackets around the URL or email address: + +```markdown +For more info, visit or email . +``` + +If a URL or email address contains non-ASCII characters, it may be not be +handled as intended even when angle brackets are present. In such cases, +[percent-encoding](https://en.m.wikipedia.org/wiki/Percent-encoding) can be used +to comply with the required syntax for URL and email. + +Note: To include a bare URL or email without it being converted into a link, +wrap it in a code span: + +```markdown +Not a clickable link: `https://www.example.com` +``` + +Note: The following scenario does not trigger this rule because it could be a +shortcut link: + +```markdown +[https://www.example.com] +``` + +Note: The following syntax triggers this rule because the nested link could be +a shortcut link (which takes precedence): + +```markdown +[text [shortcut] text](https://example.com) +``` + +To avoid this, escape both inner brackets: + +```markdown +[link \[text\] link](https://example.com) +``` + +Rationale: Without angle brackets, a bare URL or email isn't converted into a +link by some Markdown parsers. diff --git a/doc/md035.md b/doc/md035.md new file mode 100644 index 00000000..ee74516c --- /dev/null +++ b/doc/md035.md @@ -0,0 +1,37 @@ +# `MD035` - Horizontal rule style + +Tags: `hr` + +Aliases: `hr-style` + +Parameters: + +- `style`: Horizontal rule style (`string`, default `consistent`) + +This rule is triggered when inconsistent styles of horizontal rules are used +in the document: + +```markdown +--- + +- - - + +*** + +* * * + +**** +``` + +To fix this, use the same horizontal rule everywhere: + +```markdown +--- + +--- +``` + +The configured style can ensure all horizontal rules use a specific string or it +can ensure all horizontal rules match the first horizontal rule (`consistent`). + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md036.md b/doc/md036.md new file mode 100644 index 00000000..1518904f --- /dev/null +++ b/doc/md036.md @@ -0,0 +1,45 @@ +# `MD036` - Emphasis used instead of a heading + +Tags: `emphasis`, `headings` + +Aliases: `no-emphasis-as-heading` + +Parameters: + +- `punctuation`: Punctuation characters (`string`, default `.,;:!?。,;:!?`) + +This check looks for instances where emphasized (i.e. bold or italic) text is +used to separate sections, where a heading should be used instead: + +```markdown +**My document** + +Lorem ipsum dolor sit amet... + +_Another section_ + +Consectetur adipiscing elit, sed do eiusmod. +``` + +To fix this, use Markdown headings instead of emphasized text to denote +sections: + +```markdown +# My document + +Lorem ipsum dolor sit amet... + +## Another section + +Consectetur adipiscing elit, sed do eiusmod. +``` + +Note: This rule looks for single-line paragraphs that consist entirely +of emphasized text. It won't fire on emphasis used within regular text, +multi-line emphasized paragraphs, or paragraphs ending in punctuation +(normal or full-width). Similarly to rule MD026, you can configure what +characters are recognized as punctuation. + +Rationale: Using emphasis instead of a heading prevents tools from inferring +the structure of a document. More information: +. diff --git a/doc/md037.md b/doc/md037.md new file mode 100644 index 00000000..c96ba3ca --- /dev/null +++ b/doc/md037.md @@ -0,0 +1,37 @@ +# `MD037` - Spaces inside emphasis markers + +Tags: `emphasis`, `whitespace` + +Aliases: `no-space-in-emphasis` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when emphasis markers (bold, italic) are used, but they +have spaces between the markers and the text: + +```markdown +Here is some ** bold ** text. + +Here is some * italic * text. + +Here is some more __ bold __ text. + +Here is some more _ italic _ text. +``` + +To fix this, remove the spaces around the emphasis markers: + +```markdown +Here is some **bold** text. + +Here is some *italic* text. + +Here is some more __bold__ text. + +Here is some more _italic_ text. +``` + +Rationale: Emphasis is only parsed as such when the asterisks/underscores +aren't surrounded by spaces. This rule attempts to detect where +they were surrounded by spaces, but it appears that emphasized text was +intended by the author. diff --git a/doc/md038.md b/doc/md038.md new file mode 100644 index 00000000..c4631eca --- /dev/null +++ b/doc/md038.md @@ -0,0 +1,52 @@ +# `MD038` - Spaces inside code span elements + +Tags: `code`, `whitespace` + +Aliases: `no-space-in-code` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered for code spans containing content with unnecessary space +next to the beginning or ending backticks: + +```markdown +`some text ` + +` some text` + +` some text ` +``` + +To fix this, remove the extra space characters from the beginning and ending: + +```markdown +`some text` +``` + +Note: A single leading *and* trailing space is allowed by the specification and +trimmed by the parser to support code spans that begin or end with a backtick: + +```markdown +`` `backticks` `` + +`` backtick` `` +``` + +Note: When single-space padding is present in the input, it will be preserved +(even if unnecessary): + +```markdown +` code ` +``` + +Note: Code spans containing only spaces are allowed by the specification and are +also preserved: + +```markdown +` ` + +` ` +``` + +Rationale: Violations of this rule are usually unintentional and can lead to +improperly-rendered content. diff --git a/doc/md039.md b/doc/md039.md new file mode 100644 index 00000000..8e854cde --- /dev/null +++ b/doc/md039.md @@ -0,0 +1,21 @@ +# `MD039` - Spaces inside link text + +Tags: `links`, `whitespace` + +Aliases: `no-space-in-links` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered on links that have spaces surrounding the link text: + +```markdown +[ a link ](https://www.example.com/) +``` + +To fix this, remove the spaces surrounding the link text: + +```markdown +[a link](https://www.example.com/) +``` + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md040.md b/doc/md040.md new file mode 100644 index 00000000..5272fc09 --- /dev/null +++ b/doc/md040.md @@ -0,0 +1,52 @@ +# `MD040` - Fenced code blocks should have a language specified + +Tags: `code`, `language` + +Aliases: `fenced-code-language` + +Parameters: + +- `allowed_languages`: List of languages (`string[]`, default `[]`) +- `language_only`: Require language only (`boolean`, default `false`) + +This rule is triggered when fenced code blocks are used, but a language isn't +specified: + +````markdown +``` +#!/bin/bash +echo Hello world +``` +```` + +To fix this, add a language specifier to the code block: + +````markdown +```bash +#!/bin/bash +echo Hello world +``` +```` + +To display a code block without syntax highlighting, use: + +````markdown +```text +Plain text in a code block +``` +```` + +You can configure the `allowed_languages` parameter to specify a list of +languages code blocks could use. Languages are case sensitive. The default value +is `[]` which means any language specifier is valid. + +You can prevent extra data from being present in the info string of fenced code +blocks. To do so, set the `language_only` parameter to `true`. + + +Info strings with leading/trailing whitespace (ex: `js `) or other content (ex: +`ruby startline=3`) will trigger this rule. + +Rationale: Specifying a language improves content rendering by using the +correct syntax highlighting for code. More information: +. diff --git a/doc/md041.md b/doc/md041.md new file mode 100644 index 00000000..82dd8a19 --- /dev/null +++ b/doc/md041.md @@ -0,0 +1,64 @@ +# `MD041` - First line in a file should be a top-level heading + +Tags: `headings` + +Aliases: `first-line-h1`, `first-line-heading` + +Parameters: + +- `allow_preamble`: Allow content before first heading (`boolean`, default + `false`) +- `front_matter_title`: RegExp for matching title in front matter (`string`, + default `^\s*title\s*[:=]`) +- `level`: Heading level (`integer`, default `1`) + +This rule is intended to ensure documents have a title and is triggered when +the first line in a document is not a top-level ([HTML][HTML] `h1`) heading: + +```markdown +This is a document without a heading +``` + +To fix this, add a top-level heading to the beginning of the document: + +```markdown +# Document Heading + +This is a document with a top-level heading +``` + +Because it is common for projects on GitHub to use an image for the heading of +`README.md` and that pattern is not well-supported by Markdown, HTML headings +are also permitted by this rule. For example: + +```markdown +

+ +This is a document with a top-level HTML heading +``` + +In some cases, a document's title heading may be preceded by text like a table +of contents. This is not ideal for accessibility, but can be allowed by setting +the `allow_preamble` parameter to `true`. + +```markdown +This is a document with preamble text + +# Document Heading +``` + +If [YAML][YAML] front matter is present and contains a `title` property +(commonly used with blog posts), this rule will not report a violation. To use a +different property name in the front matter, specify the text of a [regular +expression][RegExp] via the `front_matter_title` parameter. To disable the use +of front matter by this rule, specify `""` for `front_matter_title`. + +The `level` parameter can be used to change the top-level heading (ex: to `h2`) +in cases where an `h1` is added externally. + +Rationale: The top-level heading often acts as the title of a document. More +information: . + +[HTML]: https://en.wikipedia.org/wiki/HTML +[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions +[YAML]: https://en.wikipedia.org/wiki/YAML diff --git a/doc/md042.md b/doc/md042.md new file mode 100644 index 00000000..df2026a3 --- /dev/null +++ b/doc/md042.md @@ -0,0 +1,32 @@ +# `MD042` - No empty links + +Tags: `links` + +Aliases: `no-empty-links` + +This rule is triggered when an empty link is encountered: + +```markdown +[an empty link]() +``` + +To fix the violation, provide a destination for the link: + +```markdown +[a valid link](https://example.com/) +``` + +Empty fragments will trigger this rule: + +```markdown +[an empty fragment](#) +``` + +But non-empty fragments will not: + +```markdown +[a valid fragment](#fragment) +``` + +Rationale: Empty links do not lead anywhere and therefore don't function as +links. diff --git a/doc/md043.md b/doc/md043.md new file mode 100644 index 00000000..e35f4f58 --- /dev/null +++ b/doc/md043.md @@ -0,0 +1,87 @@ +# `MD043` - Required heading structure + +Tags: `headings` + +Aliases: `required-headings` + +Parameters: + +- `headings`: List of headings (`string[]`, default `[]`) +- `match_case`: Match case of headings (`boolean`, default `false`) + +This rule is triggered when the headings in a file do not match the array of +headings passed to the rule. It can be used to enforce a standard heading +structure for a set of files. + +To require exactly the following structure: + +```markdown +# Heading +## Item +### Detail +``` + +Set the `headings` parameter to: + +```json +[ + "# Heading", + "## Item", + "### Detail" +] +``` + +To allow optional headings as with the following structure: + +```markdown +# Heading +## Item +### Detail (optional) +## Foot +### Notes (optional) +``` + +Use the special value `"*"` meaning "zero or more unspecified headings" or the +special value `"+"` meaning "one or more unspecified headings" and set the +`headings` parameter to: + +```json +[ + "# Heading", + "## Item", + "*", + "## Foot", + "*" +] +``` + +To allow a single required heading to vary as with a project name: + +```markdown +# Project Name +## Description +## Examples +``` + +Use the special value `"?"` meaning "exactly one unspecified heading": + +```json +[ + "?", + "## Description", + "## Examples" +] +``` + +When an error is detected, this rule outputs the line number of the first +problematic heading (otherwise, it outputs the last line number of the file). + +Note that while the `headings` parameter uses the "## Text" ATX heading style +for simplicity, a file may use any supported heading style. + +By default, the case of headings in the document is not required to match that +of `headings`. To require that case match exactly, set the `match_case` +parameter to `true`. + +Rationale: Projects may wish to enforce a consistent document structure across +a set of similar content. diff --git a/doc/md044.md b/doc/md044.md new file mode 100644 index 00000000..e8f34e48 --- /dev/null +++ b/doc/md044.md @@ -0,0 +1,45 @@ +# `MD044` - Proper names should have the correct capitalization + +Tags: `spelling` + +Aliases: `proper-names` + +Parameters: + +- `code_blocks`: Include code blocks (`boolean`, default `true`) +- `html_elements`: Include HTML elements (`boolean`, default `true`) +- `names`: List of proper names (`string[]`, default `[]`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when any of the strings in the `names` array do not have +the specified capitalization. It can be used to enforce a standard letter case +for the names of projects and products. + +For example, the language "JavaScript" is usually written with both the 'J' and +'S' capitalized - though sometimes the 's' or 'j' appear in lower-case. To +enforce the proper capitalization, specify the desired letter case in the +`names` array: + +```json +[ + "JavaScript" +] +``` + +Sometimes a proper name is capitalized differently in certain contexts. In such +cases, add both forms to the `names` array: + +```json +[ + "GitHub", + "github.com" +] +``` + +Set the `code_blocks` parameter to `false` to disable this rule for code blocks +and spans. Set the `html_elements` parameter to `false` to disable this rule +for HTML elements and attributes (such as when using a proper name as part of +a path for `a`/`href` or `img`/`src`). + +Rationale: Incorrect capitalization of proper names is usually a mistake. diff --git a/doc/md045.md b/doc/md045.md new file mode 100644 index 00000000..14ac0a00 --- /dev/null +++ b/doc/md045.md @@ -0,0 +1,48 @@ +# `MD045` - Images should have alternate text (alt text) + +Tags: `accessibility`, `images` + +Aliases: `no-alt-text` + +This rule reports a violation when an image is missing alternate text (alt text) +information. + +Alternate text is commonly specified inline as: + +```markdown +![Alternate text](image.jpg) +``` + +Or with reference syntax as: + +```markdown +![Alternate text][ref] + +... + +[ref]: image.jpg "Optional title" +``` + +Or with HTML as: + +```html +Alternate text +``` + +Note: If the [HTML `aria-hidden` attribute][aria-hidden] is used to hide the +image from assistive technology, this rule does not report a violation: + +```html + +``` + +Guidance for writing alternate text is available from the [W3C][w3c], +[Wikipedia][wikipedia], and [other locations][phase2technology]. + +Rationale: Alternate text is important for accessibility and describes the +content of an image for people who may not be able to see it. + +[aria-hidden]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden +[phase2technology]: https://www.phase2technology.com/blog/no-more-excuses +[w3c]: https://www.w3.org/WAI/alt/ +[wikipedia]: https://en.wikipedia.org/wiki/Alt_attribute diff --git a/doc/md046.md b/doc/md046.md new file mode 100644 index 00000000..25c9611b --- /dev/null +++ b/doc/md046.md @@ -0,0 +1,40 @@ +# `MD046` - Code block style + +Tags: `code` + +Aliases: `code-block-style` + +Parameters: + +- `style`: Block style (`string`, default `consistent`, values `consistent` / + `fenced` / `indented`) + +This rule is triggered when unwanted or different code block styles are used in +the same document. + +In the default configuration this rule reports a violation for the following +document: + + + + Some text. + + # Indented code + + More text. + + ```ruby + # Fenced code + ``` + + More text. + + + +To fix violations of this rule, use a consistent style (either indenting or code +fences). + +The configured code block style can be specific (`fenced`, `indented`) or can +require all code blocks match the first code block (`consistent`). + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md047.md b/doc/md047.md new file mode 100644 index 00000000..494937d0 --- /dev/null +++ b/doc/md047.md @@ -0,0 +1,34 @@ +# `MD047` - Files should end with a single newline character + +Tags: `blank_lines` + +Aliases: `single-trailing-newline` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when there is not a single newline character at the end +of a file. + +An example that triggers the rule: + +```markdown +# Heading + +This file ends without a newline.[EOF] +``` + +To fix the violation, add a newline character to the end of the file: + +```markdown +# Heading + +This file ends with a newline. +[EOF] +``` + +Rationale: Some programs have trouble with files that do not end with a newline. + +More information: [What's the point in adding a new line to the end of a +file?][stack-exchange] + +[stack-exchange]: https://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file diff --git a/doc/md048.md b/doc/md048.md new file mode 100644 index 00000000..37765760 --- /dev/null +++ b/doc/md048.md @@ -0,0 +1,42 @@ +# `MD048` - Code fence style + +Tags: `code` + +Aliases: `code-fence-style` + +Parameters: + +- `style`: Code fence style (`string`, default `consistent`, values `backtick` + / `consistent` / `tilde`) + +This rule is triggered when the symbols used in the document for fenced code +blocks do not match the configured code fence style: + +````markdown +```ruby +# Fenced code +``` + +~~~ruby +# Fenced code +~~~ +```` + +To fix this issue, use the configured code fence style throughout the +document: + +````markdown +```ruby +# Fenced code +``` + +```ruby +# Fenced code +``` +```` + +The configured code fence style can be a specific symbol to use (`backtick`, +`tilde`) or it can require all code fences match the first code fence +(`consistent`). + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md049.md b/doc/md049.md new file mode 100644 index 00000000..e16316d3 --- /dev/null +++ b/doc/md049.md @@ -0,0 +1,36 @@ +# `MD049` - Emphasis style + +Tags: `emphasis` + +Aliases: `emphasis-style` + +Parameters: + +- `style`: Emphasis style (`string`, default `consistent`, values `asterisk` / + `consistent` / `underscore`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when the symbols used in the document for emphasis do not +match the configured emphasis style: + +```markdown +*Text* +_Text_ +``` + +To fix this issue, use the configured emphasis style throughout the document: + +```markdown +*Text* +*Text* +``` + +The configured emphasis style can be a specific symbol to use (`asterisk`, +`underscore`) or can require all emphasis matches the first emphasis +(`consistent`). + +Note: Emphasis within a word is restricted to `asterisk` in order to avoid +unwanted emphasis for words containing internal underscores like_this_one. + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md050.md b/doc/md050.md new file mode 100644 index 00000000..2f249c2c --- /dev/null +++ b/doc/md050.md @@ -0,0 +1,35 @@ +# `MD050` - Strong style + +Tags: `emphasis` + +Aliases: `strong-style` + +Parameters: + +- `style`: Strong style (`string`, default `consistent`, values `asterisk` / + `consistent` / `underscore`) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when the symbols used in the document for strong do not +match the configured strong style: + +```markdown +**Text** +__Text__ +``` + +To fix this issue, use the configured strong style throughout the document: + +```markdown +**Text** +**Text** +``` + +The configured strong style can be a specific symbol to use (`asterisk`, +`underscore`) or can require all strong matches the first strong (`consistent`). + +Note: Emphasis within a word is restricted to `asterisk` in order to avoid +unwanted emphasis for words containing internal underscores like__this__one. + +Rationale: Consistent formatting makes it easier to understand a document. diff --git a/doc/md051.md b/doc/md051.md new file mode 100644 index 00000000..8c8228c1 --- /dev/null +++ b/doc/md051.md @@ -0,0 +1,117 @@ +# `MD051` - Link fragments should be valid + +Tags: `links` + +Aliases: `link-fragments` + +Parameters: + +- `ignore_case`: Ignore case of fragments (`boolean`, default `false`) +- `ignored_pattern`: Pattern for ignoring additional fragments (`string`, + default ``) + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when a link fragment does not match any of the fragments +that are automatically generated for headings in a document: + +```markdown +# Heading Name + +[Link](#fragment) +``` + +To fix this issue, change the link fragment to reference an existing heading's +generated name (see below): + +```markdown +# Heading Name + +[Link](#heading-name) +``` + +For consistency, this rule requires fragments to exactly match the [GitHub +heading algorithm][github-heading-algorithm] which converts letters to +lowercase. Therefore, the following example is reported as a violation: + +```markdown +# Heading Name + +[Link](#Heading-Name) +``` + +To ignore case when comparing fragments with heading names, the `ignore_case` +parameter can be set to `true`. In this configuration, the previous example is +not reported as a violation. + +Alternatively, some platforms allow the syntax `{#named-anchor}` to be used +within a heading to provide a specific name (consisting of only lower-case +letters, numbers, `-`, and `_`): + +```markdown +# Heading Name {#custom-name} + +[Link](#custom-name) +``` + +Alternatively, any HTML tag with an `id` attribute or an `a` tag with a `name` +attribute can be used to define a fragment: + +```markdown + + +[Link](#bookmark) +``` + +An `a` tag can be useful in scenarios where a heading is not appropriate or for +control over the text of the fragment identifier. + +[HTML links to `#top` scroll to the top of a document][html-top-fragment]. This +rule allows that syntax (using lower-case for consistency): + +```markdown +[Link](#top) +``` + +This rule also recognizes the custom fragment syntax used by GitHub to highlight +[specific content in a document][github-linking-to-content]. + +For example, this link to line 20: + +```markdown +[Link](#L20) +``` + +And this link to content starting within line 19 running into line 21: + +```markdown +[Link](#L19C5-L21C11) +``` + +Some Markdown generators dynamically create and insert headings when building +documents, for example by combining a fixed prefix like `figure-` and an +incrementing numeric counter. To ignore such generated fragments, set the +`ignored_pattern` [regular expression][RegEx] parameter to a pattern that +matches (e.g., `^figure-`). + +Rationale: [GitHub section links][github-section-links] are created +automatically for every heading when Markdown content is displayed on GitHub. +This makes it easy to link directly to different sections within a document. +However, section links change if headings are renamed or removed. This rule +helps identify broken section links within a document. + +Note: Section links are **not** part of the CommonMark specification; this rule +enforces the [GitHub heading algorithm][github-heading-algorithm]: + +1. Convert text to lowercase +2. Remove punctuation characters +3. Convert spaces to dashes +4. Append an incrementing integer (as needed for uniqueness) +5. [URI-encode][encodeURIComponent] the result + +[encodeURIComponent]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent +[github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links +[github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb +[github-linking-to-content]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown +[html-top-fragment]: https://html.spec.whatwg.org/multipage/browsing-the-web.html#scrolling-to-a-fragment +[RegEx]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions diff --git a/doc/md052.md b/doc/md052.md new file mode 100644 index 00000000..e8544f70 --- /dev/null +++ b/doc/md052.md @@ -0,0 +1,52 @@ +# `MD052` - Reference links and images should use a label that is defined + +Tags: `images`, `links` + +Aliases: `reference-links-images` + +Parameters: + +- `ignored_labels`: Ignored link labels (`string[]`, default `["x"]`) +- `shortcut_syntax`: Include shortcut syntax (`boolean`, default `false`) + +Links and images in Markdown can provide the link destination or image source +at the time of use or can define it elsewhere and use a label for reference. +The reference format is convenient for keeping paragraph text clutter-free +and makes it easy to reuse the same URL in multiple places. + +There are three kinds of reference links and images: + +```markdown +Full: [text][label] +Collapsed: [label][] +Shortcut: [label] + +Full: ![text][image] +Collapsed: ![image][] +Shortcut: ![image] + +[label]: https://example.com/label +[image]: https://example.com/image +``` + +A link or image renders correctly when the corresponding label is defined, but +displays as text with brackets when the label is not present. By default, this +rule warns of undefined labels for "full" and "collapsed" reference syntax but +not for "shortcut" syntax because it is ambiguous. + +The text `[example]` could be a shortcut link or the text "example" in brackets, +so "shortcut" syntax is ignored by default. To include "shortcut" syntax, set +the `include_shortcut` parameter to `true`. Note that doing so produces warnings +for *all* text in the document that *could* be a shortcut. If bracketed text is +intentional, brackets can be escaped with the `\` character: `\[example\]`. + +If there are link labels that are deliberately unreferenced, they can be ignored +by setting the `ignored_labels` parameter to the list of strings to ignore. The +default value of this parameter ignores the checkbox syntax used by +[GitHub Flavored Markdown task list items][gfm-tasklist]: + +```markdown +- [x] Checked task list item +``` + +[gfm-tasklist]: https://github.github.com/gfm/#task-list-items-extension- diff --git a/doc/md053.md b/doc/md053.md new file mode 100644 index 00000000..96b1104d --- /dev/null +++ b/doc/md053.md @@ -0,0 +1,38 @@ +# `MD053` - Link and image reference definitions should be needed + +Tags: `images`, `links` + +Aliases: `link-image-reference-definitions` + +Parameters: + +- `ignored_definitions`: Ignored definitions (`string[]`, default `["//"]`) + +Fixable: Some violations can be fixed by tooling + +Links and images in Markdown can provide the link destination or image source +at the time of use or can use a label to reference a definition elsewhere in +the document. The latter reference format is convenient for keeping paragraph +text clutter-free and makes it easy to reuse the same URL in multiple places. + +Because link and image reference definitions are located separately from +where they are used, there are two scenarios where a definition can be +unnecessary: + +1. If a label is not referenced by any link or image in a document, that + definition is unused and can be deleted. +2. If a label is defined multiple times in a document, the first definition is + used and the others can be deleted. + +This rule considers a reference definition to be used if any link or image +reference has the corresponding label. The "full", "collapsed", and "shortcut" +formats are all supported. + +If there are reference definitions that are deliberately unreferenced, they can +be ignored by setting the `ignored_definitions` parameter to the list of strings +to ignore. The default value of this parameter ignores the following convention +for adding non-HTML comments to Markdown: + +```markdown +[//]: # (This behaves like a comment) +``` diff --git a/doc/md054.md b/doc/md054.md new file mode 100644 index 00000000..01d661cd --- /dev/null +++ b/doc/md054.md @@ -0,0 +1,100 @@ +# `MD054` - Link and image style + +Tags: `images`, `links` + +Aliases: `link-image-style` + +Parameters: + +- `autolink`: Allow autolinks (`boolean`, default `true`) +- `collapsed`: Allow collapsed reference links and images (`boolean`, default + `true`) +- `full`: Allow full reference links and images (`boolean`, default `true`) +- `inline`: Allow inline links and images (`boolean`, default `true`) +- `shortcut`: Allow shortcut reference links and images (`boolean`, default + `true`) +- `url_inline`: Allow URLs as inline links (`boolean`, default `true`) + +Fixable: Some violations can be fixed by tooling + +Links and images in Markdown can provide the link destination or image source at +the time of use or can use a label to reference a definition elsewhere in the +document. The three reference formats are convenient for keeping paragraph text +clutter-free and make it easy to reuse the same URL in multiple places. + +By default, this rule allows all link/image styles. + +Setting the `autolink` parameter to `false` disables autolinks: + +```markdown + +``` + +Setting the `inline` parameter to `false` disables inline links and images: + +```markdown +[link](https://example.com) + +![image](https://example.com) +``` + +Setting the `full` parameter to `false` disables full reference links and +images: + +```markdown +[link][url] + +![image][url] + +[url]: https://example.com +``` + +Setting the `collapsed` parameter to `false` disables collapsed reference links +and images: + +```markdown +[url][] + +![url][] + +[url]: https://example.com +``` + +Setting the `shortcut` parameter to `false` disables shortcut reference links +and images: + +```markdown +[url] + +![url] + +[url]: https://example.com +``` + +To fix violations of this rule, change the link or image to use an allowed +style. This rule can automatically fix violations when a link or image can be +converted to the `inline` style (preferred) or a link can be converted to the +`autolink` style (which does not support images and must be an absolute URL). +This rule does *not* fix scenarios that require converting a link or image to +the `full`, `collapsed`, or `shortcut` reference styles because that involves +naming the reference and determining where to insert it in the document. + +Setting the `url_inline` parameter to `false` prevents the use of inline links +with the same absolute URL text/destination and no title because such links can +be converted to autolinks: + +```markdown +[https://example.com](https://example.com) +``` + +To fix `url_inline` violations, use the simpler autolink syntax instead: + +```markdown + +``` + +Rationale: Consistent formatting makes it easier to understand a document. +Autolinks are concise, but appear as URLs which can be long and confusing. +Inline links and images can include descriptive text, but take up more space in +Markdown form. Reference links and images can be easier to read and manipulate +in Markdown form, but require a separate link reference definition. diff --git a/doc/md055.md b/doc/md055.md new file mode 100644 index 00000000..98d38e4f --- /dev/null +++ b/doc/md055.md @@ -0,0 +1,55 @@ +# `MD055` - Table pipe style + +Tags: `table` + +Aliases: `table-pipe-style` + +Parameters: + +- `style`: Table pipe style (`string`, default `consistent`, values + `consistent` / `leading_and_trailing` / `leading_only` / + `no_leading_or_trailing` / `trailing_only`) + +This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-055] +is inconsistent about its use of leading and trailing pipe characters (`|`). + +By default (`consistent` style), the header row of the first table in a document +is used to determine the style that is enforced for every table in the document. +A specific style can be used instead (`leading_and_trailing`, `leading_only`, +`no_leading_or_trailing`, `trailing_only`). + +This table's header row has leading and trailing pipes, but its delimiter row is +missing the trailing pipe and its first row of cells is missing the leading +pipe: + +```markdown +| Header | Header | +| ------ | ------ + Cell | Cell | +``` + +To fix these issues, make sure there is a pipe character at the beginning and +end of every row: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +``` + +Note that text immediately following a table (i.e., not separated by an empty +line) is treated as part of the table (per the specification) and may also +trigger this rule: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +This text is part of the table +``` + +Rationale: Some parsers have difficulty with tables that are missing their +leading or trailing pipe characters. The use of leading/trailing pipes can also +help provide visual clarity. + +[gfm-table-055]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables diff --git a/doc/md056.md b/doc/md056.md new file mode 100644 index 00000000..e3a6bd50 --- /dev/null +++ b/doc/md056.md @@ -0,0 +1,37 @@ +# `MD056` - Table column count + +Tags: `table` + +Aliases: `table-column-count` + +This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-056] +does not have the same number of cells in every row. + +This table's second data row has too few cells and its third data row has too +many cells: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +| Cell | +| Cell | Cell | Cell | +``` + +To fix these issues, ensure every row has the same number of cells: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +| Cell | Cell | +| Cell | Cell | +``` + +Note that a table's header row and its delimiter row must have the same number +of cells or it will not be recognized as a table (per specification). + +Rationale: Extra cells in a row are usually not shown, so their data is lost. +Missing cells in a row create holes in the table and suggest an omission. + +[gfm-table-056]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables diff --git a/doc/md058.md b/doc/md058.md new file mode 100644 index 00000000..86007512 --- /dev/null +++ b/doc/md058.md @@ -0,0 +1,48 @@ +# `MD058` - Tables should be surrounded by blank lines + +Tags: `table` + +Aliases: `blanks-around-tables` + +Fixable: Some violations can be fixed by tooling + +This rule is triggered when tables are either not preceded or not followed by a +blank line: + +```markdown +Some text +| Header | Header | +| ------ | ------ | +| Cell | Cell | +> Blockquote +``` + +To fix violations of this rule, ensure that all tables have a blank line both +before and after (except when the table is at the very beginning or end of the +document): + +```markdown +Some text + +| Header | Header | +| ------ | ------ | +| Cell | Cell | + +> Blockquote +``` + +Note that text immediately following a table (i.e., not separated by an empty +line) is treated as part of the table (per the specification) and will not +trigger this rule: + +```markdown +| Header | Header | +| ------ | ------ | +| Cell | Cell | +This text is part of the table and the next line is blank + +Some text +``` + +Rationale: In addition to aesthetic reasons, some parsers will incorrectly parse +tables that don't have blank lines before and after them. diff --git a/doc/md059.md b/doc/md059.md new file mode 100644 index 00000000..1ce47425 --- /dev/null +++ b/doc/md059.md @@ -0,0 +1,33 @@ +# `MD059` - Link text should be descriptive + +Tags: `accessibility`, `links` + +Aliases: `descriptive-link-text` + +Parameters: + +- `prohibited_texts`: Prohibited link texts (`string[]`, default `["click + here","here","link","more"]`) + +This rule is triggered when a link has generic text like `[click here](...)` or +`[link](...)`. + +Link text should be descriptive and communicate the purpose of the link (e.g., +`[Download the budget document](...)` or `[CommonMark Specification](...)`). +This is especially important for screen readers which sometimes present links +without context. + +By default, this rule prohibits a small number of common English words/phrases. +To customize that list of words/phrases, set the `prohibited_texts` parameter to +an `Array` of `string`s. + +Note: For languages other than English, use the `prohibited_texts` parameter to +customize the list for that language. It is *not* a goal for this rule to have +translations for every language. + +Note: This rule checks Markdown links; HTML links are ignored. + +More information: + +- +- diff --git a/doc/md060.md b/doc/md060.md new file mode 100644 index 00000000..222af213 --- /dev/null +++ b/doc/md060.md @@ -0,0 +1,118 @@ +# `MD060` - Table column style + +Tags: `table` + +Aliases: `table-column-style` + +Parameters: + +- `aligned_delimiter`: Aligned delimiter columns (`boolean`, default `false`) +- `style`: Table column style (`string`, default `any`, values `aligned` / + `any` / `compact` / `tight`) + +This rule is triggered when the column separator pipe characters (`|`) of a +[GitHub Flavored Markdown table][gfm-table-060] are used inconsistently. + +This rule recognizes three table column styles based on popular use. + +Style `aligned` ensures pipe characters are vertically aligned: + +```markdown +| Character | Meaning | +| --------- | ------- | +| Y | Yes | +| N | No | +``` + +The `aligned` style ignores cell content, so the following is also valid: + +```markdown +| Character | Meaning | +|-----------|---------| +| Y | Yes | +| N | No | +``` + +Style `compact` avoids extra padding with a single space around cell content: + +```markdown +| Character | Meaning | +| --- | --- | +| Y | Yes | +| N | No | +``` + +Style `tight` uses no padding at all for cell content: + +```markdown +|Character|Meaning| +|---|---| +|Y|Yes| +|N|No| +``` + +When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`, +every table must match the corresponding pattern and any violations will be +reported. By default, or when the `any` style is used, each table is analyzed to +see if it satisfies any supported style. If so, no violations are reported. If +not, violations are be reported for whichever style would produce the *fewest* +issues (i.e., whichever style is the closest match). + +Setting the `aligned_delimiter` parameter to `true` requires pipe characters in +the delimiter row to align with those in the header row. This can be used with +`compact` and `tight` tables to make the header text more obvious. (It's already +required for tables with style `aligned`.) + +Style `compact` with `aligned_delimiter`: + +```markdown +| Character | Meaning | +| --------- | ------- | +| Y | Yes | +| N | No | +``` + +Style `tight` with `aligned_delimiter`: + +```markdown +|Character|Meaning| +|---------|-------| +|Y|Yes| +|N|No| +``` + +**Note**: This rule does not require leading/trailing pipe characters, so this +is also a valid table for style `compact`: + +```markdown +Character | Meaning +--- | --- +Y | Yes +N | No +``` + +**Note**: Pipe alignment for the `aligned` style is based on visual appearance +and not character count. Because editors typically render [emoji][emoji] and +[CJK characters][cjk-characters] at *twice* the width of +[Latin characters][latin-script], this rule takes that into account for tables +using the `aligned` style. The following table is correctly formatted and will +appear aligned in most editors and monospaced fonts: + + + + +```markdown +| Response | Emoji | +| -------- | ----- | +| Yes | ✅ | +| No | ❎ | +``` + + + +Rationale: Consistent formatting makes it easier to understand a document. + +[cjk-characters]: https://en.wikipedia.org/wiki/CJK_characters +[emoji]: https://en.wikipedia.org/wiki/Emoji +[gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables +[latin-script]: https://en.wikipedia.org/wiki/Latin_script diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..6b83e6c7 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,168 @@ +import js from "@eslint/js"; +import eslintPluginJsdoc from "eslint-plugin-jsdoc"; +import eslintPluginNode from "eslint-plugin-n"; +import eslintPluginRegexp from "eslint-plugin-regexp"; +import eslintPluginStylistic from "@stylistic/eslint-plugin"; +import eslintPluginUnicorn from "eslint-plugin-unicorn"; + +export default [ + js.configs.all, + eslintPluginJsdoc.configs["flat/recommended"], + eslintPluginNode.configs["flat/recommended"], + eslintPluginRegexp.configs["flat/recommended"], + eslintPluginStylistic.configs.customize({ + "arrowParens": true, + "braceStyle": "1tbs", + "commaDangle": "never", + "jsx": false, + "quoteProps": "always", + "quotes": "double", + "semi": true + }), + eslintPluginUnicorn.configs["flat/all"], + { + "ignores": [ + "demo/markdown-it.min.js", + "demo/markdownlint-browser.js", + "demo/markdownlint-browser.min.js", + "example/typescript/type-check-*", + "test-repos/**" + ] + }, + { + "linterOptions": { + "reportUnusedDisableDirectives": true + }, + "rules": { + "@stylistic/array-bracket-spacing": [ "error", "always" ], + "@stylistic/indent": [ "error", 2 ], + "@stylistic/indent-binary-ops": [ "off" ], + "@stylistic/operator-linebreak": [ "error", "after" ], + "@stylistic/padded-blocks": "off", + "@stylistic/space-before-function-paren": [ "error", "never" ], + "capitalized-comments": "off", + "complexity": "off", + "func-style": "off", + "id-length": "off", + "jsdoc/tag-lines": [ "error", "never", { "startLines": 1 } ], + "logical-assignment-operators": "off", + "max-depth": "off", + "max-lines-per-function": "off", + "max-lines": "off", + "max-params": "off", + "max-statements": "off", + "multiline-comment-style": [ "error", "separate-lines" ], + "no-empty-function": "off", + "no-implicit-coercion": "off", + "no-inline-comments": [ "error", { "ignorePattern": " @type \\{.+\\} " } ], + "no-magic-numbers": "off", + "no-param-reassign": "off", + "no-plusplus": "off", + "no-ternary": "off", + "no-undef-init": "off", + "no-undefined": "off", + "no-useless-assignment": "off", + "object-shorthand": "off", + "one-var": "off", + "prefer-arrow-callback": "off", + "prefer-destructuring": "off", + "prefer-named-capture-group": "off", + "prefer-template": "off", + "require-unicode-regexp": "off", + "sort-imports": "off", + "sort-keys": "off", + "unicorn/better-regex": "off", + "unicorn/consistent-function-scoping": "off", + "unicorn/filename-case": "off", + "unicorn/no-array-callback-reference": "off", + "unicorn/no-keyword-prefix": "off", + "unicorn/no-new-array": "off", + "unicorn/no-null": "off", + "unicorn/no-useless-undefined": "off", + "unicorn/prefer-at": "off", + "unicorn/prefer-string-raw": "off", + "unicorn/prefer-string-replace-all": "off", + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-switch": "off", + "unicorn/prevent-abbreviations": "off", + "unicorn/switch-case-braces": [ "error", "avoid" ], + "vars-on-top": "off" + }, + "settings": { + "jsdoc": { + "preferredTypes": { + "object": "Object" + } + } + } + }, + { + "files": [ + "**/*.js", + "**/*.cjs" + ], + "languageOptions": { + "sourceType": "commonjs", + "globals": { + "module": "readonly", + "require": "readonly" + } + } + }, + { + "files": [ + "demo/default.js" + ], + "languageOptions": { + "globals": { + "alert": "readonly", + "document": "readonly", + "navigator": "readonly", + "window": "readonly" + } + }, + "rules": { + "jsdoc/require-jsdoc": "off", + "n/no-unsupported-features/node-builtins": "off", + "no-invalid-this": "off", + "no-shadow": "off", + "no-var": "off", + "unicorn/prefer-module": "off", + "unicorn/prefer-query-selector": "off" + } + }, + { + "files": [ + "example/*.cjs" + ], + "languageOptions": { + "sourceType": "commonjs" + }, + "rules": { + "n/no-missing-require": "off", + "no-console": "off", + "no-invalid-this": "off" + } + }, + { + "files": [ + "example/standalone.mjs" + ], + "rules": { + "no-console": "off", + "no-constant-condition": "off" + } + }, + { + "files": [ + "test/rules/**/*.js", + "test/rules/**/*.cjs" + ], + "languageOptions": { + "sourceType": "commonjs" + }, + "rules": { + "unicorn/prefer-module": "off" + } + } +]; diff --git a/example/Gruntfile.js b/example/Gruntfile.js deleted file mode 100644 index 916331c9..00000000 --- a/example/Gruntfile.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -var markdownlint = require("../lib/markdownlint"); - -module.exports = function wrapper(grunt) { - grunt.initConfig({ - "markdownlint": { - "example": { - "src": [ "*.md" ] - } - } - }); - - grunt.registerMultiTask("markdownlint", function task() { - var done = this.async(); - markdownlint( - { "files": this.filesSrc }, - function callback(err, result) { - var resultString = err || ((result || "").toString()); - if (resultString) { - grunt.fail.warn("\n" + resultString + "\n"); - } - done(!err || !resultString); - }); - }); -}; diff --git a/example/gulpfile.js b/example/gulpfile.js deleted file mode 100644 index a56090fa..00000000 --- a/example/gulpfile.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -var gulp = require("gulp"); -var through2 = require("through2"); -var markdownlint = require("../lib/markdownlint"); - -// Simple task wrapper -gulp.task("markdownlint", function task() { - return gulp.src("*.md", { "read": false }) - .pipe(through2.obj(function obj(file, enc, next) { - markdownlint( - { "files": [ file.relative ] }, - function callback(err, result) { - var resultString = (result || "").toString(); - if (resultString) { - console.log(resultString); - } - next(err, file); - }); - })); -}); diff --git a/example/standalone.js b/example/standalone.js deleted file mode 100644 index f283bb20..00000000 --- a/example/standalone.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -var markdownlint = require("../lib/markdownlint"); - -var options = { - "files": [ "good.md", "bad.md" ], - "strings": { - "good.string": "# good.string\n\nThis string passes all rules.", - "bad.string": "#bad.string\n\n#This string fails\tsome rules." - } -}; - -// Uses result.toString for pretty formatting -markdownlint(options, function callback(err, result) { - if (!err) { - console.log(result.toString()); - } -}); - -// Examines the result object directly -markdownlint(options, function callback(err, result) { - if (!err) { - console.dir(result, { "colors": true }); - } -}); - -// Make a synchronous call -var result = markdownlint.sync(options); -console.log(result.toString()); diff --git a/example/standalone.mjs b/example/standalone.mjs new file mode 100644 index 00000000..866d0a8b --- /dev/null +++ b/example/standalone.mjs @@ -0,0 +1,54 @@ +// @ts-check + +import { applyFixes, getVersion } from "markdownlint"; +import { lint as lintAsync } from "markdownlint/async"; +import { lint as lintPromise } from "markdownlint/promise"; +import { lint as lintSync } from "markdownlint/sync"; + +// Displays the library version +console.log(getVersion()); + +const options = { + "files": [ "good.md", "bad.md" ], + "strings": { + "good.string": "# good.string\n\nThis string passes all rules.\n", + "bad.string": "#bad.string\n\n#This string fails\tsome rules.\n" + } +}; + +if (true) { + + // Makes a synchronous call + const results = lintSync(options); + console.dir(results, { "colors": true, "depth": null }); + +} + +if (true) { + + // Makes an asynchronous call + lintAsync(options, function callback(error, results) { + if (!error && results) { + console.dir(results, { "colors": true, "depth": null }); + } + }); + +} + +if (true) { + + // Makes a Promise-based asynchronous call + const results = await lintPromise(options); + console.dir(results, { "colors": true, "depth": null }); + +} + +if (true) { + + // Fixes all supported violations in Markdown content + const original = "# Heading"; + const results = lintSync({ "strings": { "content": original } }); + const fixed = applyFixes(original, results.content); + console.log(fixed); + +} diff --git a/example/typescript/.gitignore b/example/typescript/.gitignore new file mode 100644 index 00000000..2918a873 --- /dev/null +++ b/example/typescript/.gitignore @@ -0,0 +1 @@ +type-check-* diff --git a/example/typescript/tsconfig.json b/example/typescript/tsconfig.json new file mode 100644 index 00000000..10ed2dc6 --- /dev/null +++ b/example/typescript/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noPropertyAccessFromIndexSignature": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + } +} diff --git a/example/typescript/type-check.ts b/example/typescript/type-check.ts new file mode 100644 index 00000000..48ae55da --- /dev/null +++ b/example/typescript/type-check.ts @@ -0,0 +1,217 @@ +// Attempt to validate important type declarations + +import { Configuration, ConfigurationStrict, LintResults, Options, Rule, RuleParams, RuleOnError, RuleOnErrorInfo } from "../../lib/exports.mjs"; +import { applyFix, applyFixes, getVersion } from "../../lib/exports.mjs"; +import { lint as lintAsync, readConfig as readConfigAsync } from "../../lib/exports-async.mjs"; +import { lint as lintPromise, readConfig as readConfigPromise } from "../../lib/exports-promise.mjs"; +import { lint as lintSync, readConfig as readConfigSync } from "../../lib/exports-sync.mjs"; + +import assert from "assert"; +import markdownIt from "markdown-it"; +const markdownlintJsonPath = "../../.markdownlint.json"; + +const version: string = getVersion(); +assert(/^\d+\.\d+\.\d+$/.test(version)); + +function assertConfiguration(config: Configuration) { + assert(!!config); + assert.deepEqual(config["line-length"], { "strict": true, "code_blocks": false }); + // config assignment is covered by markdownlint.Options +} + +function assertConfigurationCallback(err: Error | null, config?: Configuration) { + assert(!err); + config && assertConfiguration(config); +} + +function assertLintResults(results: LintResults) { + assert(!!results); + assert.equal(results["string"].length, 1); + assert.equal(results["string"][0].lineNumber, 1); + assert.deepEqual(results["string"][0].ruleNames, [ "MD047", "single-trailing-newline" ]); + assert.equal(results["string"][0].ruleDescription, "Files should end with a single newline character"); + assert.equal(results["string"][0].ruleInformation?.replace(/v\d+\.\d+\.\d+/, "v0.0.0"), "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md"); + assert.equal(results["string"][0].errorDetail, null); + assert.equal(results["string"][0].errorContext, null); + assert.deepEqual(results["string"][0].errorRange, [ 9, 1 ]); + const fixInfo = results["string"][0].fixInfo; + assert(!!fixInfo); + if (fixInfo) { + assert.equal(fixInfo.lineNumber, null); + assert.equal(fixInfo.editColumn, 10); + assert(!fixInfo.deleteCount); + assert.equal(fixInfo.insertText, "\n"); + } + assert.equal(results["../bad.md"].length, 2); + // Deliberate assignment to unused variable validates types + // False-positive for js/useless-assignment-to-local + results = { + "key": [ + { + "lineNumber": 1, + "ruleNames": [ "rule", "names" ], + "ruleDescription": "description", + "ruleInformation": "https://example.com/ruleInformation", + "errorDetail": "detail", + "errorContext": "context", + "errorRange": [ 1, 2 ], + "fixInfo": { + "editColumn": 1, + "deleteCount": 1, + "insertText": "text" + }, + "severity": "error" + } + ] + }; +} + +function assertLintResultsCallback(err: Error | null, results?: LintResults) { + assert(!err); + results && assertLintResults(results); +} + +assertConfiguration(readConfigSync(markdownlintJsonPath)); +assertConfiguration(readConfigSync(markdownlintJsonPath, [ JSON.parse ])); + +readConfigAsync(markdownlintJsonPath, assertConfigurationCallback); +readConfigAsync(markdownlintJsonPath, [ JSON.parse ], assertConfigurationCallback); + +(async () => { + assertConfigurationCallback(null, await readConfigPromise(markdownlintJsonPath)); + assertConfigurationCallback(null, await readConfigPromise(markdownlintJsonPath, [ JSON.parse ])) +})(); + +let options: Options; +options = { + "files": [ "../bad.md" ], + "strings": { + "string": "# Heading" + }, + "config": { + "no-missing-space-atx": false, + "no-hard-tabs": { + "code_blocks": true + } + }, + "configParsers": [ JSON.parse ], + "customRules": undefined, + "frontMatter": /---/, + "handleRuleFailures": false, + "noInlineConfig": false, + "markdownItFactory": () => markdownIt() +}; + +assertLintResults(lintSync(options)); +lintAsync(options, assertLintResultsCallback); +(async () => { + assertLintResultsCallback(null, await lintPromise(options)); +})(); + +options.files = "../bad.md"; +assertLintResults(lintSync(options)); +lintAsync(options, assertLintResultsCallback); +(async () => { + assertLintResultsCallback(null, await lintPromise(options)); +})(); + +const testRule: Rule = { + "names": [ "test-rule" ], + "description": "Test rule", + "information": new URL("https://example.com/rule-information"), + "tags": [ "test-tag" ], + "parser": "none", + "function": function rule(params: RuleParams, onError: RuleOnError) { + assert(!!params); + assert(!!onError); + let ruleParams: RuleParams; + ruleParams = { + "name": "name", + "parsers": { + "markdownit": { + "tokens": [] + }, + "micromark": { + "tokens": [] + } + }, + "lines": [ + "one", + "two" + ], + "frontMatterLines": [ + "three" + ], + "config": options.config, + "version": "1.2.3" + }; + assert(ruleParams); + let ruleOnErrorInfo: RuleOnErrorInfo; + ruleOnErrorInfo = { + "lineNumber": 1, + "detail": "detail", + "context": "context", + "information": new URL("https://example.com/error-information"), + "range": [ 1, 2 ], + "fixInfo": { + "lineNumber": 1, + "editColumn": 1, + "deleteCount": 1, + "insertText": "text" + } + }; + assert(ruleOnErrorInfo); + false && onError(ruleOnErrorInfo); + } +}; + +options.customRules = [ testRule ]; +assertLintResults(lintSync(options)); +lintAsync(options, assertLintResultsCallback); +(async () => { + assertLintResultsCallback(null, await lintPromise(options)); +})(); + +const needsFixing = "# Heading\n"; + +assert.equal( + applyFix( + needsFixing, + { + "insertText": " ", + "editColumn": 2, + "deleteCount": 2 + }, + "\n" + ), + "# Heading\n" +); + +assert.equal( + applyFixes( + needsFixing, + lintSync({ + "strings": { + needsFixing + } + })["needsFixing"] + ), + "# Heading\n" +); + +const configuration: Configuration = { + "custom-rule": true, + "no-hard-tabs": false, + "heading-style": { + "style": "consistent" + } +}; +assert(configuration); +const configurationStrict: ConfigurationStrict = { + // "custom-rule": true, + "no-hard-tabs": false, + "heading-style": { + "style": "consistent" + } +}; +assert(configurationStrict); diff --git a/helpers/.npmignore b/helpers/.npmignore new file mode 100644 index 00000000..73c5a277 --- /dev/null +++ b/helpers/.npmignore @@ -0,0 +1 @@ +test.cjs diff --git a/helpers/LICENSE b/helpers/LICENSE new file mode 100644 index 00000000..71ff07a3 --- /dev/null +++ b/helpers/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) David Anson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/helpers/README.md b/helpers/README.md new file mode 100644 index 00000000..cbc3d72c --- /dev/null +++ b/helpers/README.md @@ -0,0 +1,29 @@ +# markdownlint-rule-helpers + +> A collection of `markdownlint` helper functions for custom rules + +## Overview + +The [Markdown][markdown] linter [`markdownlint`][markdownlint] offers a variety +of built-in validation [rules][rules] and supports the creation of [custom +rules][custom-rules]. The internal rules share various helper functions; this +package exposes those for reuse by custom rules. + +## API + +*Undocumented* - This package exports the internal functions as-is. The APIs +were not originally meant to be public, are not officially supported, and may +change from release to release. There are brief descriptive comments above each +function, but no [JSDoc][jsdoc] annotations. That said, some of what's here will +be useful to custom rule authors and may avoid duplicating code. + +## Tests + +*None* - The entire body of code is tested to 100% coverage by the core +`markdownlint` project, so there are no additional tests here. + +[custom-rules]: https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/CustomRules.md +[jsdoc]: https://en.m.wikipedia.org/wiki/JSDoc +[markdown]: https://en.wikipedia.org/wiki/Markdown +[markdownlint]: https://github.com/DavidAnson/markdownlint +[rules]: https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/Rules.md diff --git a/helpers/helpers.cjs b/helpers/helpers.cjs new file mode 100644 index 00000000..5151e3c5 --- /dev/null +++ b/helpers/helpers.cjs @@ -0,0 +1,696 @@ +// @ts-check + +"use strict"; + +const micromark = require("./micromark-helpers.cjs"); + +const { newLineRe, nextLinesRe } = require("./shared.cjs"); + +module.exports.newLineRe = newLineRe; +module.exports.nextLinesRe = nextLinesRe; + +/** @typedef {import("../lib/exports.mjs").RuleOnError} RuleOnError */ +/** @typedef {import("../lib/exports.mjs").RuleOnErrorFixInfo} RuleOnErrorFixInfo */ +/** @typedef {import("../lib/exports.mjs").MicromarkToken} MicromarkToken */ +// eslint-disable-next-line jsdoc/valid-types +/** @typedef {import("micromark-extension-gfm-footnote", { with: { "resolution-mode": "import" } })} */ +// eslint-disable-next-line jsdoc/valid-types +/** @typedef {import("../lib/micromark-types.d.mts", { with: { "resolution-mode": "import" } })} */ + +// Regular expression for matching common front matter (YAML and TOML) +// @ts-ignore +module.exports.frontMatterRe = + /((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m; + +// Regular expression for matching the start of inline disable/enable comments +const inlineCommentStartRe = + /()/gi; +module.exports.inlineCommentStartRe = inlineCommentStartRe; + +// Regular expression for identifying an HTML entity at the end of a line +module.exports.endOfLineHtmlEntityRe = + /&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/; + +// Regular expression for identifying a GitHub emoji code at the end of a line +module.exports.endOfLineGemojiCodeRe = + /:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/; + +// All punctuation characters (normal and full-width) +const allPunctuation = ".,;:!?。,;:!?"; +module.exports.allPunctuation = allPunctuation; + +// All punctuation characters without question mark (normal and full-width) +module.exports.allPunctuationNoQuestion = allPunctuation.replace(/[??]/gu, ""); + +/** + * Returns true iff the input is a Number. + * + * @param {Object} obj Object of unknown type. + * @returns {boolean} True iff obj is a Number. + */ +function isNumber(obj) { + return typeof obj === "number"; +} +module.exports.isNumber = isNumber; + +/** + * Returns true iff the input is a String. + * + * @param {Object} obj Object of unknown type. + * @returns {boolean} True iff obj is a String. + */ +function isString(obj) { + return typeof obj === "string"; +} +module.exports.isString = isString; + +/** + * Returns true iff the input String is empty. + * + * @param {string} str String of unknown length. + * @returns {boolean} True iff the input String is empty. + */ +function isEmptyString(str) { + return str.length === 0; +} +module.exports.isEmptyString = isEmptyString; + +/** + * Returns true iff the input is an Object. + * + * @param {Object} obj Object of unknown type. + * @returns {boolean} True iff obj is an Object. + */ +function isObject(obj) { + return !!obj && (typeof obj === "object") && !Array.isArray(obj); +} +module.exports.isObject = isObject; + +/** + * Returns true iff the input is a URL. + * + * @param {Object} obj Object of unknown type. + * @returns {boolean} True iff obj is a URL. + */ +function isUrl(obj) { + return !!obj && (Object.getPrototypeOf(obj) === URL.prototype); +} +module.exports.isUrl = isUrl; + +/** + * Clones the input if it is an Array. + * + * @param {Object} arr Object of unknown type. + * @returns {Object} Clone of obj iff obj is an Array. + */ +function cloneIfArray(arr) { + return Array.isArray(arr) ? [ ...arr ] : arr; +} +module.exports.cloneIfArray = cloneIfArray; + +/** + * Clones the input if it is a URL. + * + * @param {Object | undefined} url Object of unknown type. + * @returns {Object} Clone of obj iff obj is a URL. + */ +function cloneIfUrl(url) { + // @ts-ignore + return isUrl(url) ? new URL(url) : url; +} +module.exports.cloneIfUrl = cloneIfUrl; + +/** + * Gets a Regular Expression for matching the specified HTML attribute. + * + * @param {string} name HTML attribute name. + * @returns {RegExp} Regular Expression for matching. + */ +module.exports.getHtmlAttributeRe = function getHtmlAttributeRe(name) { + return new RegExp(`\\s${name}\\s*=\\s*['"]?([^'"\\s>]*)`, "iu"); +}; + +/** + * Returns true iff the input line is blank (contains nothing, whitespace, or + * comments (unclosed start/end comments allowed)). + * + * @param {string} line Input line. + * @returns {boolean} True iff line is blank. + */ +function isBlankLine(line) { + const startComment = ""; + const removeComments = (/** @type {string} */ s) => { + while (true) { + const start = s.indexOf(startComment); + const end = s.indexOf(endComment); + if ((end !== -1) && ((start === -1) || (end < start))) { + // Unmatched end comment is first + s = s.slice(end + endComment.length); + } else if ((start !== -1) && (end !== -1)) { + // Start comment is before end comment + s = s.slice(0, start) + s.slice(end + endComment.length); + } else if ((start !== -1) && (end === -1)) { + // Unmatched start comment is last + s = s.slice(0, start); + } else { + // No more comments to remove + return s; + } + } + }; + return ( + !line || + !line.trim() || + !removeComments(line).replace(/>/g, "").trim() + ); +} +module.exports.isBlankLine = isBlankLine; + +// Replaces the content of properly-formatted CommonMark comments with "." +// This preserves the line/column information for the rest of the document +// https://spec.commonmark.org/0.29/#html-blocks +// https://spec.commonmark.org/0.29/#html-comment +const htmlCommentBegin = ""; +const safeCommentCharacter = "."; +const startsWithPipeRe = /^ *\|/; +const notCrLfRe = /[^\r\n]/g; +const notSpaceCrLfRe = /[^ \r\n]/g; +const trailingSpaceRe = / +[\r\n]/g; +const replaceTrailingSpace = (/** @type {string} */ s) => s.replace(notCrLfRe, safeCommentCharacter); +module.exports.clearHtmlCommentText = function clearHtmlCommentText(/** @type {string} */ text) { + let i = 0; + while ((i = text.indexOf(htmlCommentBegin, i)) !== -1) { + const j = text.indexOf(htmlCommentEnd, i + 2); + if (j === -1) { + // Un-terminated comments are treated as text + break; + } + // If the comment has content... + if (j > i + htmlCommentBegin.length) { + const content = text.slice(i + htmlCommentBegin.length, j); + const lastLf = text.lastIndexOf("\n", i) + 1; + const preText = text.slice(lastLf, i); + const isBlock = preText.trim().length === 0; + const couldBeTable = startsWithPipeRe.test(preText); + const spansTableCells = couldBeTable && content.includes("\n"); + const isValid = + isBlock || + !( + spansTableCells || + content.startsWith(">") || + content.startsWith("->") || + content.endsWith("-") || + content.includes("--") + ); + // If a valid block/inline comment... + if (isValid) { + const clearedContent = content + .replace(notSpaceCrLfRe, safeCommentCharacter) + .replace(trailingSpaceRe, replaceTrailingSpace); + text = + text.slice(0, i + htmlCommentBegin.length) + + clearedContent + + text.slice(j); + } + } + i = j + htmlCommentEnd.length; + } + return text; +}; + +// Escapes a string for use in a RegExp +module.exports.escapeForRegExp = function escapeForRegExp(/** @type {string} */ str) { + return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); +}; + +/** + * Adds ellipsis to the left/right/middle of the specified text. + * + * @param {string} text Text to ellipsify. + * @param {boolean} [start] True iff the start of the text is important. + * @param {boolean} [end] True iff the end of the text is important. + * @returns {string} Ellipsified text. + */ +function ellipsify(text, start, end) { + if (text.length <= 30) { + // Nothing to do + } else if (start && end) { + text = text.slice(0, 15) + "..." + text.slice(-15); + } else if (end) { + text = "..." + text.slice(-30); + } else { + text = text.slice(0, 30) + "..."; + } + return text; +} +module.exports.ellipsify = ellipsify; + +/** + * Adds a generic error object via the onError callback. + * + * @param {RuleOnError} onError RuleOnError instance. + * @param {number} lineNumber Line number. + * @param {string} [detail] Error details. + * @param {string} [context] Error context. + * @param {number[]} [range] Column and length of error. + * @param {RuleOnErrorFixInfo} [fixInfo] RuleOnErrorFixInfo instance. + * @returns {void} + */ +function addError(onError, lineNumber, detail, context, range, fixInfo) { + onError({ + lineNumber, + detail, + context, + range, + fixInfo + }); +} +module.exports.addError = addError; + +/** + * Adds an error object with details conditionally via the onError callback. + * + * @param {RuleOnError} onError RuleOnError instance. + * @param {number} lineNumber Line number. + * @param {Object} expected Expected value. + * @param {Object} actual Actual value. + * @param {string} [detail] Error details. + * @param {string} [context] Error context. + * @param {number[]} [range] Column and length of error. + * @param {RuleOnErrorFixInfo} [fixInfo] RuleOnErrorFixInfo instance. + * @returns {void} + */ +function addErrorDetailIf( + onError, lineNumber, expected, actual, detail, context, range, fixInfo) { + if (expected !== actual) { + addError( + onError, + lineNumber, + "Expected: " + expected + "; Actual: " + actual + + (detail ? "; " + detail : ""), + context, + range, + fixInfo); + } +} +module.exports.addErrorDetailIf = addErrorDetailIf; + +/** + * Adds an error object with context via the onError callback. + * + * @param {RuleOnError} onError RuleOnError instance. + * @param {number} lineNumber Line number. + * @param {string} context Error context. + * @param {boolean} [start] True iff the start of the text is important. + * @param {boolean} [end] True iff the end of the text is important. + * @param {number[]} [range] Column and length of error. + * @param {RuleOnErrorFixInfo} [fixInfo] RuleOnErrorFixInfo instance. + * @returns {void} + */ +function addErrorContext(onError, lineNumber, context, start, end, range, fixInfo) { + // Normalize new line characters so Linux and Windows trim consistently + context = ellipsify(context.replace(newLineRe, "\n"), start, end); + addError(onError, lineNumber, undefined, context, range, fixInfo); +} +module.exports.addErrorContext = addErrorContext; + +/** + * Defines a range within a file (start line/column to end line/column, subset of MicromarkToken). + * + * @typedef {Object} FileRange + * @property {number} startLine Start line (1-based). + * @property {number} startColumn Start column (1-based). + * @property {number} endLine End line (1-based). + * @property {number} endColumn End column (1-based). + */ + +/** + * Returns whether line/column A is less than or equal to line/column B. + * + * @param {number} lineA Line A. + * @param {number} columnA Column A. + * @param {number} lineB Line B. + * @param {number} columnB Column B. + * @returns {boolean} True iff A is less than or equal to B. + */ +const positionLessThanOrEqual = (lineA, columnA, lineB, columnB) => ( + (lineA < lineB) || + ((lineA === lineB) && (columnA <= columnB)) +); + +/** + * Returns whether two ranges (or MicromarkTokens) overlap anywhere. + * + * @param {FileRange|MicromarkToken} rangeA Range A. + * @param {FileRange|MicromarkToken} rangeB Range B. + * @returns {boolean} True iff the two ranges overlap. + */ +module.exports.hasOverlap = function hasOverlap(rangeA, rangeB) { + const lte = positionLessThanOrEqual(rangeA.startLine, rangeA.startColumn, rangeB.startLine, rangeB.startColumn); + const first = lte ? rangeA : rangeB; + const second = lte ? rangeB : rangeA; + return positionLessThanOrEqual(second.startLine, second.startColumn, first.endLine, first.endColumn); +}; + +// Determines if the front matter includes a title +module.exports.frontMatterHasTitle = + function frontMatterHasTitle(/** @type {readonly string[]} */ frontMatterLines, /** @type {string} */ frontMatterTitlePattern) { + const ignoreFrontMatter = + (frontMatterTitlePattern !== undefined) && !frontMatterTitlePattern; + const frontMatterTitleRe = + new RegExp( + String(frontMatterTitlePattern || "^\\s*\"?title\"?\\s*[:=]"), + "i" + ); + return !ignoreFrontMatter && + frontMatterLines.some((line) => frontMatterTitleRe.test(line)); + }; + +/** + * Result object for getReferenceLinkImageData. + * + * @typedef {Object} GetReferenceLinkImageDataResult + * @property {Map} references References. + * @property {Map} shortcuts Shortcuts. + * @property {Map} definitions Definitions. + * @property {[string, number][]} duplicateDefinitions Duplicate definitions. + * @property {number[]} definitionLineIndices Definition line indices. + */ + +/** + * Returns an object with information about reference links and images. + * + * @param {MicromarkToken[]} tokens Micromark tokens. + * @returns {GetReferenceLinkImageDataResult} Reference link/image data. + */ +function getReferenceLinkImageData(tokens) { + const normalizeReference = (/** @type {string} */ s) => s.toLowerCase().trim().replace(/\s+/g, " "); + const getText = (/** @type {MicromarkToken} */ t) => t?.children.filter((c) => c.type !== "blockQuotePrefix").map((c) => c.text).join(""); + /** @type {Map} */ + const references = new Map(); + /** @type {Map} */ + const shortcuts = new Map(); + const addReferenceToDictionary = (/** @type {MicromarkToken} */ token, /** @type {string} */ label, /** @type {boolean} */ isShortcut) => { + const referenceDatum = [ + token.startLine - 1, + token.startColumn - 1, + token.text.length + ]; + const reference = normalizeReference(label); + const dictionary = isShortcut ? shortcuts : references; + const referenceData = dictionary.get(reference) || []; + referenceData.push(referenceDatum); + dictionary.set(reference, referenceData); + }; + /** @type {Map} */ + const definitions = new Map(); + /** @type {number[]} */ + const definitionLineIndices = []; + /** @type {[string, number][]} */ + const duplicateDefinitions = []; + const filteredTokens = + micromark.filterByTypes( + tokens, + [ + // definitionLineIndices + "definition", "gfmFootnoteDefinition", + // definitions and definitionLineIndices + "definitionLabelString", "gfmFootnoteDefinitionLabelString", + // references and shortcuts + "gfmFootnoteCall", "image", "link", + // undefined link labels + "undefinedReferenceCollapsed", "undefinedReferenceFull", "undefinedReferenceShortcut" + ] + ); + for (const token of filteredTokens) { + let labelPrefix = ""; + // eslint-disable-next-line default-case + switch (token.type) { + case "definition": + case "gfmFootnoteDefinition": + // definitionLineIndices + for (let i = token.startLine; i <= token.endLine; i++) { + definitionLineIndices.push(i - 1); + } + break; + case "gfmFootnoteDefinitionLabelString": + labelPrefix = "^"; + case "definitionLabelString": // eslint-disable-line no-fallthrough + { + // definitions and definitionLineIndices + const reference = normalizeReference(`${labelPrefix}${token.text}`); + if (definitions.has(reference)) { + duplicateDefinitions.push([ reference, token.startLine - 1 ]); + } else { + const parent = + micromark.getParentOfType(token, [ "definition" ]); + const destinationString = parent && + micromark.getDescendantsByType(parent, [ "definitionDestination", "definitionDestinationRaw", "definitionDestinationString" ])[0]?.text; + definitions.set( + reference, + [ token.startLine - 1, destinationString || "" ] + ); + } + } + break; + case "gfmFootnoteCall": + case "image": + case "link": + { + // Identify if shortcut or full/collapsed + let isShortcut = (token.children.length === 1); + const isFullOrCollapsed = (token.children.length === 2) && !token.children.some((t) => t.type === "resource"); + const [ labelText ] = micromark.getDescendantsByType(token, [ "label", "labelText" ]); + const [ referenceString ] = micromark.getDescendantsByType(token, [ "reference", "referenceString" ]); + let label = getText(labelText); + // Identify if footnote + if (!isShortcut && !isFullOrCollapsed) { + const [ footnoteCallMarker, footnoteCallString ] = token.children.filter( + (t) => [ "gfmFootnoteCallMarker", "gfmFootnoteCallString" ].includes(t.type) + ); + if (footnoteCallMarker && footnoteCallString) { + label = `${footnoteCallMarker.text}${footnoteCallString.text}`; + isShortcut = true; + } + } + // Track link (handle shortcuts separately due to ambiguity in "text [text] text") + if (isShortcut || isFullOrCollapsed) { + addReferenceToDictionary(token, getText(referenceString) || label, isShortcut); + } + } + break; + case "undefinedReferenceCollapsed": + case "undefinedReferenceFull": + case "undefinedReferenceShortcut": + { + const undefinedReference = micromark.getDescendantsByType(token, [ "undefinedReference" ])[0]; + const label = undefinedReference.children.map((t) => t.text).join(""); + const isShortcut = (token.type === "undefinedReferenceShortcut"); + addReferenceToDictionary(token, label, isShortcut); + } + break; + } + } + return { + references, + shortcuts, + definitions, + duplicateDefinitions, + definitionLineIndices + }; +} +module.exports.getReferenceLinkImageData = getReferenceLinkImageData; + +/** + * Gets the most common line ending, falling back to the platform default. + * + * @param {string} input Markdown content to analyze. + * @param {{EOL: string}} [os] Node.js "os" module. + * @returns {string} Preferred line ending. + */ +function getPreferredLineEnding(input, os) { + let cr = 0; + let lf = 0; + let crlf = 0; + const endings = input.match(newLineRe) || []; + for (const ending of endings) { + // eslint-disable-next-line default-case + switch (ending) { + case "\r": + cr++; + break; + case "\n": + lf++; + break; + case "\r\n": + crlf++; + break; + } + } + let preferredLineEnding = null; + if (!cr && !lf && !crlf) { + preferredLineEnding = (os && os.EOL) || "\n"; + } else if ((lf >= crlf) && (lf >= cr)) { + preferredLineEnding = "\n"; + } else if (crlf >= cr) { + preferredLineEnding = "\r\n"; + } else { + preferredLineEnding = "\r"; + } + return preferredLineEnding; +} +module.exports.getPreferredLineEnding = getPreferredLineEnding; + +/** + * Expands a path with a tilde to an absolute path. + * + * @param {string} file Path that may begin with a tilde. + * @param {{homedir: () => string}} os Node.js "os" module. + * @returns {string} Absolute path (or original path). + */ +function expandTildePath(file, os) { + const homedir = os && os.homedir && os.homedir(); + return homedir ? file.replace(/^~($|\/|\\)/, `${homedir}$1`) : file; +} +module.exports.expandTildePath = expandTildePath; + +/** @typedef {import("../lib/markdownlint.mjs").LintError[]} LintErrors */ +/** @typedef {import("../lib/markdownlint.mjs").LintResults} LintResults */ + +/** + * Converts lint errors from resultVersion 3 to 2. + * + * @param {LintErrors} errors Lint errors (v3). + * @returns {LintErrors} Lint errors (v2). + */ +function convertLintErrorsVersion3To2(errors) { + const noPrevious = { + "ruleNames": [], + "lineNumber": -1 + }; + return errors.filter((error, index, array) => { + // @ts-ignore + delete error.fixInfo; + // @ts-ignore + delete error.severity; + const previous = array[index - 1] || noPrevious; + return ( + (error.ruleNames[0] !== previous.ruleNames[0]) || + (error.lineNumber !== previous.lineNumber) + ); + }); +} + +/** + * Converts lint errors from resultVersion 2 to 1. + * + * @param {LintErrors} errors Lint errors (v2). + * @returns {LintErrors} Lint errors (v1). + */ +function convertLintErrorsVersion2To1(errors) { + for (const error of errors) { + // @ts-ignore + error.ruleName = error.ruleNames[0]; + // @ts-ignore + error.ruleAlias = error.ruleNames[1] || error.ruleName; + // @ts-ignore + delete error.ruleNames; + } + return errors; +} + +/** + * Converts lint errors from resultVersion 2 to 0. + * + * @param {LintErrors} errors Lint errors (v2). + * @returns {LintErrors} Lint errors (v0). + */ +function convertLintErrorsVersion2To0(errors) { + /** @type {Object.} */ + const dictionary = {}; + for (const error of errors) { + const ruleName = error.ruleNames[0]; + const ruleLines = dictionary[ruleName] || []; + ruleLines.push(error.lineNumber); + dictionary[ruleName] = ruleLines; + } + // @ts-ignore + return dictionary; +} + +/** + * Copies and transforms lint results from resultVersion 3 to ?. + * + * @param {LintResults} results Lint results (v3). + * @param {(errors: LintErrors) => LintErrors} transform Lint errors (v?). + * @returns {LintResults} Lint results (v?). + */ +function copyAndTransformResults(results, transform) { + /** @type {Object.} */ + const newResults = {}; + Object.defineProperty(newResults, "toString", { "value": results.toString }); + for (const key of Object.keys(results)) { + const arr = results[key].map((r) => ({ ...r })); + newResults[key] = transform(arr); + } + // @ts-ignore + return newResults; +} + +/** + * Converts lint results from resultVersion 3 to 0. + * + * @param {LintResults} results Lint results (v3). + * @returns {LintResults} Lint results (v0). + */ +module.exports.convertToResultVersion0 = function convertToResultVersion0(results) { + return copyAndTransformResults(results, (r) => convertLintErrorsVersion2To0(convertLintErrorsVersion3To2(r))); +}; + +/** + * Converts lint results from resultVersion 3 to 1. + * + * @param {LintResults} results Lint results (v3). + * @returns {LintResults} Lint results (v1). + */ +module.exports.convertToResultVersion1 = function convertToResultVersion1(results) { + return copyAndTransformResults(results, (r) => convertLintErrorsVersion2To1(convertLintErrorsVersion3To2(r))); +}; + +/** + * Converts lint results from resultVersion 3 to 2. + * + * @param {LintResults} results Lint results (v3). + * @returns {LintResults} Lint results (v2). + */ +module.exports.convertToResultVersion2 = function convertToResultVersion2(results) { + return copyAndTransformResults(results, convertLintErrorsVersion3To2); +}; + +/** + * Formats lint results to an array of strings. + * + * @param {LintResults|undefined} lintResults Lint results. + * @returns {string[]} Lint error strings. + */ +module.exports.formatLintResults = function formatLintResults(lintResults) { + const results = []; + const entries = Object.entries(lintResults || {}); + entries.sort((a, b) => a[0].localeCompare(b[0])); + for (const [ source, lintErrors ] of entries) { + for (const lintError of lintErrors) { + const { lineNumber, ruleNames, ruleDescription, errorDetail, errorContext, errorRange, severity } = lintError; + const rule = ruleNames.join("/"); + const line = `:${lineNumber}`; + const rangeStart = (errorRange && errorRange[0]) || 0; + const column = rangeStart ? `:${rangeStart}` : ""; + const description = ruleDescription; + const detail = (errorDetail ? ` [${errorDetail}]` : ""); + const context = (errorContext ? ` [Context: "${errorContext}"]` : ""); + results.push(`${source}${line}${column} ${severity} ${rule} ${description}${detail}${context}`); + } + } + return results; +}; diff --git a/helpers/micromark-helpers.cjs b/helpers/micromark-helpers.cjs new file mode 100644 index 00000000..a208d684 --- /dev/null +++ b/helpers/micromark-helpers.cjs @@ -0,0 +1,331 @@ +// @ts-check + +"use strict"; + +const { flatTokensSymbol, htmlFlowSymbol, newLineRe } = require("./shared.cjs"); + +// eslint-disable-next-line jsdoc/valid-types +/** @typedef {import("micromark-util-types", { with: { "resolution-mode": "import" } }).TokenType} TokenType */ +/** @typedef {import("../lib/exports.mjs").MicromarkToken} Token */ +// eslint-disable-next-line jsdoc/valid-types +/** @typedef {import("../lib/micromark-types.d.mts", { with: { "resolution-mode": "import" } })} */ + +/** + * Determines if a Micromark token is within an htmlFlow type. + * + * @param {Token} token Micromark token. + * @returns {boolean} True iff the token is within an htmlFlow type. + */ +function inHtmlFlow(token) { + // @ts-ignore + return Boolean(token[htmlFlowSymbol]); +} + +/** + * Returns whether a token is an htmlFlow type containing an HTML comment. + * + * @param {Token} token Micromark token. + * @returns {boolean} True iff token is htmlFlow containing a comment. + */ +function isHtmlFlowComment(token) { + const { text, type } = token; + if ( + (type === "htmlFlow") && + text.startsWith("") + ) { + const comment = text.slice(4, -3); + return ( + !comment.startsWith(">") && + !comment.startsWith("->") && + !comment.endsWith("-") + // The following condition from the CommonMark specification is commented + // to avoid parsing HTML comments that include "--" because that is NOT a + // condition of the HTML specification. + // https://spec.commonmark.org/0.30/#raw-html + // https://html.spec.whatwg.org/multipage/syntax.html#comments + // && !comment.includes("--") + ); + } + return false; +} + +/** + * Adds a range of numbers to a set. + * + * @param {Set} set Set of numbers. + * @param {number} start Starting number. + * @param {number} end Ending number. + * @returns {void} + */ +function addRangeToSet(set, start, end) { + for (let i = start; i <= end; i++) { + set.add(i); + } +} + +/** + * @callback AllowedPredicate + * @param {Token} token Micromark token. + * @returns {boolean} True iff allowed. + */ + +/** + * @callback TransformPredicate + * @param {Token} token Micromark token. + * @returns {Token[]} Child tokens. + */ + +/** + * Filter a list of Micromark tokens by predicate. + * + * @param {Token[]} tokens Micromark tokens. + * @param {AllowedPredicate} allowed Allowed token predicate. + * @param {TransformPredicate} [transformChildren] Transform predicate. + * @returns {Token[]} Filtered tokens. + */ +function filterByPredicate(tokens, allowed, transformChildren) { + const result = []; + const queue = [ + { + "array": tokens, + "index": 0 + } + ]; + while (queue.length > 0) { + const current = queue[queue.length - 1]; + const { array, index } = current; + if (index < array.length) { + const token = array[current.index++]; + if (allowed(token)) { + result.push(token); + } + const { children } = token; + if (children.length > 0) { + const transformed = + transformChildren ? transformChildren(token) : children; + queue.push( + { + "array": transformed, + "index": 0 + } + ); + } + } else { + queue.pop(); + } + } + return result; +} + +/** + * Filter a list of Micromark tokens by type. + * + * @param {Token[]} tokens Micromark tokens. + * @param {TokenType[]} types Types to allow. + * @param {boolean} [htmlFlow] Whether to include htmlFlow content. + * @returns {Token[]} Filtered tokens. + */ +function filterByTypes(tokens, types, htmlFlow) { + const predicate = (/** @type {Token} */ token) => types.includes(token.type) && (htmlFlow || !inHtmlFlow(token)); + /** @type {Token[]} */ + const flatTokens = + // @ts-ignore + tokens[flatTokensSymbol]; + if (flatTokens) { + return flatTokens.filter(predicate); + } + return filterByPredicate(tokens, predicate); +} + +/** + * Gets the blockquote prefix text (if any) for the specified line number. + * + * @param {Token[]} tokens Micromark tokens. + * @param {number} lineNumber Line number to examine. + * @param {number} [count] Number of times to repeat. + * @returns {string} Blockquote prefix text. + */ +function getBlockQuotePrefixText(tokens, lineNumber, count = 1) { + return filterByTypes(tokens, [ "blockQuotePrefix", "linePrefix" ]) + .filter((prefix) => prefix.startLine === lineNumber) + .map((prefix) => prefix.text) + .join("") + .trimEnd() + // eslint-disable-next-line unicorn/prefer-spread + .concat("\n") + .repeat(count); +}; + +/** + * Gets a list of nested Micromark token descendants by type path. + * + * @param {Token|Token[]} parent Micromark token parent or parents. + * @param {(TokenType|TokenType[])[]} typePath Micromark token type path. + * @returns {Token[]} Micromark token descendants. + */ +function getDescendantsByType(parent, typePath) { + let tokens = Array.isArray(parent) ? parent : [ parent ]; + for (const type of typePath) { + const predicate = (/** @type {Token} */ token) => Array.isArray(type) ? type.includes(token.type) : (type === token.type); + tokens = tokens.flatMap((t) => t.children.filter(predicate)); + } + return tokens; +} + +/** + * Gets the heading level of a Micromark heading tokan. + * + * @param {Token} heading Micromark heading token. + * @returns {number} Heading level. + */ +function getHeadingLevel(heading) { + let level = 1; + const headingSequence = heading.children.find( + (child) => [ "atxHeadingSequence", "setextHeadingLine" ].includes(child.type) + ); + // @ts-ignore + const { text } = headingSequence; + if (text[0] === "#") { + level = Math.min(text.length, 6); + } else if (text[0] === "-") { + level = 2; + } + return level; +} + +/** + * Gets the heading style of a Micromark heading tokan. + * + * @param {Token} heading Micromark heading token. + * @returns {"atx" | "atx_closed" | "setext"} Heading style. + */ +function getHeadingStyle(heading) { + if (heading.type === "setextHeading") { + return "setext"; + } + const atxHeadingSequenceLength = heading.children.filter( + (child) => child.type === "atxHeadingSequence" + ).length; + if (atxHeadingSequenceLength === 1) { + return "atx"; + } + return "atx_closed"; +} + +/** + * Gets the heading text of a Micromark heading token. + * + * @param {Token} heading Micromark heading token. + * @returns {string} Heading text. + */ +function getHeadingText(heading) { + return getDescendantsByType(heading, [ [ "atxHeadingText", "setextHeadingText" ] ]) + .flatMap((descendant) => descendant.children.filter((child) => child.type !== "htmlText")) + .map((data) => data.text) + .join("") + .replace(newLineRe, " "); +} + +/** + * HTML tag information. + * + * @typedef {Object} HtmlTagInfo + * @property {boolean} close True iff close tag. + * @property {string} name Tag name. + */ + +/** + * Gets information about the tag in an HTML token. + * + * @param {Token} token Micromark token. + * @returns {HtmlTagInfo | null} HTML tag information. + */ +function getHtmlTagInfo(token) { + const htmlTagNameRe = /^<([^!>][^/\s>]*)/; + if (token.type === "htmlText") { + const match = htmlTagNameRe.exec(token.text); + if (match) { + const name = match[1]; + const close = name.startsWith("/"); + return { + close, + "name": close ? name.slice(1) : name + }; + } + } + return null; +} + +/** + * Gets the nearest parent of the specified type for a Micromark token. + * + * @param {Token} token Micromark token. + * @param {TokenType[]} types Types to allow. + * @returns {Token | null} Parent token. + */ +function getParentOfType(token, types) { + /** @type {Token | null} */ + let current = token; + while ((current = current.parent) && !types.includes(current.type)) { + // Empty + } + return current; +} + +const docfxTabSyntaxRe = /^#tab\//; + +/** + * Returns whether the specified Micromark token looks like a Docfx tab. + * + * @param {Token | null} heading Micromark token. + * @returns {boolean} True iff the token looks like a Docfx tab. + */ +function isDocfxTab(heading) { + // See https://dotnet.github.io/docfx/docs/markdown.html?tabs=linux%2Cdotnet#tabs + if (heading?.type === "atxHeading") { + const headingTexts = getDescendantsByType(heading, [ "atxHeadingText" ]); + if ((headingTexts.length === 1) && (headingTexts[0].children.length === 1) && (headingTexts[0].children[0].type === "link")) { + const resourceDestinationStrings = filterByTypes(headingTexts[0].children[0].children, [ "resourceDestinationString" ]); + return (resourceDestinationStrings.length === 1) && docfxTabSyntaxRe.test(resourceDestinationStrings[0].text); + } + } + return false; +} + +/** + * Set containing token types that do not contain content. + * + * @type {Set} + */ +const nonContentTokens = new Set([ + "blockQuoteMarker", + "blockQuotePrefix", + "blockQuotePrefixWhitespace", + "gfmFootnoteDefinitionIndent", + "lineEnding", + "lineEndingBlank", + "linePrefix", + "listItemIndent", + "undefinedReference", + "undefinedReferenceCollapsed", + "undefinedReferenceFull", + "undefinedReferenceShortcut" +]); + +module.exports = { + addRangeToSet, + filterByPredicate, + filterByTypes, + getBlockQuotePrefixText, + getDescendantsByType, + getHeadingLevel, + getHeadingStyle, + getHeadingText, + getHtmlTagInfo, + getParentOfType, + inHtmlFlow, + isDocfxTab, + isHtmlFlowComment, + nonContentTokens +}; diff --git a/helpers/package.json b/helpers/package.json new file mode 100644 index 00000000..2bad4889 --- /dev/null +++ b/helpers/package.json @@ -0,0 +1,26 @@ +{ + "name": "markdownlint-rule-helpers", + "version": "0.30.0", + "description": "A collection of markdownlint helper functions for custom rules", + "main": "./helpers.cjs", + "exports": { + ".": "./helpers.cjs", + "./micromark": "./micromark-helpers.cjs" + }, + "author": "David Anson (https://dlaa.me/)", + "license": "MIT", + "homepage": "https://github.com/DavidAnson/markdownlint", + "repository": { + "type": "git", + "url": "git+https://github.com/DavidAnson/markdownlint.git" + }, + "bugs": "https://github.com/DavidAnson/markdownlint/issues", + "funding": "https://github.com/sponsors/DavidAnson", + "engines": { + "node": ">=18" + }, + "keywords": [ + "markdownlint", + "markdownlint-rule" + ] +} diff --git a/helpers/shared.cjs b/helpers/shared.cjs new file mode 100644 index 00000000..dfb38c31 --- /dev/null +++ b/helpers/shared.cjs @@ -0,0 +1,16 @@ +// @ts-check + +"use strict"; + +// Symbol for identifing the flat tokens array from micromark parse +module.exports.flatTokensSymbol = Symbol("flat-tokens"); + +// Symbol for identifying the htmlFlow token from micromark parse +module.exports.htmlFlowSymbol = Symbol("html-flow"); + +// Regular expression for matching common newline characters +// See NEWLINES_RE in markdown-it/lib/rules_core/normalize.js +module.exports.newLineRe = /\r\n?|\n/g; + +// Regular expression for matching next lines +module.exports.nextLinesRe = /[\r\n][\s\S]*$/; diff --git a/helpers/test.cjs b/helpers/test.cjs new file mode 100644 index 00000000..cf501b5c --- /dev/null +++ b/helpers/test.cjs @@ -0,0 +1,28 @@ +// @ts-check + +"use strict"; + +// eslint-disable-next-line n/no-extraneous-require +const test = require("ava").default; +const { "exports": packageExports, name } = require("../helpers/package.json"); + +const exportMappings = new Map([ + [ ".", "../helpers/helpers.cjs" ], + [ "./micromark", "../helpers/micromark-helpers.cjs" ] +]); + +test("exportMappings", (t) => { + t.deepEqual( + Object.keys(packageExports), + [ ...exportMappings.keys() ] + ); +}); + +for (const [ exportName, exportPath ] of exportMappings) { + test(exportName, (t) => { + t.is( + require(exportName.replace(/^\./u, name)), + require(exportPath) + ); + }); +} diff --git a/lib/cache.mjs b/lib/cache.mjs new file mode 100644 index 00000000..cc7300bc --- /dev/null +++ b/lib/cache.mjs @@ -0,0 +1,80 @@ +// @ts-check + +import { getReferenceLinkImageData as helpersGetReferenceLinkImageData } from "../helpers/helpers.cjs"; +import { filterByTypes } from "../helpers/micromark-helpers.cjs"; + +/** @typedef {import("markdownlint").RuleParams} RuleParams */ +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ +/** @typedef {import("markdownlint").MicromarkTokenType} MicromarkTokenType */ +/** @typedef {import("../helpers/helpers.cjs").GetReferenceLinkImageDataResult} GetReferenceLinkImageDataResult */ + +/** @type {Map} */ +const map = new Map(); +/** @type {RuleParams | undefined} */ +let params = undefined; + +/** + * Initializes (resets) the cache. + * + * @param {RuleParams} [p] Rule parameters object. + * @returns {void} + */ +export function initialize(p) { + map.clear(); + params = p; +} + +/** + * Gets the cached Micromark token array (for testing). + * + * @returns {MicromarkToken[]} Micromark tokens. + */ +export function micromarkTokens() { + return params?.parsers.micromark.tokens || []; +} + +/** + * Gets a cached object value - computes it and caches it. + * + * @param {string} name Cache object name. + * @param {() => Object} getValue Getter for object value. + * @returns {Object} Object value. + */ +function getCached(name, getValue) { + if (map.has(name)) { + // @ts-ignore + return map.get(name); + } + const value = getValue(); + map.set(name, value); + return value; +} + +/** + * Filters a list of Micromark tokens by type and caches the result. + * + * @param {MicromarkTokenType[]} types Types to allow. + * @param {boolean} [htmlFlow] Whether to include htmlFlow content. + * @returns {MicromarkToken[]} Filtered tokens. + */ +export function filterByTypesCached(types, htmlFlow) { + // @ts-ignore + return getCached( + // eslint-disable-next-line prefer-rest-params + JSON.stringify(arguments), + () => filterByTypes(micromarkTokens(), types, htmlFlow) + ); +} + +/** + * Gets a reference link and image data object. + * + * @returns {GetReferenceLinkImageDataResult} Reference link and image data object. + */ +export function getReferenceLinkImageData() { + // @ts-ignore + return getCached( + getReferenceLinkImageData.name, + () => helpersGetReferenceLinkImageData(micromarkTokens()) + ); +} diff --git a/lib/configuration-strict.d.ts b/lib/configuration-strict.d.ts new file mode 100644 index 00000000..774a8360 --- /dev/null +++ b/lib/configuration-strict.d.ts @@ -0,0 +1,2409 @@ +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface ConfigurationStrict { + /** + * JSON Schema URI (expected by some editors) + */ + $schema?: string; + /** + * Default state for all rules + */ + default?: boolean | ("error" | "warning"); + /** + * Path to configuration file to extend + */ + extends?: string | null; + /** + * MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md + */ + MD001?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md + */ + "heading-increment"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md + */ + MD003?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Heading style + */ + style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed"; + }; + /** + * MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md + */ + "heading-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Heading style + */ + style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed"; + }; + /** + * MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md + */ + MD004?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List style + */ + style?: "consistent" | "asterisk" | "plus" | "dash" | "sublist"; + }; + /** + * MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md + */ + "ul-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List style + */ + style?: "consistent" | "asterisk" | "plus" | "dash" | "sublist"; + }; + /** + * MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md + */ + MD005?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md + */ + "list-indent"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md + */ + MD007?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Spaces for indent + */ + indent?: number; + /** + * Whether to indent the first level of the list + */ + start_indented?: boolean; + /** + * Spaces for first level indent (when start_indented is set) + */ + start_indent?: number; + }; + /** + * MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md + */ + "ul-indent"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Spaces for indent + */ + indent?: number; + /** + * Whether to indent the first level of the list + */ + start_indented?: boolean; + /** + * Spaces for first level indent (when start_indented is set) + */ + start_indent?: number; + }; + /** + * MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md + */ + MD009?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Spaces for line break + */ + br_spaces?: number; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Allow spaces for empty lines in list items + */ + list_item_empty_lines?: boolean; + /** + * Include unnecessary breaks + */ + strict?: boolean; + }; + /** + * MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md + */ + "no-trailing-spaces"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Spaces for line break + */ + br_spaces?: number; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Allow spaces for empty lines in list items + */ + list_item_empty_lines?: boolean; + /** + * Include unnecessary breaks + */ + strict?: boolean; + }; + /** + * MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md + */ + MD010?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Fenced code languages to ignore + */ + ignore_code_languages?: string[]; + /** + * Number of spaces for each hard tab + */ + spaces_per_tab?: number; + }; + /** + * MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md + */ + "no-hard-tabs"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Fenced code languages to ignore + */ + ignore_code_languages?: string[]; + /** + * Number of spaces for each hard tab + */ + spaces_per_tab?: number; + }; + /** + * MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md + */ + MD011?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md + */ + "no-reversed-links"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md + */ + MD012?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Consecutive blank lines + */ + maximum?: number; + }; + /** + * MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md + */ + "no-multiple-blanks"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Consecutive blank lines + */ + maximum?: number; + }; + /** + * MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md + */ + MD013?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Number of characters + */ + line_length?: number; + /** + * Number of characters for headings + */ + heading_line_length?: number; + /** + * Number of characters for code blocks + */ + code_block_line_length?: number; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include tables + */ + tables?: boolean; + /** + * Include headings + */ + headings?: boolean; + /** + * Strict length checking + */ + strict?: boolean; + /** + * Stern length checking + */ + stern?: boolean; + }; + /** + * MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md + */ + "line-length"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Number of characters + */ + line_length?: number; + /** + * Number of characters for headings + */ + heading_line_length?: number; + /** + * Number of characters for code blocks + */ + code_block_line_length?: number; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include tables + */ + tables?: boolean; + /** + * Include headings + */ + headings?: boolean; + /** + * Strict length checking + */ + strict?: boolean; + /** + * Stern length checking + */ + stern?: boolean; + }; + /** + * MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md + */ + MD014?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md + */ + "commands-show-output"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md + */ + MD018?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md + */ + "no-missing-space-atx"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md + */ + MD019?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md + */ + "no-multiple-space-atx"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md + */ + MD020?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md + */ + "no-missing-space-closed-atx"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md + */ + MD021?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md + */ + "no-multiple-space-closed-atx"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md + */ + MD022?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Blank lines above heading + */ + lines_above?: number | number[]; + /** + * Blank lines below heading + */ + lines_below?: number | number[]; + }; + /** + * MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md + */ + "blanks-around-headings"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Blank lines above heading + */ + lines_above?: number | number[]; + /** + * Blank lines below heading + */ + lines_below?: number | number[]; + }; + /** + * MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md + */ + MD023?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md + */ + "heading-start-left"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md + */ + MD024?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Only check sibling headings + */ + siblings_only?: boolean; + }; + /** + * MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md + */ + "no-duplicate-heading"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Only check sibling headings + */ + siblings_only?: boolean; + }; + /** + * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md + */ + MD025?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + /** + * Heading level + */ + level?: number; + }; + /** + * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md + */ + "single-title"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + /** + * Heading level + */ + level?: number; + }; + /** + * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md + */ + "single-h1"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + /** + * Heading level + */ + level?: number; + }; + /** + * MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md + */ + MD026?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md + */ + "no-trailing-punctuation"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md + */ + MD027?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Include list items + */ + list_items?: boolean; + }; + /** + * MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md + */ + "no-multiple-space-blockquote"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Include list items + */ + list_items?: boolean; + }; + /** + * MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md + */ + MD028?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md + */ + "no-blanks-blockquote"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md + */ + MD029?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List style + */ + style?: "one" | "ordered" | "one_or_ordered" | "zero"; + }; + /** + * MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md + */ + "ol-prefix"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List style + */ + style?: "one" | "ordered" | "one_or_ordered" | "zero"; + }; + /** + * MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md + */ + MD030?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Spaces for single-line unordered list items + */ + ul_single?: number; + /** + * Spaces for single-line ordered list items + */ + ol_single?: number; + /** + * Spaces for multi-line unordered list items + */ + ul_multi?: number; + /** + * Spaces for multi-line ordered list items + */ + ol_multi?: number; + }; + /** + * MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md + */ + "list-marker-space"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Spaces for single-line unordered list items + */ + ul_single?: number; + /** + * Spaces for single-line ordered list items + */ + ol_single?: number; + /** + * Spaces for multi-line unordered list items + */ + ul_multi?: number; + /** + * Spaces for multi-line ordered list items + */ + ol_multi?: number; + }; + /** + * MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md + */ + MD031?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Include list items + */ + list_items?: boolean; + }; + /** + * MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md + */ + "blanks-around-fences"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Include list items + */ + list_items?: boolean; + }; + /** + * MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md + */ + MD032?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md + */ + "blanks-around-lists"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md + */ + MD033?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Allowed elements + */ + allowed_elements?: string[]; + /** + * Allowed elements in tables + */ + table_allowed_elements?: string[]; + }; + /** + * MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md + */ + "no-inline-html"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Allowed elements + */ + allowed_elements?: string[]; + /** + * Allowed elements in tables + */ + table_allowed_elements?: string[]; + }; + /** + * MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md + */ + MD034?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md + */ + "no-bare-urls"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md + */ + MD035?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Horizontal rule style + */ + style?: string; + }; + /** + * MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md + */ + "hr-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Horizontal rule style + */ + style?: string; + }; + /** + * MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md + */ + MD036?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md + */ + "no-emphasis-as-heading"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md + */ + MD037?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md + */ + "no-space-in-emphasis"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md + */ + MD038?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md + */ + "no-space-in-code"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md + */ + MD039?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md + */ + "no-space-in-links"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md + */ + MD040?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List of languages + */ + allowed_languages?: string[]; + /** + * Require language only + */ + language_only?: boolean; + }; + /** + * MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md + */ + "fenced-code-language"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List of languages + */ + allowed_languages?: string[]; + /** + * Require language only + */ + language_only?: boolean; + }; + /** + * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md + */ + MD041?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Allow content before first heading + */ + allow_preamble?: boolean; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + /** + * Heading level + */ + level?: number; + }; + /** + * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md + */ + "first-line-heading"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Allow content before first heading + */ + allow_preamble?: boolean; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + /** + * Heading level + */ + level?: number; + }; + /** + * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md + */ + "first-line-h1"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Allow content before first heading + */ + allow_preamble?: boolean; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + /** + * Heading level + */ + level?: number; + }; + /** + * MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md + */ + MD042?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md + */ + "no-empty-links"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md + */ + MD043?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List of headings + */ + headings?: string[]; + /** + * Match case of headings + */ + match_case?: boolean; + }; + /** + * MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md + */ + "required-headings"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List of headings + */ + headings?: string[]; + /** + * Match case of headings + */ + match_case?: boolean; + }; + /** + * MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md + */ + MD044?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List of proper names + */ + names?: string[]; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include HTML elements + */ + html_elements?: boolean; + }; + /** + * MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md + */ + "proper-names"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * List of proper names + */ + names?: string[]; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include HTML elements + */ + html_elements?: boolean; + }; + /** + * MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md + */ + MD045?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md + */ + "no-alt-text"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md + */ + MD046?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Block style + */ + style?: "consistent" | "fenced" | "indented"; + }; + /** + * MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md + */ + "code-block-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Block style + */ + style?: "consistent" | "fenced" | "indented"; + }; + /** + * MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md + */ + MD047?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md + */ + "single-trailing-newline"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md + */ + MD048?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Code fence style + */ + style?: "consistent" | "backtick" | "tilde"; + }; + /** + * MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md + */ + "code-fence-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Code fence style + */ + style?: "consistent" | "backtick" | "tilde"; + }; + /** + * MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md + */ + MD049?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Emphasis style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md + */ + "emphasis-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Emphasis style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md + */ + MD050?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Strong style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md + */ + "strong-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Strong style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md + */ + MD051?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Ignore case of fragments + */ + ignore_case?: boolean; + /** + * Pattern for ignoring additional fragments + */ + ignored_pattern?: string; + }; + /** + * MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md + */ + "link-fragments"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Ignore case of fragments + */ + ignore_case?: boolean; + /** + * Pattern for ignoring additional fragments + */ + ignored_pattern?: string; + }; + /** + * MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md + */ + MD052?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Ignored link labels + */ + ignored_labels?: string[]; + /** + * Include shortcut syntax + */ + shortcut_syntax?: boolean; + }; + /** + * MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md + */ + "reference-links-images"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Ignored link labels + */ + ignored_labels?: string[]; + /** + * Include shortcut syntax + */ + shortcut_syntax?: boolean; + }; + /** + * MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md + */ + MD053?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Ignored definitions + */ + ignored_definitions?: string[]; + }; + /** + * MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md + */ + "link-image-reference-definitions"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Ignored definitions + */ + ignored_definitions?: string[]; + }; + /** + * MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md + */ + MD054?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Allow autolinks + */ + autolink?: boolean; + /** + * Allow inline links and images + */ + inline?: boolean; + /** + * Allow full reference links and images + */ + full?: boolean; + /** + * Allow collapsed reference links and images + */ + collapsed?: boolean; + /** + * Allow shortcut reference links and images + */ + shortcut?: boolean; + /** + * Allow URLs as inline links + */ + url_inline?: boolean; + }; + /** + * MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md + */ + "link-image-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Allow autolinks + */ + autolink?: boolean; + /** + * Allow inline links and images + */ + inline?: boolean; + /** + * Allow full reference links and images + */ + full?: boolean; + /** + * Allow collapsed reference links and images + */ + collapsed?: boolean; + /** + * Allow shortcut reference links and images + */ + shortcut?: boolean; + /** + * Allow URLs as inline links + */ + url_inline?: boolean; + }; + /** + * MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md + */ + MD055?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Table pipe style + */ + style?: "consistent" | "leading_only" | "trailing_only" | "leading_and_trailing" | "no_leading_or_trailing"; + }; + /** + * MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md + */ + "table-pipe-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Table pipe style + */ + style?: "consistent" | "leading_only" | "trailing_only" | "leading_and_trailing" | "no_leading_or_trailing"; + }; + /** + * MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md + */ + MD056?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md + */ + "table-column-count"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md + */ + MD058?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md + */ + "blanks-around-tables"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + }; + /** + * MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md + */ + MD059?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Prohibited link texts + */ + prohibited_texts?: string[]; + }; + /** + * MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md + */ + "descriptive-link-text"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Prohibited link texts + */ + prohibited_texts?: string[]; + }; + /** + * MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md + */ + MD060?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Table column style + */ + style?: "any" | "aligned" | "compact" | "tight"; + /** + * Aligned delimiter columns + */ + aligned_delimiter?: boolean; + }; + /** + * MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md + */ + "table-column-style"?: + | boolean + | ("error" | "warning") + | { + /** + * Whether to enable the rule + */ + enabled?: boolean; + /** + * Rule severity + */ + severity?: "error" | "warning"; + /** + * Table column style + */ + style?: "any" | "aligned" | "compact" | "tight"; + /** + * Aligned delimiter columns + */ + aligned_delimiter?: boolean; + }; + /** + * headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043 + */ + headings?: boolean | ("error" | "warning"); + /** + * bullet : MD004, MD005, MD007, MD032 + */ + bullet?: boolean | ("error" | "warning"); + /** + * ul : MD004, MD005, MD007, MD030, MD032 + */ + ul?: boolean | ("error" | "warning"); + /** + * indentation : MD005, MD007, MD027 + */ + indentation?: boolean | ("error" | "warning"); + /** + * whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039 + */ + whitespace?: boolean | ("error" | "warning"); + /** + * hard_tab : MD010 + */ + hard_tab?: boolean | ("error" | "warning"); + /** + * links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059 + */ + links?: boolean | ("error" | "warning"); + /** + * blank_lines : MD012, MD022, MD031, MD032, MD047 + */ + blank_lines?: boolean | ("error" | "warning"); + /** + * line_length : MD013 + */ + line_length?: boolean | ("error" | "warning"); + /** + * code : MD014, MD031, MD038, MD040, MD046, MD048 + */ + code?: boolean | ("error" | "warning"); + /** + * atx : MD018, MD019 + */ + atx?: boolean | ("error" | "warning"); + /** + * spaces : MD018, MD019, MD020, MD021, MD023 + */ + spaces?: boolean | ("error" | "warning"); + /** + * atx_closed : MD020, MD021 + */ + atx_closed?: boolean | ("error" | "warning"); + /** + * blockquote : MD027, MD028 + */ + blockquote?: boolean | ("error" | "warning"); + /** + * ol : MD029, MD030, MD032 + */ + ol?: boolean | ("error" | "warning"); + /** + * html : MD033 + */ + html?: boolean | ("error" | "warning"); + /** + * url : MD034 + */ + url?: boolean | ("error" | "warning"); + /** + * hr : MD035 + */ + hr?: boolean | ("error" | "warning"); + /** + * emphasis : MD036, MD037, MD049, MD050 + */ + emphasis?: boolean | ("error" | "warning"); + /** + * language : MD040 + */ + language?: boolean | ("error" | "warning"); + /** + * spelling : MD044 + */ + spelling?: boolean | ("error" | "warning"); + /** + * accessibility : MD045, MD059 + */ + accessibility?: boolean | ("error" | "warning"); + /** + * images : MD045, MD052, MD053, MD054 + */ + images?: boolean | ("error" | "warning"); + /** + * table : MD055, MD056, MD058, MD060 + */ + table?: boolean | ("error" | "warning"); +} diff --git a/lib/configuration.d.ts b/lib/configuration.d.ts new file mode 100644 index 00000000..f6991873 --- /dev/null +++ b/lib/configuration.d.ts @@ -0,0 +1,8 @@ +import type { ConfigurationStrict } from "./configuration-strict.d.ts"; + +export interface Configuration extends ConfigurationStrict { + /** + * Index signature for arbitrary custom rules. + */ + [k: string]: unknown; +} diff --git a/lib/constants.mjs b/lib/constants.mjs new file mode 100644 index 00000000..3d61ad68 --- /dev/null +++ b/lib/constants.mjs @@ -0,0 +1,14 @@ +// @ts-check + +/** @type {string[]} */ +export const deprecatedRuleNames = []; +export const fixableRuleNames = [ + "MD004", "MD005", "MD007", "MD009", "MD010", "MD011", + "MD012", "MD014", "MD018", "MD019", "MD020", "MD021", + "MD022", "MD023", "MD026", "MD027", "MD029", "MD030", + "MD031", "MD032", "MD034", "MD037", "MD038", "MD039", + "MD044", "MD047", "MD049", "MD050", "MD051", "MD053", + "MD054", "MD058" +]; +export const homepage = "https://github.com/DavidAnson/markdownlint"; +export const version = "0.40.0"; diff --git a/lib/defer-require.cjs b/lib/defer-require.cjs new file mode 100644 index 00000000..f52a39bc --- /dev/null +++ b/lib/defer-require.cjs @@ -0,0 +1,18 @@ +// @ts-check + +"use strict"; + +/* eslint-disable jsdoc/reject-any-type */ + +/** + * Calls require for markdownit.cjs. Used to synchronously defer loading because module.createRequire is buggy under webpack (https://github.com/webpack/webpack/issues/16724). + * + * @returns {any} Exported module content. + */ +function requireMarkdownItCjs() { + return require("./markdownit.cjs"); +} + +module.exports = { + requireMarkdownItCjs +}; diff --git a/lib/exports-async.d.mts b/lib/exports-async.d.mts new file mode 100644 index 00000000..72e1d8c6 --- /dev/null +++ b/lib/exports-async.d.mts @@ -0,0 +1 @@ +export { lintAsync as lint, readConfigAsync as readConfig } from "./markdownlint.mjs"; diff --git a/lib/exports-async.mjs b/lib/exports-async.mjs new file mode 100644 index 00000000..a3902247 --- /dev/null +++ b/lib/exports-async.mjs @@ -0,0 +1,3 @@ +// @ts-check + +export { lintAsync as lint, readConfigAsync as readConfig } from "./markdownlint.mjs"; diff --git a/lib/exports-promise.d.mts b/lib/exports-promise.d.mts new file mode 100644 index 00000000..27ef95d2 --- /dev/null +++ b/lib/exports-promise.d.mts @@ -0,0 +1 @@ +export { extendConfigPromise as extendConfig, lintPromise as lint, readConfigPromise as readConfig } from "./markdownlint.mjs"; diff --git a/lib/exports-promise.mjs b/lib/exports-promise.mjs new file mode 100644 index 00000000..5ba29690 --- /dev/null +++ b/lib/exports-promise.mjs @@ -0,0 +1,3 @@ +// @ts-check + +export { extendConfigPromise as extendConfig, lintPromise as lint, readConfigPromise as readConfig } from "./markdownlint.mjs"; diff --git a/lib/exports-sync.d.mts b/lib/exports-sync.d.mts new file mode 100644 index 00000000..8a26d428 --- /dev/null +++ b/lib/exports-sync.d.mts @@ -0,0 +1 @@ +export { lintSync as lint, readConfigSync as readConfig } from "./markdownlint.mjs"; diff --git a/lib/exports-sync.mjs b/lib/exports-sync.mjs new file mode 100644 index 00000000..636fc94e --- /dev/null +++ b/lib/exports-sync.mjs @@ -0,0 +1,3 @@ +// @ts-check + +export { lintSync as lint, readConfigSync as readConfig } from "./markdownlint.mjs"; diff --git a/lib/exports.d.mts b/lib/exports.d.mts new file mode 100644 index 00000000..64f50b53 --- /dev/null +++ b/lib/exports.d.mts @@ -0,0 +1,29 @@ +export { resolveModule } from "./resolve-module.cjs"; +export type Configuration = import("./markdownlint.mjs").Configuration; +export type ConfigurationParser = import("./markdownlint.mjs").ConfigurationParser; +export type ConfigurationStrict = import("./markdownlint.mjs").ConfigurationStrict; +export type FixInfo = import("./markdownlint.mjs").FixInfo; +export type FixInfoNormalized = import("./markdownlint.mjs").FixInfoNormalized; +export type LintCallback = import("./markdownlint.mjs").LintCallback; +export type LintContentCallback = import("./markdownlint.mjs").LintContentCallback; +export type LintError = import("./markdownlint.mjs").LintError; +export type LintResults = import("./markdownlint.mjs").LintResults; +export type MarkdownItFactory = import("./markdownlint.mjs").MarkdownItFactory; +export type MarkdownItToken = import("./markdownlint.mjs").MarkdownItToken; +export type MarkdownParsers = import("./markdownlint.mjs").MarkdownParsers; +export type MicromarkToken = import("./markdownlint.mjs").MicromarkToken; +export type MicromarkTokenType = import("./markdownlint.mjs").MicromarkTokenType; +export type Options = import("./markdownlint.mjs").Options; +export type ParserMarkdownIt = import("./markdownlint.mjs").ParserMarkdownIt; +export type ParserMicromark = import("./markdownlint.mjs").ParserMicromark; +export type Plugin = import("./markdownlint.mjs").Plugin; +export type ReadConfigCallback = import("./markdownlint.mjs").ReadConfigCallback; +export type ResolveConfigExtendsCallback = import("./markdownlint.mjs").ResolveConfigExtendsCallback; +export type Rule = import("./markdownlint.mjs").Rule; +export type RuleConfiguration = import("./markdownlint.mjs").RuleConfiguration; +export type RuleFunction = import("./markdownlint.mjs").RuleFunction; +export type RuleOnError = import("./markdownlint.mjs").RuleOnError; +export type RuleOnErrorFixInfo = import("./markdownlint.mjs").RuleOnErrorFixInfo; +export type RuleOnErrorInfo = import("./markdownlint.mjs").RuleOnErrorInfo; +export type RuleParams = import("./markdownlint.mjs").RuleParams; +export { applyFix, applyFixes, getVersion } from "./markdownlint.mjs"; diff --git a/lib/exports.mjs b/lib/exports.mjs new file mode 100644 index 00000000..b27030d4 --- /dev/null +++ b/lib/exports.mjs @@ -0,0 +1,32 @@ +// @ts-check + +export { applyFix, applyFixes, getVersion } from "./markdownlint.mjs"; +export { resolveModule } from "./resolve-module.cjs"; + +/** @typedef {import("./markdownlint.mjs").Configuration} Configuration */ +/** @typedef {import("./markdownlint.mjs").ConfigurationParser} ConfigurationParser */ +/** @typedef {import("./markdownlint.mjs").ConfigurationStrict} ConfigurationStrict */ +/** @typedef {import("./markdownlint.mjs").FixInfo} FixInfo */ +/** @typedef {import("./markdownlint.mjs").FixInfoNormalized} FixInfoNormalized */ +/** @typedef {import("./markdownlint.mjs").LintCallback} LintCallback */ +/** @typedef {import("./markdownlint.mjs").LintContentCallback} LintContentCallback */ +/** @typedef {import("./markdownlint.mjs").LintError} LintError */ +/** @typedef {import("./markdownlint.mjs").LintResults} LintResults */ +/** @typedef {import("./markdownlint.mjs").MarkdownItFactory} MarkdownItFactory */ +/** @typedef {import("./markdownlint.mjs").MarkdownItToken} MarkdownItToken */ +/** @typedef {import("./markdownlint.mjs").MarkdownParsers} MarkdownParsers */ +/** @typedef {import("./markdownlint.mjs").MicromarkToken} MicromarkToken */ +/** @typedef {import("./markdownlint.mjs").MicromarkTokenType} MicromarkTokenType */ +/** @typedef {import("./markdownlint.mjs").Options} Options */ +/** @typedef {import("./markdownlint.mjs").ParserMarkdownIt} ParserMarkdownIt */ +/** @typedef {import("./markdownlint.mjs").ParserMicromark} ParserMicromark */ +/** @typedef {import("./markdownlint.mjs").Plugin} Plugin */ +/** @typedef {import("./markdownlint.mjs").ReadConfigCallback} ReadConfigCallback */ +/** @typedef {import("./markdownlint.mjs").ResolveConfigExtendsCallback} ResolveConfigExtendsCallback */ +/** @typedef {import("./markdownlint.mjs").Rule} Rule */ +/** @typedef {import("./markdownlint.mjs").RuleConfiguration} RuleConfiguration */ +/** @typedef {import("./markdownlint.mjs").RuleFunction} RuleFunction */ +/** @typedef {import("./markdownlint.mjs").RuleOnError} RuleOnError */ +/** @typedef {import("./markdownlint.mjs").RuleOnErrorFixInfo} RuleOnErrorFixInfo */ +/** @typedef {import("./markdownlint.mjs").RuleOnErrorInfo} RuleOnErrorInfo */ +/** @typedef {import("./markdownlint.mjs").RuleParams} RuleParams */ diff --git a/lib/markdownit.cjs b/lib/markdownit.cjs new file mode 100644 index 00000000..51013985 --- /dev/null +++ b/lib/markdownit.cjs @@ -0,0 +1,170 @@ +// @ts-check + +"use strict"; + +const { newLineRe } = require("../helpers"); + +// @ts-expect-error https://github.com/microsoft/TypeScript/issues/52529 +/** @typedef {import("markdownlint").MarkdownIt} MarkdownIt */ +/** @typedef {import("markdownlint").MarkdownItToken} MarkdownItToken */ +/** @typedef {import("markdownlint").Plugin} Plugin */ + +/** + * @callback InlineCodeSpanCallback + * @param {string} code Code content. + * @param {number} lineIndex Line index (0-based). + * @param {number} columnIndex Column index (0-based). + * @param {number} ticks Count of backticks. + * @returns {void} + */ + +/** + * Calls the provided function for each inline code span's content. + * + * @param {string} input Markdown content. + * @param {InlineCodeSpanCallback} handler Callback function taking (code, + * lineIndex, columnIndex, ticks). + * @returns {void} + */ +function forEachInlineCodeSpan(input, handler) { + const backtickRe = /`+/g; + let match = null; + const backticksLengthAndIndex = []; + while ((match = backtickRe.exec(input)) !== null) { + backticksLengthAndIndex.push([ match[0].length, match.index ]); + } + const newLinesIndex = []; + while ((match = newLineRe.exec(input)) !== null) { + newLinesIndex.push(match.index); + } + let lineIndex = 0; + let lineStartIndex = 0; + let k = 0; + for (let i = 0; i < backticksLengthAndIndex.length - 1; i++) { + const [ startLength, startIndex ] = backticksLengthAndIndex[i]; + if ((startIndex === 0) || (input[startIndex - 1] !== "\\")) { + for (let j = i + 1; j < backticksLengthAndIndex.length; j++) { + const [ endLength, endIndex ] = backticksLengthAndIndex[j]; + if (startLength === endLength) { + for (; k < newLinesIndex.length; k++) { + const newLineIndex = newLinesIndex[k]; + if (startIndex < newLineIndex) { + break; + } + lineIndex++; + lineStartIndex = newLineIndex + 1; + } + const columnIndex = startIndex - lineStartIndex + startLength; + handler( + input.slice(startIndex + startLength, endIndex), + lineIndex, + columnIndex, + startLength + ); + i = j; + break; + } + } + } + } +} + +/** + * Freeze all freeze-able members of a token and its children. + * + * @param {MarkdownItToken} token A markdown-it token. + * @returns {void} + */ +function freezeToken(token) { + if (token.attrs) { + for (const attr of token.attrs) { + Object.freeze(attr); + } + Object.freeze(token.attrs); + } + if (token.children) { + for (const child of token.children) { + freezeToken(child); + } + Object.freeze(token.children); + } + if (token.map) { + Object.freeze(token.map); + } + Object.freeze(token); +} + +/** + * Annotate tokens with line/lineNumber and freeze them. + * + * @param {import("markdown-it").Token[]} tokens Array of markdown-it tokens. + * @param {string[]} lines Lines of Markdown content. + * @returns {void} + */ +function annotateAndFreezeTokens(tokens, lines) { + let trMap = null; + /** @type {MarkdownItToken[]} */ + // @ts-ignore + const markdownItTokens = tokens; + for (const token of markdownItTokens) { + // Provide missing maps for table content + if (token.type === "tr_open") { + trMap = token.map; + } else if (token.type === "tr_close") { + trMap = null; + } + if (!token.map && trMap) { + token.map = [ ...trMap ]; + } + // Update token metadata + if (token.map) { + token.line = lines[token.map[0]]; + token.lineNumber = token.map[0] + 1; + // Trim bottom of token to exclude whitespace lines + while (token.map[1] && !((lines[token.map[1] - 1] || "").trim())) { + token.map[1]--; + } + } + // Annotate children with lineNumber + if (token.children) { + /** @type {number[]} */ + const codeSpanExtraLines = []; + if (token.children.some((child) => child.type === "code_inline")) { + forEachInlineCodeSpan(token.content, (code) => { + codeSpanExtraLines.push(code.split(newLineRe).length - 1); + }); + } + let lineNumber = token.lineNumber; + for (const child of token.children) { + child.lineNumber = lineNumber; + child.line = lines[lineNumber - 1]; + if ((child.type === "softbreak") || (child.type === "hardbreak")) { + lineNumber++; + } else if (child.type === "code_inline") { + lineNumber += codeSpanExtraLines.shift() || 0; + } + } + } + freezeToken(token); + } + Object.freeze(tokens); +} + +/** + * Gets an array of markdown-it tokens for the input. + * + * @param {MarkdownIt} markdownIt Instance of the markdown-it parser. + * @param {string} content Markdown content. + * @param {string[]} lines Lines of Markdown content. + * @returns {MarkdownItToken[]} Array of markdown-it tokens. + */ +function getMarkdownItTokens(markdownIt, content, lines) { + const tokens = markdownIt.parse(content, {}); + annotateAndFreezeTokens(tokens, lines); + return tokens; +}; + +module.exports = { + forEachInlineCodeSpan, + getMarkdownItTokens +}; diff --git a/lib/markdownlint.d.mts b/lib/markdownlint.d.mts new file mode 100644 index 00000000..85577914 --- /dev/null +++ b/lib/markdownlint.d.mts @@ -0,0 +1,600 @@ +/** + * Lint specified Markdown files. + * + * @param {Options | null} options Configuration options. + * @param {LintCallback} callback Callback (err, result) function. + * @returns {void} + */ +export function lintAsync(options: Options | null, callback: LintCallback): void; +/** + * Lint specified Markdown files. + * + * @param {Options | null} options Configuration options. + * @returns {Promise} Results object. + */ +export function lintPromise(options: Options | null): Promise; +/** + * Lint specified Markdown files. + * + * @param {Options | null} options Configuration options. + * @returns {LintResults} Results object. + */ +export function lintSync(options: Options | null): LintResults; +/** + * Extend specified configuration object. + * + * @param {Configuration} config Configuration object. + * @param {string} file Configuration file name. + * @param {ConfigurationParser[] | undefined} parsers Parsing function(s). + * @param {FsLike} fs File system implementation. + * @returns {Promise} Configuration object. + */ +export function extendConfigPromise(config: Configuration, file: string, parsers: ConfigurationParser[] | undefined, fs: FsLike): Promise; +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[] | ReadConfigCallback} [parsers] Parsing function(s). + * @param {FsLike | ReadConfigCallback} [fs] File system implementation. + * @param {ReadConfigCallback} [callback] Callback (err, result) function. + * @returns {void} + */ +export function readConfigAsync(file: string, parsers?: ConfigurationParser[] | ReadConfigCallback, fs?: FsLike | ReadConfigCallback, callback?: ReadConfigCallback): void; +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[]} [parsers] Parsing function(s). + * @param {FsLike} [fs] File system implementation. + * @returns {Promise} Configuration object. + */ +export function readConfigPromise(file: string, parsers?: ConfigurationParser[], fs?: FsLike): Promise; +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[]} [parsers] Parsing function(s). + * @param {FsLike} [fs] File system implementation. + * @returns {Configuration} Configuration object. + */ +export function readConfigSync(file: string, parsers?: ConfigurationParser[], fs?: FsLike): Configuration; +/** + * Applies the specified fix to a Markdown content line. + * + * @param {string} line Line of Markdown content. + * @param {FixInfo} fixInfo FixInfo instance. + * @param {string} [lineEnding] Line ending to use. + * @returns {string | null} Fixed content or null if deleted. + */ +export function applyFix(line: string, fixInfo: FixInfo, lineEnding?: string): string | null; +/** + * Applies as many of the specified fixes as possible to Markdown content. + * + * @param {string} input Lines of Markdown content. + * @param {LintError[]} errors LintError instances. + * @returns {string} Fixed content. + */ +export function applyFixes(input: string, errors: LintError[]): string; +/** + * Gets the (semantic) version of the library. + * + * @returns {string} SemVer string. + */ +export function getVersion(): string; +/** + * Result object for removeFrontMatter. + */ +export type RemoveFrontMatterResult = { + /** + * Markdown content. + */ + content: string; + /** + * Front matter lines. + */ + frontMatterLines: string[]; +}; +/** + * Result object for getEffectiveConfig. + */ +export type GetEffectiveConfigResult = { + /** + * Effective configuration. + */ + effectiveConfig: Configuration; + /** + * Rules enabled. + */ + rulesEnabled: Map; + /** + * Rules severity. + */ + rulesSeverity: Map; +}; +/** + * Result object for getEnabledRulesPerLineNumber. + */ +export type EnabledRulesPerLineNumberResult = { + /** + * Effective configuration. + */ + effectiveConfig: Configuration; + /** + * Enabled rules per line number. + */ + enabledRulesPerLineNumber: Map[]; + /** + * Enabled rule list. + */ + enabledRuleList: Rule[]; + /** + * Rules severity. + */ + rulesSeverity: Map; +}; +/** + * Node fs instance (or compatible object). + */ +export type FsLike = { + /** + * access method. + */ + access: (path: string, callback: (err: Error) => void) => void; + /** + * accessSync method. + */ + accessSync: (path: string) => void; + /** + * readFile method. + */ + readFile: (path: string, encoding: string, callback: (err: Error, data: string) => void) => void; + /** + * readFileSync method. + */ + readFileSync: (path: string, encoding: string) => string; +}; +/** + * Function to implement rule logic. + */ +export type RuleFunction = (params: RuleParams, onError: RuleOnError) => void; +/** + * Rule parameters. + */ +export type RuleParams = { + /** + * File/string name. + */ + name: string; + /** + * Markdown parser data. + */ + parsers: MarkdownParsers; + /** + * File/string lines. + */ + lines: readonly string[]; + /** + * Front matter lines. + */ + frontMatterLines: readonly string[]; + /** + * Rule configuration. + */ + config: RuleConfiguration; + /** + * Version of the markdownlint library. + */ + version: string; +}; +/** + * Markdown parser data. + */ +export type MarkdownParsers = { + /** + * Markdown parser data from markdown-it (only present when Rule.parser is "markdownit"). + */ + markdownit: ParserMarkdownIt; + /** + * Markdown parser data from micromark (only present when Rule.parser is "micromark"). + */ + micromark: ParserMicromark; +}; +/** + * Markdown parser data from markdown-it. + */ +export type ParserMarkdownIt = { + /** + * Token objects from markdown-it. + */ + tokens: MarkdownItToken[]; +}; +/** + * Markdown parser data from micromark. + */ +export type ParserMicromark = { + /** + * Token objects from micromark. + */ + tokens: MicromarkToken[]; +}; +/** + * markdown-it token. + */ +export type MarkdownItToken = { + /** + * HTML attributes. + */ + attrs: string[][]; + /** + * Block-level token. + */ + block: boolean; + /** + * Child nodes. + */ + children: MarkdownItToken[]; + /** + * Tag contents. + */ + content: string; + /** + * Ignore element. + */ + hidden: boolean; + /** + * Fence info. + */ + info: string; + /** + * Nesting level. + */ + level: number; + /** + * Beginning/ending line numbers. + */ + map: number[]; + /** + * Markup text. + */ + markup: string; + /** + * Arbitrary data. + */ + meta: any; + /** + * Level change. + */ + nesting: number; + /** + * HTML tag name. + */ + tag: string; + /** + * Token type. + */ + type: string; + /** + * Line number (1-based). + */ + lineNumber: number; + /** + * Line content. + */ + line: string; +}; +export type MicromarkTokenType = import("micromark-util-types").TokenType; +/** + * micromark token. + */ +export type MicromarkToken = { + /** + * Token type. + */ + type: MicromarkTokenType; + /** + * Start line (1-based). + */ + startLine: number; + /** + * Start column (1-based). + */ + startColumn: number; + /** + * End line (1-based). + */ + endLine: number; + /** + * End column (1-based). + */ + endColumn: number; + /** + * Token text. + */ + text: string; + /** + * Child tokens. + */ + children: MicromarkToken[]; + /** + * Parent token. + */ + parent: MicromarkToken | null; +}; +/** + * Error-reporting callback. + */ +export type RuleOnError = (onErrorInfo: RuleOnErrorInfo) => void; +/** + * Fix information for RuleOnError callback. + */ +export type RuleOnErrorInfo = { + /** + * Line number (1-based). + */ + lineNumber: number; + /** + * Detail about the error. + */ + detail?: string; + /** + * Context for the error. + */ + context?: string; + /** + * Link to more information. + */ + information?: URL; + /** + * Column number (1-based) and length. + */ + range?: number[]; + /** + * Fix information. + */ + fixInfo?: RuleOnErrorFixInfo; +}; +/** + * Fix information for RuleOnErrorInfo. + */ +export type RuleOnErrorFixInfo = { + /** + * Line number (1-based). + */ + lineNumber?: number; + /** + * Column of the fix (1-based). + */ + editColumn?: number; + /** + * Count of characters to delete. + */ + deleteCount?: number; + /** + * Text to insert (after deleting). + */ + insertText?: string; +}; +/** + * Rule definition. + */ +export type Rule = { + /** + * Rule name(s). + */ + names: string[]; + /** + * Rule description. + */ + description: string; + /** + * Link to more information. + */ + information?: URL; + /** + * Rule tag(s). + */ + tags: string[]; + /** + * Parser used. + */ + parser: "markdownit" | "micromark" | "none"; + /** + * True if asynchronous. + */ + asynchronous?: boolean; + /** + * Rule implementation. + */ + function: RuleFunction; +}; +/** + * Method used by the markdown-it parser to parse input. + */ +export type MarkdownItParse = (src: string, env: any) => any[]; +/** + * Instance of the markdown-it parser. + */ +export type MarkdownIt = { + /** + * Method to parse input. + */ + parse: MarkdownItParse; +}; +/** + * Gets an instance of the markdown-it parser. Any plugins should already have been loaded. + */ +export type MarkdownItFactory = () => MarkdownIt | Promise; +/** + * Configuration options. + */ +export type Options = { + /** + * Configuration object. + */ + config?: Configuration; + /** + * Configuration parsers. + */ + configParsers?: ConfigurationParser[]; + /** + * Custom rules. + */ + customRules?: Rule[] | Rule; + /** + * Files to lint. + */ + files?: string[] | string; + /** + * Front matter pattern. + */ + frontMatter?: RegExp | null; + /** + * File system implementation. + */ + fs?: FsLike; + /** + * True to catch exceptions. + */ + handleRuleFailures?: boolean; + /** + * Function to create a markdown-it parser. + */ + markdownItFactory?: MarkdownItFactory; + /** + * True to ignore HTML directives. + */ + noInlineConfig?: boolean; + /** + * Strings to lint. + */ + strings?: { + [x: string]: string; + }; +}; +/** + * A markdown-it plugin. + */ +export type Plugin = any[]; +/** + * Lint results. + */ +export type LintResults = { + [x: string]: LintError[]; +}; +/** + * Lint error. + */ +export type LintError = { + /** + * Line number (1-based). + */ + lineNumber: number; + /** + * Rule name(s). + */ + ruleNames: string[]; + /** + * Rule description. + */ + ruleDescription: string; + /** + * Link to more information. + */ + ruleInformation: string | null; + /** + * Detail about the error. + */ + errorDetail: string | null; + /** + * Context for the error. + */ + errorContext: string | null; + /** + * Column number (1-based) and length. + */ + errorRange: number[] | null; + /** + * Fix information. + */ + fixInfo: FixInfo | null; + /** + * Severity of the error. + */ + severity: "error" | "warning"; +}; +/** + * Fix information. + */ +export type FixInfo = { + /** + * Line number (1-based). + */ + lineNumber?: number; + /** + * Column of the fix (1-based). + */ + editColumn?: number; + /** + * Count of characters to delete. + */ + deleteCount?: number; + /** + * Text to insert (after deleting). + */ + insertText?: string; +}; +/** + * FixInfo with all optional properties present. + */ +export type FixInfoNormalized = { + /** + * Line number (1-based). + */ + lineNumber: number; + /** + * Column of the fix (1-based). + */ + editColumn: number; + /** + * Count of characters to delete. + */ + deleteCount: number; + /** + * Text to insert (after deleting). + */ + insertText: string; +}; +/** + * Called with the result of linting a string or document. + */ +export type LintContentCallback = (error: Error | null, result?: LintError[]) => void; +/** + * Called with the result of the lint function. + */ +export type LintCallback = (error: Error | null, results?: LintResults) => void; +/** + * Configuration object for linting rules. For the JSON schema, see + * {@link ../schema/markdownlint-config-schema.json}. + */ +export type Configuration = import("./configuration.d.ts").Configuration; +/** + * Configuration object for linting rules strictly. For the JSON schema, see + * {@link ../schema/markdownlint-config-schema-strict.json}. + */ +export type ConfigurationStrict = import("./configuration-strict.d.ts").ConfigurationStrict; +/** + * Rule configuration. + */ +export type RuleConfiguration = boolean | any; +/** + * Parses a configuration string and returns a configuration object. + */ +export type ConfigurationParser = (text: string) => Configuration; +/** + * Called with the result of the readConfig function. + */ +export type ReadConfigCallback = (err: Error | null, config?: Configuration) => void; +/** + * Called with the result of the resolveConfigExtends function. + */ +export type ResolveConfigExtendsCallback = (err: Error | null, path?: string) => void; diff --git a/lib/markdownlint.js b/lib/markdownlint.js deleted file mode 100644 index 6cdf9d3f..00000000 --- a/lib/markdownlint.js +++ /dev/null @@ -1,231 +0,0 @@ -"use strict"; - -var fs = require("fs"); -var md = require("markdown-it")({ "html": true }); -var rules = require("./rules"); -var shared = require("./shared"); - -// Mappings from rule to description and tag to rules -var ruleToDescription = {}; -var tagToRules = {}; -rules.forEach(function forRule(rule) { - ruleToDescription[rule.name] = rule.desc; - // The following is useful for updating README.md - // console.log("* **" + rule.name + "** - " + rule.desc); - rule.tags.forEach(function forTag(tag) { - var tags = tagToRules[tag] || []; - tags.push(rule.name); - tagToRules[tag] = tags; - }); -}); -// The following is useful for updating README.md -// Object.keys(tagToRules).sort().forEach(function forTag(tag) { -// console.log("* **" + tag + "** - " + tagToRules[tag].join(", ")); -// }); - -// Class for results with toString for pretty display -function Results() { } -Results.prototype.toString = function resultsToString() { - var self = this; - var results = []; - Object.keys(self).forEach(function forFile(file) { - var fileResults = self[file]; - Object.keys(fileResults).forEach(function forRule(rule) { - var ruleResults = fileResults[rule]; - ruleResults.forEach(function forLine(lineNumber) { - var result = - file + ": " + lineNumber + ": " + - rule + " " + ruleToDescription[rule]; - results.push(result); - }); - }); - }); - return results.join("\n"); -}; - -// Array.sort comparison for number objects -function numberComparison(a, b) { - return a - b; -} - -// Function to return unique values from a sorted array -function uniqueFilterForSorted(value, index, array) { - return (index === 0) || (value > array[index - 1]); -} - -// Lints a single string -function lintContent(content, config, frontMatter) { - // Remove front matter (if present at beginning of content) - var frontMatterLines = 0; - if (frontMatter) { - var frontMatterMatch = frontMatter.exec(content); - if (frontMatterMatch && !frontMatterMatch.index) { - var contentMatched = frontMatterMatch[0]; - content = content.slice(contentMatched.length); - frontMatterLines = contentMatched.split(shared.newLineRe).length - 1; - } - } - // Parse content into tokens and lines - var tokens = md.parse(content, {}); - var lines = content.split(shared.newLineRe); - var tokenLists = {}; - // Annotate tokens with line/lineNumber - tokens.forEach(function forToken(token) { - if (token.map) { - token.line = lines[token.map[0]]; - token.lineNumber = token.map[0] + 1; - // Trim bottom of token to exclude whitespace lines - while (token.map[1] && !(lines[token.map[1] - 1].trim())) { - token.map[1]--; - } - // Annotate children with lineNumber - var lineNumber = token.lineNumber; - (token.children || []).forEach(function forChild(child) { - child.lineNumber = lineNumber; - if ((child.type === "softbreak") || (child.type === "hardbreak")) { - lineNumber++; - } - }); - } - if (!tokenLists[token.type]) { - tokenLists[token.type] = []; - } - tokenLists[token.type].push(token); - }); - // Create parameters for rules - var params = { - "tokens": tokens, - "tokenLists": tokenLists, - "lines": lines - }; - // Merge rules/tags and sanitize config - var mergedRules = {}; - var ruleDefault = (config.default === undefined) || !!config.default; - rules.forEach(function forRule(rule) { - mergedRules[rule.name] = ruleDefault; - }); - Object.keys(config).forEach(function forKey(key) { - var value = config[key]; - if (value) { - if (!(value instanceof Object)) { - value = {}; - } - } else { - value = false; - } - if (ruleToDescription[key]) { - mergedRules[key] = value; - } else if (tagToRules[key]) { - tagToRules[key].forEach(function forRule(rule) { - mergedRules[rule] = value; - }); - } - }); - // Run each enabled rule - var result = {}; - rules.forEach(function forRule(rule) { - if (mergedRules[rule.name]) { - // Configure rule - params.options = mergedRules[rule.name]; - var errors = []; - rule.func(params, errors); - // Record any errors - if (errors.length) { - errors.sort(numberComparison); - result[rule.name] = errors - .filter(uniqueFilterForSorted) - .map(function adjustLineNumbers(error) { - return error + frontMatterLines; - }); - } - } - }); - return result; -} - -// Lints a single file -function lintFile(file, config, frontMatter, synchronous, callback) { - function lintContentWrapper(err, content) { - if (err) { - return callback(err); - } - var result = lintContent(content, config, frontMatter); - callback(null, result); - } - // Make a/synchronous call to read file - if (synchronous) { - lintContentWrapper(null, fs.readFileSync(file, shared.utf8Encoding)); - } else { - fs.readFile(file, shared.utf8Encoding, lintContentWrapper); - } -} - -// Callback used as a sentinel by markdownlintSync -function markdownlintSynchronousCallback() { - // Unreachable; no code path in the synchronous case passes err - // if (err) { - // throw err; // Synchronous APIs throw - // } -} - -/** - * Lint specified Markdown files according to configurable rules. - * - * @param {Object} options Configuration options. - * @param {Function} callback Callback (err, result) function. - * @returns {void} - */ -function markdownlint(options, callback) { - // Normalize inputs - options = options || {}; - callback = callback || function noop() {}; - var files = (options.files || []).slice(); - var strings = options.strings || {}; - var frontMatter = (options.frontMatter === undefined) ? - shared.frontMatterRe : options.frontMatter; - var config = options.config || { "default": true }; - var synchronous = (callback === markdownlintSynchronousCallback); - var results = new Results(); - // Helper to lint the next file in the array - function lintFilesArray() { - var file = files.shift(); - if (file) { - lintFile(file, config, frontMatter, synchronous, - function lintedFile(err, result) { - if (err) { - return callback(err); - } - // Record errors and lint next file - results[file] = result; - lintFilesArray(); - }); - } else { - callback(null, results); - } - } - // Lint strings - Object.keys(strings).forEach(function forKey(key) { - var result = lintContent(strings[key] || "", config, frontMatter); - results[key] = result; - }); - // Lint files - lintFilesArray(); - // Return results - if (synchronous) { - return results; - } -} - -/** - * Lint specified Markdown files according to configurable rules. - * - * @param {Object} options Configuration options. - * @returns {Object} Result object. - */ -function markdownlintSync(options) { - return markdownlint(options, markdownlintSynchronousCallback); -} - -// Export a/synchronous APIs -module.exports = markdownlint; -module.exports.sync = markdownlintSync; diff --git a/lib/markdownlint.mjs b/lib/markdownlint.mjs new file mode 100644 index 00000000..758207b9 --- /dev/null +++ b/lib/markdownlint.mjs @@ -0,0 +1,1660 @@ +// @ts-check + +// @ts-ignore +import { fs as nodeFs, os, path } from "#node-imports"; +import { initialize as cacheInitialize } from "./cache.mjs"; +import { version } from "./constants.mjs"; +import { requireMarkdownItCjs } from "./defer-require.cjs"; +import { resolveModule } from "./resolve-module.cjs"; +import rules from "./rules.mjs"; +import { parse as micromarkParse } from "./micromark-parse.mjs"; +import parseConfiguration from "./parse-configuration.mjs"; +import * as helpers from "../helpers/helpers.cjs"; + +/** + * Validate the list of rules for structure and reuse. + * + * @param {Rule[]} ruleList List of rules. + * @param {boolean} synchronous Whether to execute synchronously. + * @returns {Error | null} Error message if validation fails. + */ +function validateRuleList(ruleList, synchronous) { + let result = null; + if (ruleList.length === rules.length) { + // No need to validate if only using built-in rules + return result; + } + /** @type {Object.} */ + const allIds = {}; + for (const [ index, rule ] of ruleList.entries()) { + const customIndex = index - rules.length; + // eslint-disable-next-line jsdoc/reject-any-type, jsdoc/require-jsdoc + function newError(/** @type {string} */ property, /** @type {any} */ value) { + return new Error( + `Property '${property}' of custom rule at index ${customIndex} is incorrect: '${value}'.`); + } + for (const property of [ "names", "tags" ]) { + // @ts-ignore + const value = rule[property]; + if (!result && + (!value || !Array.isArray(value) || (value.length === 0) || + !value.every(helpers.isString) || value.some(helpers.isEmptyString))) { + result = newError(property, value); + } + } + for (const propertyInfo of [ + [ "description", "string" ], + [ "function", "function" ] + ]) { + const property = propertyInfo[0]; + // @ts-ignore + const value = rule[property]; + if (!result && (!value || (typeof value !== propertyInfo[1]))) { + result = newError(property, value); + } + } + if ( + !result && + (rule.parser !== undefined) && + (rule.parser !== "markdownit") && + (rule.parser !== "micromark") && + (rule.parser !== "none") + ) { + result = newError("parser", rule.parser); + } + if ( + !result && + rule.information && + !helpers.isUrl(rule.information) + ) { + result = newError("information", rule.information); + } + if ( + !result && + (rule.asynchronous !== undefined) && + (typeof rule.asynchronous !== "boolean") + ) { + result = newError("asynchronous", rule.asynchronous); + } + if (!result && rule.asynchronous && synchronous) { + result = new Error( + "Custom rule " + rule.names.join("/") + " at index " + customIndex + + " is asynchronous and can not be used in a synchronous context." + ); + } + if (!result) { + for (const name of rule.names) { + const nameUpper = name.toUpperCase(); + if (!result && (allIds[nameUpper] !== undefined)) { + result = new Error("Name '" + name + "' of custom rule at index " + + customIndex + " is already used as a name or tag."); + } + allIds[nameUpper] = true; + } + for (const tag of rule.tags) { + const tagUpper = tag.toUpperCase(); + if (!result && allIds[tagUpper]) { + result = new Error("Tag '" + tag + "' of custom rule at index " + + customIndex + " is already used as a name."); + } + allIds[tagUpper] = false; + } + } + } + return result; +} + +/** + * Creates a LintResults instance with toString for pretty display. + * + * @param {Rule[]} ruleList List of rules. + * @returns {LintResults} New LintResults instance. + */ +function newResults(ruleList) { + /** + * Returns the string representation of a LintResults instance. + * + * @param {boolean} useAlias True if rule alias should be used instead of name. + * @returns {string} String representation of the instance. + * @this {LintResults} + */ + function toString(useAlias) { + // eslint-disable-next-line consistent-this, unicorn/no-this-assignment + const lintResults = this; + /** @type {Object. | null} */ + let ruleNameToRule = null; + const results = []; + const keys = Object.keys(lintResults); + keys.sort(); + for (const file of keys) { + const fileResults = lintResults[file]; + if (Array.isArray(fileResults)) { + for (const result of fileResults) { + const ruleMoniker = result.ruleNames ? + result.ruleNames.join("/") : + // @ts-ignore + (result.ruleName + "/" + result.ruleAlias); + results.push( + file + ": " + + result.lineNumber + ": " + + ruleMoniker + " " + + result.ruleDescription + + (result.errorDetail ? + " [" + result.errorDetail + "]" : + "") + + (result.errorContext ? + " [Context: \"" + result.errorContext + "\"]" : + "")); + } + } else { + if (!ruleNameToRule) { + ruleNameToRule = {}; + for (const rule of ruleList) { + const ruleName = rule.names[0].toUpperCase(); + ruleNameToRule[ruleName] = rule; + } + } + for (const [ ruleName, ruleResults ] of Object.entries(fileResults)) { + const rule = ruleNameToRule[ruleName.toUpperCase()]; + for (const lineNumber of ruleResults) { + // @ts-ignore + const nameIndex = Math.min(useAlias ? 1 : 0, rule.names.length - 1); + const result = + file + ": " + + lineNumber + ": " + + // @ts-ignore + rule.names[nameIndex] + " " + + // @ts-ignore + rule.description; + results.push(result); + } + } + } + } + return results.join("\n"); + } + const lintResults = {}; + Object.defineProperty(lintResults, "toString", { "value": toString }); + // @ts-ignore + return lintResults; +} + +/** + * Result object for removeFrontMatter. + * + * @typedef {Object} RemoveFrontMatterResult + * @property {string} content Markdown content. + * @property {string[]} frontMatterLines Front matter lines. + */ + +/** + * Remove front matter (if present at beginning of content). + * + * @param {string} content Markdown content. + * @param {RegExp | null} frontMatter Regular expression to match front matter. + * @returns {RemoveFrontMatterResult} Trimmed content and front matter lines. + */ +function removeFrontMatter(content, frontMatter) { + /** @type {string[]} */ + let frontMatterLines = []; + if (frontMatter) { + const frontMatterMatch = content.match(frontMatter); + if (frontMatterMatch && !frontMatterMatch.index) { + const contentMatched = frontMatterMatch[0]; + content = content.slice(contentMatched.length); + frontMatterLines = contentMatched.split(helpers.newLineRe); + if ((frontMatterLines.length > 0) && + (frontMatterLines[frontMatterLines.length - 1] === "")) { + frontMatterLines.length--; + } + } + } + return { + "content": content, + "frontMatterLines": frontMatterLines + }; +} + +/** + * Map rule names/tags to canonical rule name. + * + * @param {Rule[]} ruleList List of rules. + * @returns {Object.} Map of alias to rule name. + */ +function mapAliasToRuleNames(ruleList) { + /** @type {Object.} */ + const aliasToRuleNames = {}; + // const tagToRuleNames = {}; + for (const rule of ruleList) { + const ruleName = rule.names[0].toUpperCase(); + // The following is useful for updating README.md: + // console.log( + // "* **[" + ruleName + "](doc/Rules.md#" + ruleName.toLowerCase() + + // ")** *" + rule.names.slice(1).join("/") + "* - " + rule.description); + for (const name of rule.names) { + const nameUpper = name.toUpperCase(); + aliasToRuleNames[nameUpper] = [ ruleName ]; + } + for (const tag of rule.tags) { + const tagUpper = tag.toUpperCase(); + const ruleNames = aliasToRuleNames[tagUpper] || []; + ruleNames.push(ruleName); + aliasToRuleNames[tagUpper] = ruleNames; + // tagToRuleNames[tag] = ruleName; + } + } + // The following is useful for updating README.md: + // Object.keys(tagToRuleNames).sort().forEach(function forTag(tag) { + // console.log("* **" + tag + "** - " + + // aliasToRuleNames[tag.toUpperCase()].join(", ")); + // }); + // @ts-ignore + return aliasToRuleNames; +} + +/** + * Result object for getEffectiveConfig. + * + * @typedef {Object} GetEffectiveConfigResult + * @property {Configuration} effectiveConfig Effective configuration. + * @property {Map} rulesEnabled Rules enabled. + * @property {Map} rulesSeverity Rules severity. + */ + +/** + * Apply (and normalize) configuration object. + * + * @param {Rule[]} ruleList List of rules. + * @param {Configuration} config Configuration object. + * @param {Object.} aliasToRuleNames Map of alias to rule names. + * @returns {GetEffectiveConfigResult} Effective configuration and rule severities. + */ +function getEffectiveConfig(ruleList, config, aliasToRuleNames) { + let ruleDefaultEnable = true; + /** @type {"error" | "warning"} */ + let ruleDefaultSeverity = "error"; + Object.entries(config).every(([ key, value ]) => { + if (key.toUpperCase() === "DEFAULT") { + ruleDefaultEnable = !!value; + if (value === "warning") { + ruleDefaultSeverity = "warning"; + } + return false; + } + return true; + }); + /** @type {Configuration} */ + const effectiveConfig = {}; + /** @type {Map} */ + const rulesEnabled = new Map(); + /** @type {Map} */ + const rulesSeverity = new Map(); + const emptyObject = Object.freeze({}); + for (const ruleName of ruleList.map((rule) => rule.names[0].toUpperCase())) { + effectiveConfig[ruleName] = emptyObject; + rulesEnabled.set(ruleName, ruleDefaultEnable); + rulesSeverity.set(ruleName, ruleDefaultSeverity); + } + // for (const ruleName of deprecatedRuleNames) { + // effectiveConfig[ruleName] = false; + // } + for (const [ key, value ] of Object.entries(config)) { + const keyUpper = key.toUpperCase(); + /** @type {boolean} */ + let enabled = false; + /** @type {"error" | "warning"} */ + let severity = "error"; + let effectiveValue = {}; + if (value) { + if (value instanceof Object) { + /** @type {{ enabled?: boolean, severity?: "error" | "warning" }} */ + const valueObject = value; + enabled = (valueObject.enabled === undefined) ? true : !!valueObject.enabled; + severity = (valueObject.severity === "warning") ? "warning" : "error"; + effectiveValue = Object.fromEntries( + Object.entries(value).filter( + ([ k ]) => (k !== "enabled") && (k !== "severity") + ) + ); + } else { + enabled = true; + severity = (value === "warning") ? "warning" : "error"; + } + } + for (const ruleName of (aliasToRuleNames[keyUpper] || [])) { + Object.freeze(effectiveValue); + effectiveConfig[ruleName] = effectiveValue; + rulesEnabled.set(ruleName, enabled); + rulesSeverity.set(ruleName, severity); + } + } + return { + effectiveConfig, + rulesEnabled, + rulesSeverity + }; +} + +/** + * Result object for getEnabledRulesPerLineNumber. + * + * @typedef {Object} EnabledRulesPerLineNumberResult + * @property {Configuration} effectiveConfig Effective configuration. + * @property {Map[]} enabledRulesPerLineNumber Enabled rules per line number. + * @property {Rule[]} enabledRuleList Enabled rule list. + * @property {Map} rulesSeverity Rules severity. + */ + +/** + * Create a mapping of enabled rules per line. + * + * @param {Rule[]} ruleList List of rules. + * @param {string[]} lines List of content lines. + * @param {string[]} frontMatterLines List of front matter lines. + * @param {boolean} noInlineConfig Whether to allow inline configuration. + * @param {Configuration} config Configuration object. + * @param {ConfigurationParser[] | undefined} configParsers Configuration parsers. + * @param {Object.} aliasToRuleNames Map of alias to rule names. + * @returns {EnabledRulesPerLineNumberResult} Effective configuration and enabled rules per line number. + */ +function getEnabledRulesPerLineNumber( + ruleList, + lines, + frontMatterLines, + noInlineConfig, + config, + configParsers, + aliasToRuleNames) { + // Shared variables + /** @type {Map} */ + let enabledRules = new Map(); + /** @type {Map} */ + let capturedRules = enabledRules; + const enabledRulesPerLineNumber = new Array(1 + frontMatterLines.length); + // Helper functions + // eslint-disable-next-line jsdoc/require-jsdoc + function handleInlineConfig(/** @type {string[]} */ input, /** @type {(act: string, par: string, ind: number) => void} */ forEachMatch, /** @type {(() => void)|undefined} */ forEachLine = undefined) { + for (const [ lineIndex, line ] of input.entries()) { + if (!noInlineConfig) { + let match = null; + while ((match = helpers.inlineCommentStartRe.exec(line))) { + const action = match[2].toUpperCase(); + const startIndex = match.index + match[1].length; + const endIndex = line.indexOf("-->", startIndex); + if (endIndex === -1) { + break; + } + const parameter = line.slice(startIndex, endIndex); + forEachMatch(action, parameter, lineIndex + 1); + } + } + if (forEachLine) { + forEachLine(); + } + } + } + // eslint-disable-next-line jsdoc/require-jsdoc + function configureFile(/** @type {string} */ action, /** @type {string} */ parameter) { + if (action === "CONFIGURE-FILE") { + const { "config": parsed } = parseConfiguration( + "CONFIGURE-FILE", parameter, configParsers + ); + if (parsed) { + config = { + ...config, + ...parsed + }; + } + } + } + // eslint-disable-next-line jsdoc/require-jsdoc + function applyEnableDisable(/** @type {string} */ action, /** @type {string} */ parameter, /** @type {Map} */ state) { + state = new Map(state); + const enabled = (action.startsWith("ENABLE")); + const trimmed = parameter && parameter.trim(); + // eslint-disable-next-line no-use-before-define + const items = trimmed ? trimmed.toUpperCase().split(/\s+/) : allRuleNames; + for (const nameUpper of items) { + for (const ruleName of (aliasToRuleNames[nameUpper] || [])) { + state.set(ruleName, enabled); + } + } + return state; + } + // eslint-disable-next-line jsdoc/require-jsdoc + function enableDisableFile(/** @type {string} */ action, /** @type {string} */ parameter) { + if ((action === "ENABLE-FILE") || (action === "DISABLE-FILE")) { + enabledRules = applyEnableDisable(action, parameter, enabledRules); + } + } + // eslint-disable-next-line jsdoc/require-jsdoc + function captureRestoreEnableDisable(/** @type {string} */ action, /** @type {string} */ parameter) { + if (action === "CAPTURE") { + capturedRules = enabledRules; + } else if (action === "RESTORE") { + enabledRules = capturedRules; + } else if ((action === "ENABLE") || (action === "DISABLE")) { + enabledRules = applyEnableDisable(action, parameter, enabledRules); + } + } + // eslint-disable-next-line jsdoc/require-jsdoc + function updateLineState() { + enabledRulesPerLineNumber.push(enabledRules); + } + // eslint-disable-next-line jsdoc/require-jsdoc + function disableLineNextLine(/** @type {string} */ action, /** @type {string} */ parameter, /** @type {number} */ lineNumber) { + const disableLine = (action === "DISABLE-LINE"); + const disableNextLine = (action === "DISABLE-NEXT-LINE"); + if (disableLine || disableNextLine) { + const nextLineNumber = + frontMatterLines.length + lineNumber + (disableNextLine ? 1 : 0); + enabledRulesPerLineNumber[nextLineNumber] = + applyEnableDisable( + action, + parameter, + enabledRulesPerLineNumber[nextLineNumber] + ); + } + } + // Handle inline comments + handleInlineConfig([ lines.join("\n") ], configureFile); + const { effectiveConfig, rulesEnabled, rulesSeverity } = getEffectiveConfig(ruleList, config, aliasToRuleNames); + const allRuleNames = [ ...rulesEnabled.keys() ]; + enabledRules = new Map(rulesEnabled); + capturedRules = enabledRules; + handleInlineConfig(lines, enableDisableFile); + handleInlineConfig(lines, captureRestoreEnableDisable, updateLineState); + handleInlineConfig(lines, disableLineNextLine); + // Create the list of rules that are used at least once + const enabledRuleList = ruleList.filter((rule) => { + const ruleName = rule.names[0].toUpperCase(); + return enabledRulesPerLineNumber.some((enabledRulesForLine) => enabledRulesForLine.get(ruleName)); + }); + // Return results + return { + effectiveConfig, + enabledRulesPerLineNumber, + enabledRuleList, + rulesSeverity + }; +} + +/** + * Lints a string containing Markdown content. + * + * @param {Rule[]} ruleList List of rules. + * @param {Object.} aliasToRuleNames Map of alias to rule names. + * @param {string} name Identifier for the content. + * @param {string} content Markdown content. + * @param {MarkdownItFactory} markdownItFactory Function to create a markdown-it parser. + * @param {Configuration} config Configuration object. + * @param {ConfigurationParser[] | undefined} configParsers Configuration parsers. + * @param {RegExp | null} frontMatter Regular expression for front matter. + * @param {boolean} handleRuleFailures Whether to handle exceptions in rules. + * @param {boolean} noInlineConfig Whether to allow inline configuration. + * @param {boolean} synchronous Whether to execute synchronously. + * @param {LintContentCallback} callback Callback (err, result) function. + * @returns {void} + */ +function lintContent( + ruleList, + aliasToRuleNames, + name, + content, + markdownItFactory, + config, + configParsers, + frontMatter, + handleRuleFailures, + noInlineConfig, + synchronous, + callback) { + // Provide a consistent error-reporting callback + // eslint-disable-next-line jsdoc/reject-any-type + const callbackError = (/** @type {any} */ error) => callback(error instanceof Error ? error : new Error(error)); + // Remove UTF-8 byte order marker (if present) + content = content.replace(/^\uFEFF/, ""); + // Remove front matter + const removeFrontMatterResult = removeFrontMatter(content, frontMatter); + const { frontMatterLines } = removeFrontMatterResult; + content = removeFrontMatterResult.content; + // Get enabled rules per line (with HTML comments present) + const { effectiveConfig, enabledRulesPerLineNumber, enabledRuleList, rulesSeverity } = + getEnabledRulesPerLineNumber( + ruleList, + content.split(helpers.newLineRe), + frontMatterLines, + noInlineConfig, + config, + configParsers, + aliasToRuleNames + ); + const needMarkdownItTokens = enabledRuleList.some( + (rule) => (rule.parser === "markdownit") || (rule.parser === undefined) + ); + const needMicromarkTokens = enabledRuleList.some( + (rule) => (rule.parser === "micromark") + ); + const customRulesPresent = (ruleList.length !== rules.length); + // Parse content into parser tokens + const micromarkTokens = needMicromarkTokens ? + micromarkParse(content, { "freezeTokens": customRulesPresent }) : + []; + // Hide the content of HTML comments from rules + const preClearedContent = content; + content = helpers.clearHtmlCommentText(content); + // Parse content into lines and get markdown-it tokens + const lines = content.split(helpers.newLineRe); + // Function to run after fetching markdown-it tokens (when needed) + const lintContentInternal = (/** @type {MarkdownItToken[]} */ markdownitTokens) => { + // Create (frozen) parameters for rules + /** @type {MarkdownParsers} */ + // @ts-ignore + const parsersMarkdownIt = Object.freeze({ + "markdownit": Object.freeze({ + "tokens": markdownitTokens + }) + }); + /** @type {MarkdownParsers} */ + // @ts-ignore + const parsersMicromark = Object.freeze({ + "micromark": Object.freeze({ + "tokens": micromarkTokens + }) + }); + /** @type {MarkdownParsers} */ + // @ts-ignore + const parsersNone = Object.freeze({}); + const paramsBase = { + name, + version, + "lines": Object.freeze(lines), + "frontMatterLines": Object.freeze(frontMatterLines) + }; + cacheInitialize({ + ...paramsBase, + "parsers": parsersMicromark, + "config": null + }); + // Function to run for each rule + /** @type {LintError[]} */ + const results = []; + /** + * @param {Rule} rule Rule. + * @returns {Promise | null} Promise. + */ + const forRule = (rule) => { + // Configure rule + const ruleName = rule.names[0].toUpperCase(); + const tokens = {}; + let parsers = parsersNone; + if (rule.parser === undefined) { + tokens.tokens = markdownitTokens; + parsers = parsersMarkdownIt; + } else if (rule.parser === "markdownit") { + parsers = parsersMarkdownIt; + } else if (rule.parser === "micromark") { + parsers = parsersMicromark; + } + const params = Object.freeze({ + ...paramsBase, + ...tokens, + parsers, + /** @type {RuleConfiguration} */ + // @ts-ignore + "config": effectiveConfig[ruleName] + }); + // eslint-disable-next-line jsdoc/require-jsdoc + function throwError(/** @type {string} */ property) { + throw new Error( + `Value of '${property}' passed to onError by '${ruleName}' is incorrect for '${name}'.`); + } + // eslint-disable-next-line jsdoc/require-jsdoc + function onError(/** @type {RuleOnErrorInfo} */ errorInfo) { + if (!errorInfo || + !helpers.isNumber(errorInfo.lineNumber) || + (errorInfo.lineNumber < 1) || + (errorInfo.lineNumber > lines.length)) { + throwError("lineNumber"); + } + const lineNumber = errorInfo.lineNumber + frontMatterLines.length; + if (!enabledRulesPerLineNumber[lineNumber].get(ruleName)) { + return; + } + if (errorInfo.detail && + !helpers.isString(errorInfo.detail)) { + throwError("detail"); + } + if (errorInfo.context && + !helpers.isString(errorInfo.context)) { + throwError("context"); + } + if (errorInfo.information && + !helpers.isUrl(errorInfo.information)) { + throwError("information"); + } + if (errorInfo.range && + (!Array.isArray(errorInfo.range) || + (errorInfo.range.length !== 2) || + !helpers.isNumber(errorInfo.range[0]) || + (errorInfo.range[0] < 1) || + !helpers.isNumber(errorInfo.range[1]) || + (errorInfo.range[1] < 1) || + ((errorInfo.range[0] + errorInfo.range[1] - 1) > + lines[errorInfo.lineNumber - 1].length))) { + throwError("range"); + } + const fixInfo = errorInfo.fixInfo; + const cleanFixInfo = {}; + if (fixInfo) { + if (!helpers.isObject(fixInfo)) { + throwError("fixInfo"); + } + if (fixInfo.lineNumber !== undefined) { + if ((!helpers.isNumber(fixInfo.lineNumber) || + (fixInfo.lineNumber < 1) || + (fixInfo.lineNumber > lines.length))) { + throwError("fixInfo.lineNumber"); + } + cleanFixInfo.lineNumber = + fixInfo.lineNumber + frontMatterLines.length; + } + const effectiveLineNumber = fixInfo.lineNumber || errorInfo.lineNumber; + if (fixInfo.editColumn !== undefined) { + if ((!helpers.isNumber(fixInfo.editColumn) || + (fixInfo.editColumn < 1) || + (fixInfo.editColumn > + lines[effectiveLineNumber - 1].length + 1))) { + throwError("fixInfo.editColumn"); + } + cleanFixInfo.editColumn = fixInfo.editColumn; + } + if (fixInfo.deleteCount !== undefined) { + if ((!helpers.isNumber(fixInfo.deleteCount) || + (fixInfo.deleteCount < -1) || + (fixInfo.deleteCount > + lines[effectiveLineNumber - 1].length))) { + throwError("fixInfo.deleteCount"); + } + cleanFixInfo.deleteCount = fixInfo.deleteCount; + } + if (fixInfo.insertText !== undefined) { + if (!helpers.isString(fixInfo.insertText)) { + throwError("fixInfo.insertText"); + } + cleanFixInfo.insertText = fixInfo.insertText; + } + } + const information = errorInfo.information || rule.information; + results.push({ + lineNumber, + "ruleNames": rule.names, + "ruleDescription": rule.description, + "ruleInformation": information ? information.href : null, + "errorDetail": errorInfo.detail?.replace(helpers.newLineRe, " ") || null, + "errorContext": errorInfo.context?.replace(helpers.newLineRe, " ") || null, + "errorRange": errorInfo.range ? [ ...errorInfo.range ] : null, + "fixInfo": fixInfo ? cleanFixInfo : null, + // @ts-ignore + "severity": rulesSeverity.get(ruleName) + }); + } + // Call (possibly external) rule function to report errors + // @ts-ignore + const catchCallsOnError = (error) => onError({ + "lineNumber": 1, + "detail": `This rule threw an exception: ${error.message || error}` + }); + const invokeRuleFunction = () => rule.function(params, onError); + if (rule.asynchronous) { + // Asynchronous rule, ensure it returns a Promise + const ruleFunctionPromise = + Promise.resolve().then(invokeRuleFunction); + return handleRuleFailures ? + ruleFunctionPromise.catch(catchCallsOnError) : + ruleFunctionPromise; + } + // Synchronous rule + try { + invokeRuleFunction(); + } catch(error) { + if (handleRuleFailures) { + catchCallsOnError(error); + } else { + throw error; + } + } + return null; + }; + const formatResults = () => { + // Sort results by rule name by line number + results.sort((a, b) => ( + a.ruleNames[0].localeCompare(b.ruleNames[0]) || + a.lineNumber - b.lineNumber + )); + return results; + }; + // Run all rules + const ruleListAsync = enabledRuleList.filter((rule) => rule.asynchronous); + const ruleListSync = enabledRuleList.filter((rule) => !rule.asynchronous); + const ruleListAsyncFirst = [ + ...ruleListAsync, + ...ruleListSync + ]; + const callbackSuccess = () => callback(null, formatResults()); + try { + const ruleResults = ruleListAsyncFirst.map(forRule); + if (ruleListAsync.length > 0) { + Promise.all(ruleResults.slice(0, ruleListAsync.length)) + .then(callbackSuccess) + .catch(callbackError); + } else { + callbackSuccess(); + } + } catch(error) { + callbackError(error); + } finally { + cacheInitialize(); + } + }; + if (!needMarkdownItTokens || synchronous) { + // Need/able to call into markdown-it and lintContentInternal synchronously + const markdownItTokens = needMarkdownItTokens ? + requireMarkdownItCjs().getMarkdownItTokens(markdownItFactory(), preClearedContent, lines) : + []; + lintContentInternal(markdownItTokens); + } else { + // Need to call into markdown-it and lintContentInternal asynchronously + Promise.all([ + // eslint-disable-next-line no-inline-comments + import(/* webpackMode: "eager" */ "./markdownit.cjs"), + // eslint-disable-next-line no-promise-executor-return + new Promise((resolve) => resolve(markdownItFactory())) + ]).then(([ markdownitCjs, markdownIt ]) => { + const markdownItTokens = markdownitCjs.getMarkdownItTokens(markdownIt, preClearedContent, lines); + lintContentInternal(markdownItTokens); + }).catch(callbackError); + } +} + +/** + * Lints a file containing Markdown content. + * + * @param {Rule[]} ruleList List of rules. + * @param {Object.} aliasToRuleNames Map of alias to rule names. + * @param {string} file Path of file to lint. + * @param {MarkdownItFactory} markdownItFactory Function to create a markdown-it parser. + * @param {Configuration} config Configuration object. + * @param {ConfigurationParser[] | undefined} configParsers Configuration parsers. + * @param {RegExp | null} frontMatter Regular expression for front matter. + * @param {boolean} handleRuleFailures Whether to handle exceptions in rules. + * @param {boolean} noInlineConfig Whether to allow inline configuration. + * @param {FsLike} fs File system implementation. + * @param {boolean} synchronous Whether to execute synchronously. + * @param {LintContentCallback} callback Callback (err, result) function. + * @returns {void} + */ +function lintFile( + ruleList, + aliasToRuleNames, + file, + markdownItFactory, + config, + configParsers, + frontMatter, + handleRuleFailures, + noInlineConfig, + fs, + synchronous, + callback) { + // eslint-disable-next-line jsdoc/require-jsdoc + function lintContentWrapper(/** @type {Error | null} */ err, /** @type {string} */ content) { + if (err) { + return callback(err); + } + return lintContent( + ruleList, + aliasToRuleNames, + file, + content, + markdownItFactory, + config, + configParsers, + frontMatter, + handleRuleFailures, + noInlineConfig, + synchronous, + callback + ); + } + // Make a/synchronous call to read file + if (synchronous) { + lintContentWrapper(null, fs.readFileSync(file, "utf8")); + } else { + fs.readFile(file, "utf8", lintContentWrapper); + } +} + +/** + * Lint files and strings specified in the Options object. + * + * @param {Options | null} options Options object. + * @param {boolean} synchronous Whether to execute synchronously. + * @param {LintCallback} callback Callback (err, result) function. + * @returns {void} + */ +function lintInput(options, synchronous, callback) { + // Normalize inputs + options = options || {}; + callback = callback || function noop() {}; + /** @type {Rule[]} */ + // @ts-ignore + const customRuleList = + [ options.customRules || [] ] + .flat() + .map((rule) => ({ + "names": helpers.cloneIfArray(rule.names), + "description": rule.description, + "information": helpers.cloneIfUrl(rule.information), + "tags": helpers.cloneIfArray(rule.tags), + "parser": rule.parser, + "asynchronous": rule.asynchronous, + "function": rule.function + })); + // eslint-disable-next-line unicorn/prefer-spread + const ruleList = rules.concat(customRuleList); + const ruleErr = validateRuleList(ruleList, synchronous); + if (ruleErr) { + callback(ruleErr); + return; + } + /** @type {string[]} */ + let files = []; + if (Array.isArray(options.files)) { + files = [ ...options.files ]; + } else if (options.files) { + files = [ String(options.files) ]; + } + const strings = options.strings || {}; + const stringsKeys = Object.keys(strings); + const config = options.config || { "default": true }; + const configParsers = options.configParsers || undefined; + const frontMatter = (options.frontMatter === undefined) ? + helpers.frontMatterRe : + options.frontMatter; + const handleRuleFailures = !!options.handleRuleFailures; + const noInlineConfig = !!options.noInlineConfig; + // @ts-ignore + // eslint-disable-next-line dot-notation + const resultVersion = (options["resultVersion"] === undefined) ? 3 : options["resultVersion"]; + const markdownItFactory = + options.markdownItFactory || + (() => { throw new Error("The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set."); }); + /** @type {FsLike} */ + // @ts-ignore + const fs = options.fs || nodeFs; + const aliasToRuleNames = mapAliasToRuleNames(ruleList); + const results = newResults(ruleList); + let done = false; + let concurrency = 0; + // eslint-disable-next-line jsdoc/require-jsdoc + function lintWorker() { + /** @type {string | undefined} */ + let currentItem = undefined; + // eslint-disable-next-line jsdoc/require-jsdoc + function lintWorkerCallback(/** @type {Error | null} */ err, /** @type {LintError[] | undefined} */ result) { + concurrency--; + if (err) { + done = true; + return callback(err); + } + // @ts-ignore + results[currentItem] = result; + if (!synchronous) { + lintWorker(); + } + return null; + } + if (done) { + // Abort for error or nothing left to do + } else if ((currentItem = files.shift())) { + // Lint next file + concurrency++; + lintFile( + ruleList, + aliasToRuleNames, + currentItem, + markdownItFactory, + config, + configParsers, + frontMatter, + handleRuleFailures, + noInlineConfig, + fs, + synchronous, + lintWorkerCallback + ); + } else if ((currentItem = stringsKeys.shift())) { + // Lint next string + concurrency++; + lintContent( + ruleList, + aliasToRuleNames, + currentItem, + strings[currentItem] || "", + markdownItFactory, + config, + configParsers, + frontMatter, + handleRuleFailures, + noInlineConfig, + synchronous, + lintWorkerCallback + ); + } else if (concurrency === 0) { + // Finish + done = true; + // Deprecated: Convert results to specified resultVersion + let convertedResults = results; + if (resultVersion === 0) { + convertedResults = helpers.convertToResultVersion0(results); + } else if (resultVersion === 1) { + convertedResults = helpers.convertToResultVersion1(results); + } else if (resultVersion === 2) { + convertedResults = helpers.convertToResultVersion2(results); + } + return callback(null, convertedResults); + } + return null; + } + if (synchronous) { + while (!done) { + lintWorker(); + } + } else { + // Testing on a Raspberry Pi 4 Model B with an artificial 5ms file access + // delay suggests that a concurrency factor of 8 can eliminate the impact + // of that delay (i.e., total time is the same as with no delay). + lintWorker(); + lintWorker(); + lintWorker(); + lintWorker(); + lintWorker(); + lintWorker(); + lintWorker(); + lintWorker(); + } +} + +/** + * Lint specified Markdown files. + * + * @param {Options | null} options Configuration options. + * @param {LintCallback} callback Callback (err, result) function. + * @returns {void} + */ +export function lintAsync(options, callback) { + return lintInput(options, false, callback); +} + +/** + * Lint specified Markdown files. + * + * @param {Options | null} options Configuration options. + * @returns {Promise} Results object. + */ +export function lintPromise(options) { + return new Promise((resolve, reject) => { + lintAsync(options, (error, results) => { + if (error || !results) { + reject(error); + } else { + resolve(results); + } + }); + }); +} + +/** + * Lint specified Markdown files. + * + * @param {Options | null} options Configuration options. + * @returns {LintResults} Results object. + */ +export function lintSync(options) { + let results = null; + lintInput(options, true, function callback(error, res) { + if (error) { + throw error; + } + results = res; + }); + // @ts-ignore + return results; +} + +/** + * Node fs instance (or compatible object). + * + * @typedef FsLike + * @property {(path: string, callback: (err: Error) => void) => void} access access method. + * @property {(path: string) => void} accessSync accessSync method. + * @property {(path: string, encoding: string, callback: (err: Error, data: string) => void) => void} readFile readFile method. + * @property {(path: string, encoding: string) => string} readFileSync readFileSync method. + */ + +/** + * Resolve referenced "extends" path in a configuration file + * using path.resolve() with require.resolve() as a fallback. + * + * @param {string} configFile Configuration file name. + * @param {string} referenceId Referenced identifier to resolve. + * @param {FsLike} fs File system implementation. + * @param {ResolveConfigExtendsCallback} callback Callback (err, result) function. + * @returns {void} + */ +function resolveConfigExtends(configFile, referenceId, fs, callback) { + const configFileDirname = path.dirname(configFile); + const resolvedExtendsFile = path.resolve(configFileDirname, referenceId); + fs.access(resolvedExtendsFile, (err) => { + if (err) { + // Not a file, try require.resolve + try { + return callback( + null, + resolveModule(referenceId, [ configFileDirname ]) + ); + } catch { + // Unable to resolve, use resolvedExtendsFile + } + } + return callback(null, resolvedExtendsFile); + }); +} + +/** + * Resolve referenced "extends" path in a configuration file + * using path.resolve() with require.resolve() as a fallback. + * + * @param {string} configFile Configuration file name. + * @param {string} referenceId Referenced identifier to resolve. + * @param {FsLike} fs File system implementation. + * @returns {string} Resolved path to file. + */ +function resolveConfigExtendsSync(configFile, referenceId, fs) { + const configFileDirname = path.dirname(configFile); + const resolvedExtendsFile = path.resolve(configFileDirname, referenceId); + try { + fs.accessSync(resolvedExtendsFile); + return resolvedExtendsFile; + } catch { + // Not a file, try require.resolve + } + try { + return resolveModule(referenceId, [ configFileDirname ]); + } catch { + // Unable to resolve, return resolvedExtendsFile + } + return resolvedExtendsFile; +} + +/** + * Extend specified configuration object. + * + * @param {Configuration} config Configuration object. + * @param {string} file Configuration file name. + * @param {ConfigurationParser[] | undefined} parsers Parsing function(s). + * @param {FsLike} fs File system implementation. + * @param {ReadConfigCallback} callback Callback (err, result) function. + * @returns {void} + */ +function extendConfig(config, file, parsers, fs, callback) { + const configExtends = config.extends; + if (configExtends) { + return resolveConfigExtends( + file, + helpers.expandTildePath(configExtends, os), + fs, + // eslint-disable-next-line no-use-before-define + (_, resolvedExtends) => readConfigAsync( + // @ts-ignore + resolvedExtends, + parsers, + fs, + (err, extendsConfig) => { + if (err) { + return callback(err); + } + const result = { + ...extendsConfig, + ...config + }; + delete result.extends; + return callback(null, result); + } + ) + ); + } + return callback(null, config); +} + +/** + * Extend specified configuration object. + * + * @param {Configuration} config Configuration object. + * @param {string} file Configuration file name. + * @param {ConfigurationParser[] | undefined} parsers Parsing function(s). + * @param {FsLike} fs File system implementation. + * @returns {Promise} Configuration object. + */ +export function extendConfigPromise(config, file, parsers, fs) { + return new Promise((resolve, reject) => { + extendConfig(config, file, parsers, fs, (error, results) => { + if (error || !results) { + reject(error); + } else { + resolve(results); + } + }); + }); +} + +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[] | ReadConfigCallback} [parsers] Parsing function(s). + * @param {FsLike | ReadConfigCallback} [fs] File system implementation. + * @param {ReadConfigCallback} [callback] Callback (err, result) function. + * @returns {void} + */ +export function readConfigAsync(file, parsers, fs, callback) { + if (!callback) { + if (fs) { + // @ts-ignore + callback = fs; + // @ts-ignore + fs = null; + } else { + // @ts-ignore + callback = parsers; + // @ts-ignore + parsers = null; + } + } + /** @type {FsLike} */ + // @ts-ignore + const fsLike = fs || nodeFs; + // Read file + file = helpers.expandTildePath(file, os); + fsLike.readFile(file, "utf8", (err, content) => { + if (err) { + // @ts-ignore + return callback(err); + } + // Try to parse file + // @ts-ignore + const { config, message } = parseConfiguration(file, content, parsers); + if (!config) { + // @ts-ignore + return callback(new Error(message)); + } + // Extend configuration + // @ts-ignore + return extendConfig(config, file, parsers, fsLike, callback); + }); +} + +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[]} [parsers] Parsing function(s). + * @param {FsLike} [fs] File system implementation. + * @returns {Promise} Configuration object. + */ +export function readConfigPromise(file, parsers, fs) { + return new Promise((resolve, reject) => { + readConfigAsync(file, parsers, fs, (error, results) => { + if (error || !results) { + reject(error); + } else { + resolve(results); + } + }); + }); +} + +/** + * Read specified configuration file. + * + * @param {string} file Configuration file name. + * @param {ConfigurationParser[]} [parsers] Parsing function(s). + * @param {FsLike} [fs] File system implementation. + * @returns {Configuration} Configuration object. + */ +export function readConfigSync(file, parsers, fs) { + /** @type {FsLike} */ + // @ts-ignore + const fsLike = fs || nodeFs; + // Read file + file = helpers.expandTildePath(file, os); + const content = fsLike.readFileSync(file, "utf8"); + // Try to parse file + const { config, message } = parseConfiguration(file, content, parsers); + if (!config) { + // @ts-ignore + throw new Error(message); + } + // Extend configuration + const configExtends = config.extends; + if (configExtends) { + delete config.extends; + const resolvedExtends = resolveConfigExtendsSync( + file, + helpers.expandTildePath(configExtends, os), + fsLike + ); + return { + ...readConfigSync(resolvedExtends, parsers, fs), + ...config + }; + } + return config; +} + +/** + * Normalizes the fields of a RuleOnErrorFixInfo instance. + * + * @param {FixInfo} fixInfo RuleOnErrorFixInfo instance. + * @param {number} [lineNumber] Line number. + * @returns {FixInfoNormalized} Normalized RuleOnErrorFixInfo instance. + */ +function normalizeFixInfo(fixInfo, lineNumber = 0) { + return { + "lineNumber": fixInfo.lineNumber || lineNumber, + "editColumn": fixInfo.editColumn || 1, + "deleteCount": fixInfo.deleteCount || 0, + "insertText": fixInfo.insertText || "" + }; +} + +/** + * Applies the specified fix to a Markdown content line. + * + * @param {string} line Line of Markdown content. + * @param {FixInfo} fixInfo FixInfo instance. + * @param {string} [lineEnding] Line ending to use. + * @returns {string | null} Fixed content or null if deleted. + */ +export function applyFix(line, fixInfo, lineEnding = "\n") { + const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo); + const editIndex = editColumn - 1; + return (deleteCount === -1) ? + null : + line.slice(0, editIndex) + insertText.replace(/\n/g, lineEnding) + line.slice(editIndex + deleteCount); +} + +/** + * Applies as many of the specified fixes as possible to Markdown content. + * + * @param {string} input Lines of Markdown content. + * @param {LintError[]} errors LintError instances. + * @returns {string} Fixed content. + */ +export function applyFixes(input, errors) { + const lineEnding = helpers.getPreferredLineEnding(input, os); + const lines = input.split(helpers.newLineRe); + // Normalize fixInfo objects + let fixInfos = errors + .filter((error) => error.fixInfo) + // @ts-ignore + .map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber)); + // Sort bottom-to-top, line-deletes last, right-to-left, long-to-short + fixInfos.sort((a, b) => { + const aDeletingLine = (a.deleteCount === -1); + const bDeletingLine = (b.deleteCount === -1); + return ( + (b.lineNumber - a.lineNumber) || + (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) || + (b.editColumn - a.editColumn) || + (b.insertText.length - a.insertText.length) + ); + }); + // Remove duplicate entries (needed for following collapse step) + /** @type {RuleOnErrorFixInfo} */ + let lastFixInfo = {}; + fixInfos = fixInfos.filter((fixInfo) => { + const unique = ( + (fixInfo.lineNumber !== lastFixInfo.lineNumber) || + (fixInfo.editColumn !== lastFixInfo.editColumn) || + (fixInfo.deleteCount !== lastFixInfo.deleteCount) || + (fixInfo.insertText !== lastFixInfo.insertText) + ); + lastFixInfo = fixInfo; + return unique; + }); + // Collapse insert/no-delete and no-insert/delete for same line/column + lastFixInfo = { + "lineNumber": -1 + }; + for (const fixInfo of fixInfos) { + if ( + (fixInfo.lineNumber === lastFixInfo.lineNumber) && + (fixInfo.editColumn === lastFixInfo.editColumn) && + !fixInfo.insertText && + (fixInfo.deleteCount > 0) && + lastFixInfo.insertText && + !lastFixInfo.deleteCount) { + fixInfo.insertText = lastFixInfo.insertText; + lastFixInfo.lineNumber = 0; + } + lastFixInfo = fixInfo; + } + fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber); + // Apply all (remaining/updated) fixes + let lastLineIndex = -1; + let lastEditIndex = -1; + for (const fixInfo of fixInfos) { + const { lineNumber, editColumn, deleteCount } = fixInfo; + const lineIndex = lineNumber - 1; + const editIndex = editColumn - 1; + if ( + (lineIndex !== lastLineIndex) || + (deleteCount === -1) || + ((editIndex + deleteCount) <= + (lastEditIndex - ((deleteCount > 0) ? 0 : 1))) + ) { + // @ts-ignore + lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding); + } + lastLineIndex = lineIndex; + lastEditIndex = editIndex; + } + // Return corrected input + return lines.filter((line) => line !== null).join(lineEnding); +} + +/** + * Gets the (semantic) version of the library. + * + * @returns {string} SemVer string. + */ +export function getVersion() { + return version; +} + +// Type declarations + +/** + * Function to implement rule logic. + * + * @callback RuleFunction + * @param {RuleParams} params Rule parameters. + * @param {RuleOnError} onError Error-reporting callback. + * @returns {void} + */ + +/** + * Rule parameters. + * + * @typedef {Object} RuleParams + * @property {string} name File/string name. + * @property {MarkdownParsers} parsers Markdown parser data. + * @property {readonly string[]} lines File/string lines. + * @property {readonly string[]} frontMatterLines Front matter lines. + * @property {RuleConfiguration} config Rule configuration. + * @property {string} version Version of the markdownlint library. + */ + +/** + * Markdown parser data. + * + * @typedef {Object} MarkdownParsers + * @property {ParserMarkdownIt} markdownit Markdown parser data from markdown-it (only present when Rule.parser is "markdownit"). + * @property {ParserMicromark} micromark Markdown parser data from micromark (only present when Rule.parser is "micromark"). + */ + +/** + * Markdown parser data from markdown-it. + * + * @typedef {Object} ParserMarkdownIt + * @property {MarkdownItToken[]} tokens Token objects from markdown-it. + */ + +/** + * Markdown parser data from micromark. + * + * @typedef {Object} ParserMicromark + * @property {MicromarkToken[]} tokens Token objects from micromark. + */ + +/** + * markdown-it token. + * + * @typedef {Object} MarkdownItToken + * @property {string[][]} attrs HTML attributes. + * @property {boolean} block Block-level token. + * @property {MarkdownItToken[]} children Child nodes. + * @property {string} content Tag contents. + * @property {boolean} hidden Ignore element. + * @property {string} info Fence info. + * @property {number} level Nesting level. + * @property {number[]} map Beginning/ending line numbers. + * @property {string} markup Markup text. + * @property {Object} meta Arbitrary data. + * @property {number} nesting Level change. + * @property {string} tag HTML tag name. + * @property {string} type Token type. + * @property {number} lineNumber Line number (1-based). + * @property {string} line Line content. + */ + +/** @typedef {import("micromark-util-types").TokenType} MicromarkTokenType */ + +/** + * micromark token. + * + * @typedef {Object} MicromarkToken + * @property {MicromarkTokenType} type Token type. + * @property {number} startLine Start line (1-based). + * @property {number} startColumn Start column (1-based). + * @property {number} endLine End line (1-based). + * @property {number} endColumn End column (1-based). + * @property {string} text Token text. + * @property {MicromarkToken[]} children Child tokens. + * @property {MicromarkToken | null} parent Parent token. + */ + +/** + * Error-reporting callback. + * + * @callback RuleOnError + * @param {RuleOnErrorInfo} onErrorInfo Error information. + * @returns {void} + */ + +/** + * Fix information for RuleOnError callback. + * + * @typedef {Object} RuleOnErrorInfo + * @property {number} lineNumber Line number (1-based). + * @property {string} [detail] Detail about the error. + * @property {string} [context] Context for the error. + * @property {URL} [information] Link to more information. + * @property {number[]} [range] Column number (1-based) and length. + * @property {RuleOnErrorFixInfo} [fixInfo] Fix information. + */ + +/** + * Fix information for RuleOnErrorInfo. + * + * @typedef {Object} RuleOnErrorFixInfo + * @property {number} [lineNumber] Line number (1-based). + * @property {number} [editColumn] Column of the fix (1-based). + * @property {number} [deleteCount] Count of characters to delete. + * @property {string} [insertText] Text to insert (after deleting). + */ + +/** + * Rule definition. + * + * @typedef {Object} Rule + * @property {string[]} names Rule name(s). + * @property {string} description Rule description. + * @property {URL} [information] Link to more information. + * @property {string[]} tags Rule tag(s). + * @property {"markdownit" | "micromark" | "none"} parser Parser used. + * @property {boolean} [asynchronous] True if asynchronous. + * @property {RuleFunction} function Rule implementation. + */ + +/** + * Method used by the markdown-it parser to parse input. + * + * @callback MarkdownItParse + * @param {string} src Source string. + * @param {Object} env Environment sandbox. + * @returns {import("markdown-it").Token[]} Tokens. + */ + +/** + * Instance of the markdown-it parser. + * + * @typedef MarkdownIt + * @property {MarkdownItParse} parse Method to parse input. + */ + +/** + * Gets an instance of the markdown-it parser. Any plugins should already have been loaded. + * + * @callback MarkdownItFactory + * @returns {MarkdownIt|Promise} Instance of the markdown-it parser. + */ + +/** + * Configuration options. + * + * @typedef {Object} Options + * @property {Configuration} [config] Configuration object. + * @property {ConfigurationParser[]} [configParsers] Configuration parsers. + * @property {Rule[] | Rule} [customRules] Custom rules. + * @property {string[] | string} [files] Files to lint. + * @property {RegExp | null} [frontMatter] Front matter pattern. + * @property {FsLike} [fs] File system implementation. + * @property {boolean} [handleRuleFailures] True to catch exceptions. + * @property {MarkdownItFactory} [markdownItFactory] Function to create a markdown-it parser. + * @property {boolean} [noInlineConfig] True to ignore HTML directives. + * @property {Object.} [strings] Strings to lint. + */ + +/** + * A markdown-it plugin. + * + * @typedef {Object[]} Plugin + */ + +/** + * Lint results. + * + * @typedef {Object.} LintResults + */ + +/** + * Lint error. + * + * @typedef {Object} LintError + * @property {number} lineNumber Line number (1-based). + * @property {string[]} ruleNames Rule name(s). + * @property {string} ruleDescription Rule description. + * @property {string | null} ruleInformation Link to more information. + * @property {string | null} errorDetail Detail about the error. + * @property {string | null} errorContext Context for the error. + * @property {number[] | null} errorRange Column number (1-based) and length. + * @property {FixInfo | null} fixInfo Fix information. + * @property {"error" | "warning"} severity Severity of the error. + */ + +/** + * Fix information. + * + * @typedef {Object} FixInfo + * @property {number} [lineNumber] Line number (1-based). + * @property {number} [editColumn] Column of the fix (1-based). + * @property {number} [deleteCount] Count of characters to delete. + * @property {string} [insertText] Text to insert (after deleting). + */ + +/** + * FixInfo with all optional properties present. + * + * @typedef {Object} FixInfoNormalized + * @property {number} lineNumber Line number (1-based). + * @property {number} editColumn Column of the fix (1-based). + * @property {number} deleteCount Count of characters to delete. + * @property {string} insertText Text to insert (after deleting). + */ + +/** + * Called with the result of linting a string or document. + * + * @callback LintContentCallback + * @param {Error | null} error Error iff failed. + * @param {LintError[]} [result] Result iff successful. + * @returns {void} + */ + +/** + * Called with the result of the lint function. + * + * @callback LintCallback + * @param {Error | null} error Error object iff failed. + * @param {LintResults} [results] Lint results iff succeeded. + * @returns {void} + */ + +/** + * Configuration object for linting rules. For the JSON schema, see + * {@link ../schema/markdownlint-config-schema.json}. + * + * @typedef {import("./configuration.d.ts").Configuration} Configuration + */ + +/** + * Configuration object for linting rules strictly. For the JSON schema, see + * {@link ../schema/markdownlint-config-schema-strict.json}. + * + * @typedef {import("./configuration-strict.d.ts").ConfigurationStrict} ConfigurationStrict + */ + +/** + * Rule configuration object. + * + * @typedef {boolean | Object} RuleConfiguration Rule configuration. + */ + +/** + * Parses a configuration string and returns a configuration object. + * + * @callback ConfigurationParser + * @param {string} text Configuration string. + * @returns {Configuration} + */ + +/** + * Called with the result of the readConfig function. + * + * @callback ReadConfigCallback + * @param {Error | null} err Error object or null. + * @param {Configuration} [config] Configuration object. + * @returns {void} + */ + +/** + * Called with the result of the resolveConfigExtends function. + * + * @callback ResolveConfigExtendsCallback + * @param {Error | null} err Error object or null. + * @param {string} [path] Resolved path to file. + * @returns {void} + */ diff --git a/lib/md001.mjs b/lib/md001.mjs new file mode 100644 index 00000000..d3f8cefd --- /dev/null +++ b/lib/md001.mjs @@ -0,0 +1,32 @@ +// @ts-check + +import { addErrorDetailIf, frontMatterHasTitle } from "../helpers/helpers.cjs"; +import { getHeadingLevel } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD001", "heading-increment" ], + "description": "Heading levels should only increment by one level at a time", + "tags": [ "headings" ], + "parser": "micromark", + "function": function MD001(params, onError) { + const hasTitle = frontMatterHasTitle( + params.frontMatterLines, + params.config.front_matter_title + ); + let prevLevel = hasTitle ? 1 : Number.MAX_SAFE_INTEGER; + for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) { + const level = getHeadingLevel(heading); + if (level > prevLevel) { + addErrorDetailIf( + onError, + heading.startLine, + `h${prevLevel + 1}`, + `h${level}` + ); + } + prevLevel = level; + } + } +}; diff --git a/lib/md003.mjs b/lib/md003.mjs new file mode 100644 index 00000000..d06068da --- /dev/null +++ b/lib/md003.mjs @@ -0,0 +1,47 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { getHeadingLevel, getHeadingStyle } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD003", "heading-style" ], + "description": "Heading style", + "tags": [ "headings" ], + "parser": "micromark", + "function": function MD003(params, onError) { + let style = String(params.config.style || "consistent"); + for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) { + const styleForToken = getHeadingStyle(heading); + if (style === "consistent") { + style = styleForToken; + } + if (styleForToken !== style) { + const h12 = getHeadingLevel(heading) <= 2; + const setextWithAtx = + (style === "setext_with_atx") && + ((h12 && (styleForToken === "setext")) || + (!h12 && (styleForToken === "atx"))); + const setextWithAtxClosed = + (style === "setext_with_atx_closed") && + ((h12 && (styleForToken === "setext")) || + (!h12 && (styleForToken === "atx_closed"))); + if (!setextWithAtx && !setextWithAtxClosed) { + let expected = style; + if (style === "setext_with_atx") { + expected = h12 ? "setext" : "atx"; + } else if (style === "setext_with_atx_closed") { + expected = h12 ? "setext" : "atx_closed"; + } + addErrorDetailIf( + onError, + heading.startLine, + expected, + styleForToken + ); + } + } + } + } +}; diff --git a/lib/md004.mjs b/lib/md004.mjs new file mode 100644 index 00000000..aaf6bd48 --- /dev/null +++ b/lib/md004.mjs @@ -0,0 +1,72 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { getDescendantsByType, getParentOfType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const markerToStyle = (/** @type {string} */ marker) => (marker === "-") ? "dash" : ((marker === "+") ? "plus" : "asterisk"); +const styleToMarker = (/** @type {string} */ style) => (style === "dash") ? "-" : ((style === "plus") ? "+" : "*"); +const differentItemStyle = (/** @type {string} */ style) => (style === "dash") ? "plus" : ((style === "plus") ? "asterisk" : "dash"); +const validStyles = new Set([ + "asterisk", + "consistent", + "dash", + "plus", + "sublist" +]); + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD004", "ul-style" ], + "description": "Unordered list style", + "tags": [ "bullet", "ul" ], + "parser": "micromark", + "function": function MD004(params, onError) { + const style = String(params.config.style || "consistent"); + let expectedStyle = validStyles.has(style) ? style : "dash"; + /** @type {("asterisk"|"dash"|"plus")[]} */ + const nestingStyles = []; + for (const listUnordered of filterByTypesCached([ "listUnordered" ])) { + let nesting = 0; + if (style === "sublist") { + /** @type {import("markdownlint").MicromarkToken | null} */ + let parent = listUnordered; + // @ts-ignore + while ((parent = getParentOfType(parent, [ "listOrdered", "listUnordered" ]))) { + nesting++; + } + } + const listItemMarkers = getDescendantsByType(listUnordered, [ "listItemPrefix", "listItemMarker" ]); + for (const listItemMarker of listItemMarkers) { + const itemStyle = markerToStyle(listItemMarker.text); + if (style === "sublist") { + if (!nestingStyles[nesting]) { + nestingStyles[nesting] = + (itemStyle === nestingStyles[nesting - 1]) ? + differentItemStyle(itemStyle) : + itemStyle; + } + expectedStyle = nestingStyles[nesting]; + } else if (expectedStyle === "consistent") { + expectedStyle = itemStyle; + } + const column = listItemMarker.startColumn; + const length = listItemMarker.endColumn - listItemMarker.startColumn; + addErrorDetailIf( + onError, + listItemMarker.startLine, + expectedStyle, + itemStyle, + undefined, + undefined, + [ column, length ], + { + "editColumn": column, + "deleteCount": length, + "insertText": styleToMarker(expectedStyle) + } + ); + } + } + } +}; diff --git a/lib/md005.mjs b/lib/md005.mjs new file mode 100644 index 00000000..33374a7b --- /dev/null +++ b/lib/md005.mjs @@ -0,0 +1,69 @@ +// @ts-check + +import { addError, addErrorDetailIf } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD005", "list-indent" ], + "description": "Inconsistent indentation for list items at the same level", + "tags": [ "bullet", "ul", "indentation" ], + "parser": "micromark", + "function": function MD005(params, onError) { + for (const list of filterByTypesCached([ "listOrdered", "listUnordered" ])) { + const expectedIndent = list.startColumn - 1; + let expectedEnd = 0; + let endMatching = false; + const listItemPrefixes = + list.children.filter((token) => (token.type === "listItemPrefix")); + for (const listItemPrefix of listItemPrefixes) { + const lineNumber = listItemPrefix.startLine; + const actualIndent = listItemPrefix.startColumn - 1; + const range = [ 1, listItemPrefix.endColumn - 1 ]; + if (list.type === "listUnordered") { + addErrorDetailIf( + onError, + lineNumber, + expectedIndent, + actualIndent, + undefined, + undefined, + range + // No fixInfo; MD007 handles this scenario better + ); + } else { + const markerLength = listItemPrefix.text.trim().length; + const actualEnd = listItemPrefix.startColumn + markerLength - 1; + expectedEnd = expectedEnd || actualEnd; + if ((expectedIndent !== actualIndent) || endMatching) { + if (expectedEnd === actualEnd) { + endMatching = true; + } else { + const detail = endMatching ? + `Expected: (${expectedEnd}); Actual: (${actualEnd})` : + `Expected: ${expectedIndent}; Actual: ${actualIndent}`; + const expected = endMatching ? + expectedEnd - markerLength : + expectedIndent; + const actual = endMatching ? + actualEnd - markerLength : + actualIndent; + addError( + onError, + lineNumber, + detail, + undefined, + range, + { + "editColumn": Math.min(actual, expected) + 1, + "deleteCount": Math.max(actual - expected, 0), + "insertText": "".padEnd(Math.max(expected - actual, 0)) + } + ); + } + } + } + } + } + } +}; diff --git a/lib/md007.mjs b/lib/md007.mjs new file mode 100644 index 00000000..6c2bd31c --- /dev/null +++ b/lib/md007.mjs @@ -0,0 +1,84 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { getParentOfType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("micromark-util-types").TokenType[]} */ +const unorderedListTypes = + [ "blockQuotePrefix", "listItemPrefix", "listUnordered" ]; +/** @type {import("micromark-util-types").TokenType[]} */ +const unorderedParentTypes = + [ "blockQuote", "listOrdered", "listUnordered" ]; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD007", "ul-indent" ], + "description": "Unordered list indentation", + "tags": [ "bullet", "ul", "indentation" ], + "parser": "micromark", + "function": function MD007(params, onError) { + const indent = Number(params.config.indent || 2); + const startIndented = !!params.config.start_indented; + const startIndent = Number(params.config.start_indent || indent); + const unorderedListNesting = new Map(); + let lastBlockQuotePrefix = null; + const tokens = filterByTypesCached(unorderedListTypes); + for (const token of tokens) { + const { endColumn, parent, startColumn, startLine, type } = token; + if (type === "blockQuotePrefix") { + lastBlockQuotePrefix = token; + } else if (type === "listUnordered") { + let nesting = 0; + /** @type {import("markdownlint").MicromarkToken | null} */ + let current = token; + while ( + // @ts-ignore + (current = getParentOfType(current, unorderedParentTypes)) + ) { + if (current.type === "listUnordered") { + nesting++; + // eslint-disable-next-line no-continue + continue; + } else if (current.type === "listOrdered") { + nesting = -1; + } + break; + } + if (nesting >= 0) { + unorderedListNesting.set(token, nesting); + } + } else { + // listItemPrefix + const nesting = unorderedListNesting.get(parent); + if (nesting !== undefined) { + // listItemPrefix for listUnordered + const baseIndent = (getParentOfType(token, [ "gfmFootnoteDefinition" ])) ? 4 : 0; + const expectedIndent = + baseIndent + (startIndented ? startIndent : 0) + (nesting * indent); + const blockQuoteAdjustment = + (lastBlockQuotePrefix?.endLine === startLine) ? + (lastBlockQuotePrefix.endColumn - 1) : + 0; + const actualIndent = startColumn - 1 - blockQuoteAdjustment; + const range = [ 1, endColumn - 1 ]; + const fixInfo = { + "editColumn": startColumn - actualIndent, + "deleteCount": Math.max(actualIndent - expectedIndent, 0), + "insertText": "".padEnd(Math.max(expectedIndent - actualIndent, 0)) + }; + addErrorDetailIf( + onError, + startLine, + expectedIndent, + actualIndent, + undefined, + undefined, + range, + fixInfo + ); + } + } + } + } +}; diff --git a/lib/md009.mjs b/lib/md009.mjs new file mode 100644 index 00000000..f27a641b --- /dev/null +++ b/lib/md009.mjs @@ -0,0 +1,96 @@ +// @ts-check + +import { addError } from "../helpers/helpers.cjs"; +import { addRangeToSet } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD009", "no-trailing-spaces" ], + "description": "Trailing spaces", + "tags": [ "whitespace" ], + "parser": "micromark", + "function": function MD009(params, onError) { + let brSpaces = params.config.br_spaces; + brSpaces = Number((brSpaces === undefined) ? 2 : brSpaces); + const codeBlocks = params.config.code_blocks; + const includeCode = (codeBlocks === undefined) ? false : !!codeBlocks; + const listItemEmptyLines = !!params.config.list_item_empty_lines; + const strict = !!params.config.strict; + const codeBlockLineNumbers = new Set(); + if (!includeCode) { + for (const codeBlock of filterByTypesCached([ "codeFenced" ])) { + addRangeToSet(codeBlockLineNumbers, codeBlock.startLine + 1, codeBlock.endLine - 1); + } + for (const codeBlock of filterByTypesCached([ "codeIndented" ])) { + addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine); + } + } + const listItemLineNumbers = new Set(); + if (listItemEmptyLines) { + for (const listBlock of filterByTypesCached([ "listOrdered", "listUnordered" ])) { + addRangeToSet(listItemLineNumbers, listBlock.startLine, listBlock.endLine); + let trailingIndent = true; + for (let i = listBlock.children.length - 1; i >= 0; i--) { + const child = listBlock.children[i]; + switch (child.type) { + case "content": + trailingIndent = false; + break; + case "listItemIndent": + if (trailingIndent) { + listItemLineNumbers.delete(child.startLine); + } + break; + case "listItemPrefix": + trailingIndent = true; + break; + default: + break; + } + } + } + } + const paragraphLineNumbers = new Set(); + const codeInlineLineNumbers = new Set(); + if (strict) { + for (const paragraph of filterByTypesCached([ "paragraph" ])) { + addRangeToSet(paragraphLineNumbers, paragraph.startLine, paragraph.endLine - 1); + } + for (const codeText of filterByTypesCached([ "codeText" ])) { + addRangeToSet(codeInlineLineNumbers, codeText.startLine, codeText.endLine - 1); + } + } + const expected = (brSpaces < 2) ? 0 : brSpaces; + for (let lineIndex = 0; lineIndex < params.lines.length; lineIndex++) { + const line = params.lines[lineIndex]; + const lineNumber = lineIndex + 1; + const trailingSpaces = line.length - line.trimEnd().length; + if ( + trailingSpaces && + !codeBlockLineNumbers.has(lineNumber) && + !listItemLineNumbers.has(lineNumber) && + ( + (expected !== trailingSpaces) || + (strict && + (!paragraphLineNumbers.has(lineNumber) || + codeInlineLineNumbers.has(lineNumber))) + ) + ) { + const column = line.length - trailingSpaces + 1; + addError( + onError, + lineNumber, + "Expected: " + (expected === 0 ? "" : "0 or ") + + expected + "; Actual: " + trailingSpaces, + undefined, + [ column, trailingSpaces ], + { + "editColumn": column, + "deleteCount": trailingSpaces + } + ); + } + } + } +}; diff --git a/lib/md010.mjs b/lib/md010.mjs new file mode 100644 index 00000000..da3fb6d1 --- /dev/null +++ b/lib/md010.mjs @@ -0,0 +1,78 @@ +// @ts-check + +import { addError, hasOverlap } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const tabRe = /\t+/g; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD010", "no-hard-tabs" ], + "description": "Hard tabs", + "tags": [ "whitespace", "hard_tab" ], + "parser": "micromark", + "function": function MD010(params, onError) { + const codeBlocks = params.config.code_blocks; + const includeCode = (codeBlocks === undefined) ? true : !!codeBlocks; + const ignoreCodeLanguages = new Set( + (params.config.ignore_code_languages || []) + .map((/** @type {void} */ language) => String(language).toLowerCase()) + ); + const spacesPerTab = params.config.spaces_per_tab; + const spaceMultiplier = (spacesPerTab === undefined) ? + 1 : + Math.max(0, Number(spacesPerTab)); + /** @type {import("markdownlint").MicromarkTokenType[]} */ + const exclusionTypes = []; + if (includeCode) { + if (ignoreCodeLanguages.size > 0) { + exclusionTypes.push("codeFenced"); + } + } else { + exclusionTypes.push("codeFenced", "codeIndented", "codeText"); + } + const codeTokens = filterByTypesCached(exclusionTypes).filter((token) => { + if ((token.type === "codeFenced") && (ignoreCodeLanguages.size > 0)) { + const fenceInfos = getDescendantsByType(token, [ "codeFencedFence", "codeFencedFenceInfo" ]); + return fenceInfos.every((fenceInfo) => ignoreCodeLanguages.has(fenceInfo.text.toLowerCase())); + } + return true; + }); + const codeRanges = codeTokens.map((token) => { + const { type, startLine, startColumn, endLine, endColumn } = token; + const codeFenced = (type === "codeFenced"); + return { + "startLine": startLine + (codeFenced ? 1 : 0), + "startColumn": codeFenced ? 0 : startColumn, + "endLine": endLine - (codeFenced ? 1 : 0), + "endColumn": codeFenced ? Number.MAX_SAFE_INTEGER : endColumn + }; + }); + for (let lineIndex = 0; lineIndex < params.lines.length; lineIndex++) { + const line = params.lines[lineIndex]; + let match = null; + while ((match = tabRe.exec(line)) !== null) { + const lineNumber = lineIndex + 1; + const column = match.index + 1; + const length = match[0].length; + /** @type {import("../helpers/helpers.cjs").FileRange} */ + const range = { "startLine": lineNumber, "startColumn": column, "endLine": lineNumber, "endColumn": column + length - 1 }; + if (!codeRanges.some((codeRange) => hasOverlap(codeRange, range))) { + addError( + onError, + lineNumber, + "Column: " + column, + undefined, + [ column, length ], + { + "editColumn": column, + "deleteCount": length, + "insertText": "".padEnd(length * spaceMultiplier) + } + ); + } + } + } + } +}; diff --git a/lib/md011.mjs b/lib/md011.mjs new file mode 100644 index 00000000..f9cce643 --- /dev/null +++ b/lib/md011.mjs @@ -0,0 +1,56 @@ +// @ts-check + +import { addError, hasOverlap } from "../helpers/helpers.cjs"; +import { addRangeToSet } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("micromark-extension-math")} */ + +const reversedLinkRe = /(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD011", "no-reversed-links" ], + "description": "Reversed link syntax", + "tags": [ "links" ], + "parser": "micromark", + "function": function MD011(params, onError) { + const ignoreBlockLineNumbers = new Set(); + for (const ignoreBlock of filterByTypesCached([ "codeFenced", "codeIndented", "mathFlow" ])) { + addRangeToSet(ignoreBlockLineNumbers, ignoreBlock.startLine, ignoreBlock.endLine); + } + const ignoreTexts = filterByTypesCached([ "codeText", "mathText" ]); + for (const [ lineIndex, line ] of params.lines.entries()) { + const lineNumber = lineIndex + 1; + if (!ignoreBlockLineNumbers.has(lineNumber)) { + let match = null; + while ((match = reversedLinkRe.exec(line)) !== null) { + const [ reversedLink, preChar, linkText, linkDestination ] = match; + if ( + !linkText.endsWith("\\") && + !linkDestination.endsWith("\\") + ) { + const column = match.index + preChar.length + 1; + const length = match[0].length - preChar.length; + /** @type {import("../helpers/helpers.cjs").FileRange} */ + const range = { "startLine": lineNumber, "startColumn": column, "endLine": lineNumber, "endColumn": column + length - 1 }; + if (!ignoreTexts.some((ignoreText) => hasOverlap(ignoreText, range))) { + addError( + onError, + lineNumber, + reversedLink.slice(preChar.length), + undefined, + [ column, length ], + { + "editColumn": column, + "deleteCount": length, + "insertText": `[${linkText}](${linkDestination})` + } + ); + } + } + } + } + } + } +}; diff --git a/lib/md012.mjs b/lib/md012.mjs new file mode 100644 index 00000000..2ec4a84e --- /dev/null +++ b/lib/md012.mjs @@ -0,0 +1,40 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { addRangeToSet } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD012", "no-multiple-blanks" ], + "description": "Multiple consecutive blank lines", + "tags": [ "whitespace", "blank_lines" ], + "parser": "micromark", + "function": function MD012(params, onError) { + const maximum = Number(params.config.maximum || 1); + const { lines } = params; + const codeBlockLineNumbers = new Set(); + for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) { + addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine); + } + let count = 0; + for (const [ lineIndex, line ] of lines.entries()) { + const inCode = codeBlockLineNumbers.has(lineIndex + 1); + count = (inCode || (line.trim().length > 0)) ? 0 : count + 1; + if (maximum < count) { + addErrorDetailIf( + onError, + lineIndex + 1, + maximum, + count, + undefined, + undefined, + undefined, + { + "deleteCount": -1 + } + ); + } + } + } +}; diff --git a/lib/md013.mjs b/lib/md013.mjs new file mode 100644 index 00000000..9d8792d6 --- /dev/null +++ b/lib/md013.mjs @@ -0,0 +1,91 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { filterByTypesCached, getReferenceLinkImageData } from "./cache.mjs"; +import { addRangeToSet, getDescendantsByType } from "../helpers/micromark-helpers.cjs"; + +// Regular expression for a line that is not wrappable +const notWrappableRe = /^(?:[#>\s]*\s)?\S*$/; + +/** @typedef {import("micromark-extension-gfm-autolink-literal")} */ +/** @typedef {import("micromark-extension-gfm-table")} */ + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD013", "line-length" ], + "description": "Line length", + "tags": [ "line_length" ], + "parser": "micromark", + "function": function MD013(params, onError) { + const lineLength = Number(params.config.line_length || 80); + const headingLineLength = Number(params.config.heading_line_length || lineLength); + const codeLineLength = Number(params.config.code_block_line_length || lineLength); + const strict = !!params.config.strict; + const stern = !!params.config.stern; + const codeBlocks = params.config.code_blocks; + const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks; + const tables = params.config.tables; + const includeTables = (tables === undefined) ? true : !!tables; + const headings = params.config.headings; + const includeHeadings = (headings === undefined) ? true : !!headings; + const headingLineNumbers = new Set(); + for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) { + addRangeToSet(headingLineNumbers, heading.startLine, heading.endLine); + } + const codeBlockLineNumbers = new Set(); + for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) { + addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine); + } + const tableLineNumbers = new Set(); + for (const table of filterByTypesCached([ "table" ])) { + addRangeToSet(tableLineNumbers, table.startLine, table.endLine); + } + const linkLineNumbers = new Set(); + for (const link of filterByTypesCached([ "autolink", "image", "link", "literalAutolink" ])) { + addRangeToSet(linkLineNumbers, link.startLine, link.endLine); + } + const paragraphDataLineNumbers = new Set(); + for (const paragraph of filterByTypesCached([ "paragraph" ])) { + for (const data of getDescendantsByType(paragraph, [ "data" ])) { + addRangeToSet(paragraphDataLineNumbers, data.startLine, data.endLine); + } + } + const linkOnlyLineNumbers = new Set(); + for (const lineNumber of linkLineNumbers) { + if (!paragraphDataLineNumbers.has(lineNumber)) { + linkOnlyLineNumbers.add(lineNumber); + } + } + const definitionLineIndices = new Set(getReferenceLinkImageData().definitionLineIndices); + for (let lineIndex = 0; lineIndex < params.lines.length; lineIndex++) { + const line = params.lines[lineIndex]; + const lineNumber = lineIndex + 1; + const isHeading = headingLineNumbers.has(lineNumber); + const inCode = codeBlockLineNumbers.has(lineNumber); + const inTable = tableLineNumbers.has(lineNumber); + const maxLength = inCode ? codeLineLength : (isHeading ? headingLineLength : lineLength); + // If not strict/stern, the last run of non-whitespace is allowed to go + // beyond the limit as long as it begins within the limit + const text = (strict || stern) ? line : line.replace(/\S*$/u, "#"); + if ((maxLength > 0) && + (includeCodeBlocks || !inCode) && + (includeTables || !inTable) && + (includeHeadings || !isHeading) && + !definitionLineIndices.has(lineIndex) && + (strict || + (!(stern && notWrappableRe.test(line)) && + !linkOnlyLineNumbers.has(lineNumber))) && + (text.length > maxLength)) { + addErrorDetailIf( + onError, + lineNumber, + maxLength, + line.length, + undefined, + undefined, + [ maxLength + 1, line.length - maxLength ] + ); + } + } + } +}; diff --git a/lib/md014.mjs b/lib/md014.mjs new file mode 100644 index 00000000..351d2f40 --- /dev/null +++ b/lib/md014.mjs @@ -0,0 +1,47 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const dollarCommandRe = /^(\s*)(\$\s+)/; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD014", "commands-show-output" ], + "description": "Dollar signs used before commands without showing output", + "tags": [ "code" ], + "parser": "micromark", + "function": function MD014(params, onError) { + for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) { + const codeFlowValues = codeBlock.children.filter((child) => child.type === "codeFlowValue"); + const dollarMatches = codeFlowValues + .map((codeFlowValue) => ({ + "result": codeFlowValue.text.match(dollarCommandRe), + "startColumn": codeFlowValue.startColumn, + "startLine": codeFlowValue.startLine, + "text": codeFlowValue.text + })) + .filter((dollarMatch) => dollarMatch.result); + if (dollarMatches.length === codeFlowValues.length) { + for (const dollarMatch of dollarMatches) { + // @ts-ignore + const column = dollarMatch.startColumn + dollarMatch.result[1].length; + // @ts-ignore + const length = dollarMatch.result[2].length; + addErrorContext( + onError, + dollarMatch.startLine, + dollarMatch.text, + undefined, + undefined, + [ column, length ], + { + "editColumn": column, + "deleteCount": length + } + ); + } + } + } + } +}; diff --git a/lib/md018.mjs b/lib/md018.mjs new file mode 100644 index 00000000..8575d048 --- /dev/null +++ b/lib/md018.mjs @@ -0,0 +1,43 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { addRangeToSet } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD018", "no-missing-space-atx" ], + "description": "No space after hash on atx style heading", + "tags": [ "headings", "atx", "spaces" ], + "parser": "micromark", + "function": function MD018(params, onError) { + const { lines } = params; + const ignoreBlockLineNumbers = new Set(); + for (const ignoreBlock of filterByTypesCached([ "codeFenced", "codeIndented", "htmlFlow" ])) { + addRangeToSet(ignoreBlockLineNumbers, ignoreBlock.startLine, ignoreBlock.endLine); + } + for (const [ lineIndex, line ] of lines.entries()) { + if ( + !ignoreBlockLineNumbers.has(lineIndex + 1) && + /^#+[^# \t]/.test(line) && + !/#\s*$/.test(line) && + !line.startsWith("#️⃣") + ) { + // @ts-ignore + const hashCount = /^#+/.exec(line)[0].length; + addErrorContext( + onError, + lineIndex + 1, + line.trim(), + undefined, + undefined, + [ 1, hashCount + 1 ], + { + "editColumn": hashCount + 1, + "insertText": " " + } + ); + } + } + } +}; diff --git a/lib/md019-md021.mjs b/lib/md019-md021.mjs new file mode 100644 index 00000000..ef579d47 --- /dev/null +++ b/lib/md019-md021.mjs @@ -0,0 +1,77 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { getHeadingStyle } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** + * Validate heading sequence and whitespace length at start or end. + * + * @param {import("markdownlint").RuleOnError} onError Error-reporting callback. + * @param {import("markdownlint").MicromarkToken} heading ATX heading token. + * @param {number} delta Direction to scan. + * @returns {void} + */ +function validateHeadingSpaces(onError, heading, delta) { + const { children, startLine, text } = heading; + let index = (delta > 0) ? 0 : (children.length - 1); + while ( + children[index] && + (children[index].type !== "atxHeadingSequence") + ) { + index += delta; + } + const headingSequence = children[index]; + const whitespace = children[index + delta]; + if ( + (headingSequence?.type === "atxHeadingSequence") && + (whitespace?.type === "whitespace") && + (whitespace.text.length > 1) + ) { + const column = whitespace.startColumn + 1; + const length = whitespace.endColumn - column; + addErrorContext( + onError, + startLine, + text.trim(), + delta > 0, + delta < 0, + [ column, length ], + { + "editColumn": column, + "deleteCount": length + } + ); + } +} + +/** @type {import("markdownlint").Rule[]} */ +export default [ + { + "names": [ "MD019", "no-multiple-space-atx" ], + "description": "Multiple spaces after hash on atx style heading", + "tags": [ "headings", "atx", "spaces" ], + "parser": "micromark", + "function": function MD019(params, onError) { + const atxHeadings = filterByTypesCached([ "atxHeading" ]) + .filter((heading) => getHeadingStyle(heading) === "atx"); + for (const atxHeading of atxHeadings) { + validateHeadingSpaces(onError, atxHeading, 1); + } + } + }, + { + "names": [ "MD021", "no-multiple-space-closed-atx" ], + "description": "Multiple spaces inside hashes on closed atx style heading", + "tags": [ "headings", "atx_closed", "spaces" ], + "parser": "micromark", + "function": function MD021(params, onError) { + const atxClosedHeadings = filterByTypesCached([ "atxHeading" ]) + .filter((heading) => getHeadingStyle(heading) === "atx_closed"); + for (const atxClosedHeading of atxClosedHeadings) { + validateHeadingSpaces(onError, atxClosedHeading, 1); + validateHeadingSpaces(onError, atxClosedHeading, -1); + } + } + } +]; diff --git a/lib/md020.mjs b/lib/md020.mjs new file mode 100644 index 00000000..3b45d2a3 --- /dev/null +++ b/lib/md020.mjs @@ -0,0 +1,68 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { addRangeToSet } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD020", "no-missing-space-closed-atx" ], + "description": "No space inside hashes on closed atx style heading", + "tags": [ "headings", "atx_closed", "spaces" ], + "parser": "micromark", + "function": function MD020(params, onError) { + const { lines } = params; + const ignoreBlockLineNumbers = new Set(); + for (const ignoreBlock of filterByTypesCached([ "codeFenced", "codeIndented", "htmlFlow" ])) { + addRangeToSet(ignoreBlockLineNumbers, ignoreBlock.startLine, ignoreBlock.endLine); + } + for (const [ lineIndex, line ] of lines.entries()) { + if (!ignoreBlockLineNumbers.has(lineIndex + 1)) { + const match = + /^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line); + if (match) { + const [ + , + leftHash, + { "length": leftSpaceLength }, + content, + { "length": rightSpaceLength }, + rightEscape, + rightHash, + { "length": trailSpaceLength } + ] = match; + const leftHashLength = leftHash.length; + const rightHashLength = rightHash.length; + const left = !leftSpaceLength; + const right = !rightSpaceLength || !!rightEscape; + const rightEscapeReplacement = rightEscape ? `${rightEscape} ` : ""; + if (left || right) { + const range = left ? + [ + 1, + leftHashLength + 1 + ] : + [ + line.length - trailSpaceLength - rightHashLength, + rightHashLength + 1 + ]; + addErrorContext( + onError, + lineIndex + 1, + line.trim(), + left, + right, + range, + { + "editColumn": 1, + "deleteCount": line.length, + "insertText": + `${leftHash} ${content} ${rightEscapeReplacement}${rightHash}` + } + ); + } + } + } + } + } +}; diff --git a/lib/md022.mjs b/lib/md022.mjs new file mode 100644 index 00000000..3e0c0560 --- /dev/null +++ b/lib/md022.mjs @@ -0,0 +1,100 @@ +// @ts-check + +import { addErrorDetailIf, isBlankLine } from "../helpers/helpers.cjs"; +import { getBlockQuotePrefixText, getHeadingLevel } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ + +const defaultLines = 1; + +// eslint-disable-next-line jsdoc/reject-any-type +const getLinesFunction = (/** @type {any} */ linesParam) => { + if (Array.isArray(linesParam)) { + const linesArray = new Array(6).fill(defaultLines); + for (const [ index, value ] of [ ...linesParam.entries() ].slice(0, 6)) { + linesArray[index] = value; + } + return (/** @type {MicromarkToken} */ heading) => linesArray[getHeadingLevel(heading) - 1]; + } + // Coerce linesParam to a number + const lines = (linesParam === undefined) ? defaultLines : Number(linesParam); + return () => lines; +}; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD022", "blanks-around-headings" ], + "description": "Headings should be surrounded by blank lines", + "tags": [ "headings", "blank_lines" ], + "parser": "micromark", + "function": function MD022(params, onError) { + const getLinesAbove = getLinesFunction(params.config.lines_above); + const getLinesBelow = getLinesFunction(params.config.lines_below); + const { lines } = params; + const blockQuotePrefixes = filterByTypesCached([ "blockQuotePrefix", "linePrefix" ]); + for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) { + const { startLine, endLine } = heading; + const line = lines[startLine - 1].trim(); + + // Check lines above + const linesAbove = getLinesAbove(heading); + if (linesAbove >= 0) { + let actualAbove = 0; + for ( + let i = 0; + (i < linesAbove) && isBlankLine(lines[startLine - 2 - i]); + i++ + ) { + actualAbove++; + } + addErrorDetailIf( + onError, + startLine, + linesAbove, + actualAbove, + "Above", + line, + undefined, + { + "insertText": getBlockQuotePrefixText( + blockQuotePrefixes, + startLine - 1, + linesAbove - actualAbove + ) + } + ); + } + + // Check lines below + const linesBelow = getLinesBelow(heading); + if (linesBelow >= 0) { + let actualBelow = 0; + for ( + let i = 0; + (i < linesBelow) && isBlankLine(lines[endLine + i]); + i++ + ) { + actualBelow++; + } + addErrorDetailIf( + onError, + startLine, + linesBelow, + actualBelow, + "Below", + line, + undefined, + { + "lineNumber": endLine + 1, + "insertText": getBlockQuotePrefixText( + blockQuotePrefixes, + endLine + 1, + linesBelow - actualBelow + ) + } + ); + } + } + } +}; diff --git a/lib/md023.mjs b/lib/md023.mjs new file mode 100644 index 00000000..bfb91beb --- /dev/null +++ b/lib/md023.mjs @@ -0,0 +1,37 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD023", "heading-start-left" ], + "description": "Headings must start at the beginning of the line", + "tags": [ "headings", "spaces" ], + "parser": "micromark", + "function": function MD023(params, onError) { + const headings = filterByTypesCached([ "atxHeading", "linePrefix", "setextHeading" ]); + for (let i = 0; i < headings.length - 1; i++) { + if ( + (headings[i].type === "linePrefix") && + (headings[i + 1].type !== "linePrefix") && + (headings[i].startLine === headings[i + 1].startLine) + ) { + const { endColumn, startColumn, startLine } = headings[i]; + const length = endColumn - startColumn; + addErrorContext( + onError, + startLine, + params.lines[startLine - 1], + true, + false, + [ startColumn, length ], + { + "editColumn": startColumn, + "deleteCount": length + } + ); + } + } + } +}; diff --git a/lib/md024.mjs b/lib/md024.mjs new file mode 100644 index 00000000..e10f7281 --- /dev/null +++ b/lib/md024.mjs @@ -0,0 +1,45 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { getHeadingLevel, getHeadingText } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD024", "no-duplicate-heading" ], + "description": "Multiple headings with the same content", + "tags": [ "headings" ], + "parser": "micromark", + "function": function MD024(params, onError) { + const siblingsOnly = !!params.config.siblings_only || false; + const knownContents = [ null, [] ]; + let lastLevel = 1; + let knownContent = knownContents[lastLevel]; + for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) { + const headingText = getHeadingText(heading); + if (siblingsOnly) { + const newLevel = getHeadingLevel(heading); + while (lastLevel < newLevel) { + lastLevel++; + knownContents[lastLevel] = []; + } + while (lastLevel > newLevel) { + knownContents[lastLevel] = []; + lastLevel--; + } + knownContent = knownContents[newLevel]; + } + // @ts-ignore + if (knownContent.includes(headingText)) { + addErrorContext( + onError, + heading.startLine, + headingText.trim() + ); + } else { + // @ts-ignore + knownContent.push(headingText); + } + } + } +}; diff --git a/lib/md025.mjs b/lib/md025.mjs new file mode 100644 index 00000000..7b239c2f --- /dev/null +++ b/lib/md025.mjs @@ -0,0 +1,45 @@ +// @ts-check + +import { addErrorContext, frontMatterHasTitle } from "../helpers/helpers.cjs"; +import { getHeadingLevel, getHeadingText, isDocfxTab, isHtmlFlowComment, nonContentTokens } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD025", "single-title", "single-h1" ], + "description": "Multiple top-level headings in the same document", + "tags": [ "headings" ], + "parser": "micromark", + "function": function MD025(params, onError) { + const level = Number(params.config.level || 1); + const { tokens } = params.parsers.micromark; + const matchingHeadings = filterByTypesCached([ "atxHeading", "setextHeading" ]) + .filter((heading) => (level === getHeadingLevel(heading)) && !isDocfxTab(heading)); + if (matchingHeadings.length > 0) { + const foundFrontMatterTitle = + frontMatterHasTitle( + params.frontMatterLines, + params.config.front_matter_title + ); + // Front matter title counts as a top-level heading if present + let hasTopLevelHeading = foundFrontMatterTitle; + if (!hasTopLevelHeading) { + // Check if the first matching heading is a top-level heading + const previousTokens = tokens.slice(0, tokens.indexOf(matchingHeadings[0])); + hasTopLevelHeading = previousTokens.every( + (token) => nonContentTokens.has(token.type) || isHtmlFlowComment(token) + ); + } + if (hasTopLevelHeading) { + // All other matching headings are violations + for (const heading of matchingHeadings.slice(foundFrontMatterTitle ? 0 : 1)) { + addErrorContext( + onError, + heading.startLine, + getHeadingText(heading) + ); + } + } + } + } +}; diff --git a/lib/md026.mjs b/lib/md026.mjs new file mode 100644 index 00000000..27348110 --- /dev/null +++ b/lib/md026.mjs @@ -0,0 +1,46 @@ +// @ts-check + +import { addError, allPunctuationNoQuestion, endOfLineGemojiCodeRe, + endOfLineHtmlEntityRe, escapeForRegExp } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD026", "no-trailing-punctuation" ], + "description": "Trailing punctuation in heading", + "tags": [ "headings" ], + "parser": "micromark", + "function": function MD026(params, onError) { + let punctuation = params.config.punctuation; + punctuation = String( + (punctuation === undefined) ? allPunctuationNoQuestion : punctuation + ); + const trailingPunctuationRe = + new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$"); + const headings = filterByTypesCached([ "atxHeadingText", "setextHeadingText" ]); + for (const heading of headings) { + const { endColumn, endLine, text } = heading; + const match = trailingPunctuationRe.exec(text); + if ( + match && + !endOfLineHtmlEntityRe.test(text) && + !endOfLineGemojiCodeRe.test(text) + ) { + const fullMatch = match[0]; + const length = fullMatch.length; + const column = endColumn - length; + addError( + onError, + endLine, + `Punctuation: '${fullMatch}'`, + undefined, + [ column, length ], + { + "editColumn": column, + "deleteCount": length + } + ); + } + } + } +}; diff --git a/lib/md027.mjs b/lib/md027.mjs new file mode 100644 index 00000000..17a2fed1 --- /dev/null +++ b/lib/md027.mjs @@ -0,0 +1,50 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { getParentOfType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("../helpers/micromark-helpers.cjs").TokenType[]} */ +const listTypes = [ "listOrdered", "listUnordered" ]; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD027", "no-multiple-space-blockquote" ], + "description": "Multiple spaces after blockquote symbol", + "tags": [ "blockquote", "whitespace", "indentation" ], + "parser": "micromark", + "function": function MD027(params, onError) { + const listItems = params.config.list_items; + const includeListItems = (listItems === undefined) ? true : !!listItems; + const { tokens } = params.parsers.micromark; + for (const token of filterByTypesCached([ "linePrefix" ])) { + const parent = token.parent; + const codeIndented = parent?.type === "codeIndented"; + const siblings = parent?.children || tokens; + if ( + !codeIndented && + (siblings[siblings.indexOf(token) - 1]?.type === "blockQuotePrefix") && + (includeListItems || ( + !listTypes.includes(siblings[siblings.indexOf(token) + 1]?.type) && + !getParentOfType(token, listTypes) + )) + ) { + const { startColumn, startLine, text } = token; + const { length } = text; + const line = params.lines[startLine - 1]; + addErrorContext( + onError, + startLine, + line, + undefined, + undefined, + [ startColumn, length ], + { + "editColumn": startColumn, + "deleteCount": length + } + ); + } + } + } +}; diff --git a/lib/md028.mjs b/lib/md028.mjs new file mode 100644 index 00000000..1f4ce9eb --- /dev/null +++ b/lib/md028.mjs @@ -0,0 +1,39 @@ +// @ts-check + +import { addError } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const ignoreTypes = new Set([ "lineEnding", "listItemIndent", "linePrefix" ]); + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD028", "no-blanks-blockquote" ], + "description": "Blank line inside blockquote", + "tags": [ "blockquote", "whitespace" ], + "parser": "micromark", + "function": function MD028(params, onError) { + for (const token of filterByTypesCached([ "blockQuote" ])) { + const errorLineNumbers = []; + const siblings = token.parent?.children || params.parsers.micromark.tokens; + for (let i = siblings.indexOf(token) + 1; i < siblings.length; i++) { + const sibling = siblings[i]; + const { startLine, type } = sibling; + if (type === "lineEndingBlank") { + // Possible blank between blockquotes + errorLineNumbers.push(startLine); + } else if (ignoreTypes.has(type)) { + // Ignore invisible formatting + } else if (type === "blockQuote") { + // Blockquote followed by blockquote + for (const lineNumber of errorLineNumbers) { + addError(onError, lineNumber); + } + break; + } else { + // Blockquote not followed by blockquote + break; + } + } + } + } +}; diff --git a/lib/md029.mjs b/lib/md029.mjs new file mode 100644 index 00000000..ec61a8ec --- /dev/null +++ b/lib/md029.mjs @@ -0,0 +1,84 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const listStyleExamples = { + "one": "1/1/1", + "ordered": "1/2/3", + "zero": "0/0/0" +}; + +/** + * Gets the column and text of an ordered list item prefix token. + * + * @param {import("markdownlint").MicromarkToken} listItemPrefix List item prefix token. + * @returns {{column: number, value: number}} List item value column and text. + */ +function getOrderedListItemValue(listItemPrefix) { + const listItemValue = getDescendantsByType(listItemPrefix, [ "listItemValue" ])[0]; + return { + "column": listItemValue.startColumn, + "value": Number(listItemValue.text) + }; +} + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD029", "ol-prefix" ], + "description": "Ordered list item prefix", + "tags": [ "ol" ], + "parser": "micromark", + "function": function MD029(params, onError) { + const style = String(params.config.style); + for (const listOrdered of filterByTypesCached([ "listOrdered" ])) { + const listItemPrefixes = getDescendantsByType(listOrdered, [ "listItemPrefix" ]); + let expected = 1; + let incrementing = false; + // Check for incrementing number pattern 1/2/3 or 0/1/2 + if (listItemPrefixes.length >= 2) { + const first = getOrderedListItemValue(listItemPrefixes[0]); + const second = getOrderedListItemValue(listItemPrefixes[1]); + if ((second.value !== 1) || (first.value === 0)) { + incrementing = true; + if (first.value === 0) { + expected = 0; + } + } + } + // Determine effective style + const listStyle = ((style === "one") || (style === "ordered") || (style === "zero")) ? + style : + (incrementing ? "ordered" : "one"); + if (listStyle === "zero") { + expected = 0; + } else if (listStyle === "one") { + expected = 1; + } + // Validate each list item marker + for (const listItemPrefix of listItemPrefixes) { + const orderedListItemValue = getOrderedListItemValue(listItemPrefix); + const actual = orderedListItemValue.value; + const fixInfo = { + "editColumn": orderedListItemValue.column, + "deleteCount": orderedListItemValue.value.toString().length, + "insertText": expected.toString() + }; + addErrorDetailIf( + onError, + listItemPrefix.startLine, + expected, + actual, + "Style: " + listStyleExamples[listStyle], + undefined, + [ listItemPrefix.startColumn, listItemPrefix.endColumn - listItemPrefix.startColumn ], + fixInfo + ); + if (listStyle === "ordered") { + expected++; + } + } + } + } +}; diff --git a/lib/md030.mjs b/lib/md030.mjs new file mode 100644 index 00000000..6e7ee9e6 --- /dev/null +++ b/lib/md030.mjs @@ -0,0 +1,57 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD030", "list-marker-space" ], + "description": "Spaces after list markers", + "tags": [ "ol", "ul", "whitespace" ], + "parser": "micromark", + "function": function MD030(params, onError) { + const ulSingle = Number(params.config.ul_single || 1); + const olSingle = Number(params.config.ol_single || 1); + const ulMulti = Number(params.config.ul_multi || 1); + const olMulti = Number(params.config.ol_multi || 1); + for (const list of filterByTypesCached([ "listOrdered", "listUnordered" ])) { + const ordered = (list.type === "listOrdered"); + const listItemPrefixes = + list.children.filter((token) => (token.type === "listItemPrefix")); + const allSingleLine = + (list.endLine - list.startLine + 1) === listItemPrefixes.length; + const expectedSpaces = ordered ? + (allSingleLine ? olSingle : olMulti) : + (allSingleLine ? ulSingle : ulMulti); + for (const listItemPrefix of listItemPrefixes) { + const range = [ + listItemPrefix.startColumn, + listItemPrefix.endColumn - listItemPrefix.startColumn + ]; + const listItemPrefixWhitespaces = listItemPrefix.children.filter( + (token) => (token.type === "listItemPrefixWhitespace") + ); + for (const listItemPrefixWhitespace of listItemPrefixWhitespaces) { + const { endColumn, startColumn, startLine } = + listItemPrefixWhitespace; + const actualSpaces = endColumn - startColumn; + const fixInfo = { + "editColumn": startColumn, + "deleteCount": actualSpaces, + "insertText": "".padEnd(expectedSpaces) + }; + addErrorDetailIf( + onError, + startLine, + expectedSpaces, + actualSpaces, + undefined, + undefined, + range, + fixInfo + ); + } + } + } + } +}; diff --git a/lib/md031.mjs b/lib/md031.mjs new file mode 100644 index 00000000..8d7ade69 --- /dev/null +++ b/lib/md031.mjs @@ -0,0 +1,61 @@ +// @ts-check + +import { addErrorContext, isBlankLine } from "../helpers/helpers.cjs"; +import { getParentOfType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const codeFencePrefixRe = /^(.*?)[`~]/; + +/** @typedef {readonly string[]} ReadonlyStringArray */ + +/** + * Adds an error for the top or bottom of a code fence. + * + * @param {import("markdownlint").RuleOnError} onError Error-reporting callback. + * @param {ReadonlyStringArray} lines Lines of Markdown content. + * @param {number} lineNumber Line number. + * @param {boolean} top True iff top fence. + * @returns {void} + */ +function addError(onError, lines, lineNumber, top) { + const line = lines[lineNumber - 1]; + const [ , prefix ] = line.match(codeFencePrefixRe) || []; + const fixInfo = (prefix === undefined) ? + undefined : + { + "lineNumber": lineNumber + (top ? 0 : 1), + "insertText": `${prefix.replace(/[^>]/g, " ").trim()}\n` + }; + addErrorContext( + onError, + lineNumber, + line.trim(), + undefined, + undefined, + undefined, + fixInfo + ); +} + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD031", "blanks-around-fences" ], + "description": "Fenced code blocks should be surrounded by blank lines", + "tags": [ "code", "blank_lines" ], + "parser": "micromark", + "function": function MD031(params, onError) { + const listItems = params.config.list_items; + const includeListItems = (listItems === undefined) ? true : !!listItems; + const { lines } = params; + for (const codeBlock of filterByTypesCached([ "codeFenced" ])) { + if (includeListItems || !(getParentOfType(codeBlock, [ "listOrdered", "listUnordered" ]))) { + if (!isBlankLine(lines[codeBlock.startLine - 2])) { + addError(onError, lines, codeBlock.startLine, true); + } + if (!isBlankLine(lines[codeBlock.endLine]) && !isBlankLine(lines[codeBlock.endLine - 1])) { + addError(onError, lines, codeBlock.endLine, false); + } + } + } + } +}; diff --git a/lib/md032.mjs b/lib/md032.mjs new file mode 100644 index 00000000..27ac30d3 --- /dev/null +++ b/lib/md032.mjs @@ -0,0 +1,78 @@ +// @ts-check + +import { addErrorContext, isBlankLine } from "../helpers/helpers.cjs"; +import { filterByPredicate, getBlockQuotePrefixText, nonContentTokens } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ + +const isList = (/** @type {MicromarkToken} */ token) => ( + (token.type === "listOrdered") || (token.type === "listUnordered") +); + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD032", "blanks-around-lists" ], + "description": "Lists should be surrounded by blank lines", + "tags": [ "bullet", "ul", "ol", "blank_lines" ], + "parser": "micromark", + "function": function MD032(params, onError) { + const { lines, parsers } = params; + const blockQuotePrefixes = filterByTypesCached([ "blockQuotePrefix", "linePrefix" ]); + + // For every top-level list... + const topLevelLists = filterByPredicate( + parsers.micromark.tokens, + isList, + (token) => ( + (isList(token) || (token.type === "htmlFlow")) ? [] : token.children + ) + ); + for (const list of topLevelLists) { + + // Look for a blank line above the list + const firstLineNumber = list.startLine; + if (!isBlankLine(lines[firstLineNumber - 2])) { + addErrorContext( + onError, + firstLineNumber, + lines[firstLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, firstLineNumber) + } + ); + } + + // Find the "visual" end of the list + const flattenedChildren = filterByPredicate( + list.children, + (token) => !nonContentTokens.has(token.type), + (token) => nonContentTokens.has(token.type) ? [] : token.children + ); + let endLine = list.endLine; + if (flattenedChildren.length > 0) { + endLine = flattenedChildren[flattenedChildren.length - 1].endLine; + } + + // Look for a blank line below the list + const lastLineNumber = endLine; + if (!isBlankLine(lines[lastLineNumber])) { + addErrorContext( + onError, + lastLineNumber, + lines[lastLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "lineNumber": lastLineNumber + 1, + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, lastLineNumber) + } + ); + } + } + } +}; diff --git a/lib/md033.mjs b/lib/md033.mjs new file mode 100644 index 00000000..17965f93 --- /dev/null +++ b/lib/md033.mjs @@ -0,0 +1,46 @@ +// @ts-check + +import { addError, nextLinesRe } from "../helpers/helpers.cjs"; +import { getHtmlTagInfo, getParentOfType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("micromark-extension-gfm-table")} */ + +// eslint-disable-next-line jsdoc/reject-any-type +const toLowerCaseStringArray = (/** @type {any} */ arr) => Array.isArray(arr) ? arr.map((elm) => String(elm).toLowerCase()) : []; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD033", "no-inline-html" ], + "description": "Inline HTML", + "tags": [ "html" ], + "parser": "micromark", + "function": function MD033(params, onError) { + const allowedElements = toLowerCaseStringArray(params.config.allowed_elements); + // If not defined, use allowedElements for backward compatibility + const tableAllowedElements = toLowerCaseStringArray(params.config.table_allowed_elements || params.config.allowed_elements); + for (const token of filterByTypesCached([ "htmlText" ], true)) { + const htmlTagInfo = getHtmlTagInfo(token); + if (htmlTagInfo && !htmlTagInfo.close) { + const elementName = htmlTagInfo?.name.toLowerCase(); + const inTable = !!getParentOfType(token, [ "table" ]); + if ( + (inTable || !allowedElements.includes(elementName)) && + (!inTable || !tableAllowedElements.includes(elementName)) + ) { + const range = [ + token.startColumn, + token.text.replace(nextLinesRe, "").length + ]; + addError( + onError, + token.startLine, + "Element: " + htmlTagInfo.name, + undefined, + range + ); + } + } + } + } +}; diff --git a/lib/md034.mjs b/lib/md034.mjs new file mode 100644 index 00000000..c624dc67 --- /dev/null +++ b/lib/md034.mjs @@ -0,0 +1,92 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { filterByPredicate, getHtmlTagInfo, inHtmlFlow } from "../helpers/micromark-helpers.cjs"; + +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ +/** @typedef {import("micromark-extension-gfm-autolink-literal")} */ + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD034", "no-bare-urls" ], + "description": "Bare URL used", + "tags": [ "links", "url" ], + "parser": "micromark", + "function": function MD034(params, onError) { + const literalAutolinks = (/** @type {MicromarkToken[]} */ tokens) => ( + filterByPredicate( + tokens, + (token) => { + if ((token.type === "literalAutolink") && !inHtmlFlow(token)) { + // Detect and ignore https://github.com/micromark/micromark/issues/164 + const siblings = token.parent?.children; + const index = siblings?.indexOf(token); + // @ts-ignore + const prev = siblings?.at(index - 1); + // @ts-ignore + const next = siblings?.at(index + 1); + return !( + prev && + next && + (prev.type === "data") && + (next.type === "data") && + prev.text.endsWith("<") && + next.text.startsWith(">") + ); + } + return false; + }, + (token) => { + // Ignore content of inline HTML tags + const { children } = token; + const result = []; + for (let i = 0; i < children.length; i++) { + const current = children[i]; + const openTagInfo = getHtmlTagInfo(current); + if (openTagInfo && !openTagInfo.close) { + let count = 1; + for (let j = i + 1; j < children.length; j++) { + const candidate = children[j]; + const closeTagInfo = getHtmlTagInfo(candidate); + if (closeTagInfo && (openTagInfo.name === closeTagInfo.name)) { + if (closeTagInfo.close) { + count--; + if (count === 0) { + i = j; + break; + } + } else { + count++; + } + } + } + } else { + result.push(current); + } + } + return result; + } + ) + ); + for (const token of literalAutolinks(params.parsers.micromark.tokens)) { + const range = [ + token.startColumn, + token.endColumn - token.startColumn + ]; + const fixInfo = { + "editColumn": range[0], + "deleteCount": range[1], + "insertText": `<${token.text}>` + }; + addErrorContext( + onError, + token.startLine, + token.text, + undefined, + undefined, + range, + fixInfo + ); + } + } +}; diff --git a/lib/md035.mjs b/lib/md035.mjs new file mode 100644 index 00000000..13f79124 --- /dev/null +++ b/lib/md035.mjs @@ -0,0 +1,23 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD035", "hr-style" ], + "description": "Horizontal rule style", + "tags": [ "hr" ], + "parser": "micromark", + "function": function MD035(params, onError) { + let style = String(params.config.style || "consistent").trim(); + const thematicBreaks = filterByTypesCached([ "thematicBreak" ]); + for (const token of thematicBreaks) { + const { startLine, text } = token; + if (style === "consistent") { + style = text; + } + addErrorDetailIf(onError, startLine, style, text); + } + } +}; diff --git a/lib/md036.mjs b/lib/md036.mjs new file mode 100644 index 00000000..2213cb8e --- /dev/null +++ b/lib/md036.mjs @@ -0,0 +1,54 @@ +// @ts-check + +import { addErrorContext, allPunctuation } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ +/** @typedef {import("markdownlint").MicromarkTokenType} MicromarkTokenType */ + +/** @type {MicromarkTokenType[][]} */ +const emphasisTypes = [ + [ "emphasis", "emphasisText" ], + [ "strong", "strongText" ] +]; + +const isParagraphChildMeaningful = (/** @type {MicromarkToken} */ token) => !( + (token.type === "htmlText") || + ((token.type === "data") && (token.text.trim().length === 0)) +); + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD036", "no-emphasis-as-heading" ], + "description": "Emphasis used instead of a heading", + "tags": [ "headings", "emphasis" ], + "parser": "micromark", + "function": function MD036(params, onError) { + let punctuation = params.config.punctuation; + punctuation = String((punctuation === undefined) ? allPunctuation : punctuation); + const punctuationRe = new RegExp("[" + punctuation + "]$"); + const paragraphTokens = + filterByTypesCached([ "paragraph" ], true) + .filter((token) => + (token.parent?.type === "content") && + ( + !token.parent?.parent || + ((token.parent?.parent?.type === "htmlFlow") && !token.parent?.parent?.parent) + ) && + (token.children.filter(isParagraphChildMeaningful).length === 1) + ); + for (const emphasisType of emphasisTypes) { + const textTokens = getDescendantsByType(paragraphTokens, emphasisType); + for (const textToken of textTokens) { + if ( + (textToken.children.length === 1) && + (textToken.children[0].type === "data") && + !punctuationRe.test(textToken.text) + ) { + addErrorContext(onError, textToken.startLine, textToken.text); + } + } + } + } +}; diff --git a/lib/md037.mjs b/lib/md037.mjs new file mode 100644 index 00000000..8dd72d8b --- /dev/null +++ b/lib/md037.mjs @@ -0,0 +1,94 @@ +// @ts-check + +import { addError } from "../helpers/helpers.cjs"; +import { filterByPredicate, inHtmlFlow } from "../helpers/micromark-helpers.cjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD037", "no-space-in-emphasis" ], + "description": "Spaces inside emphasis markers", + "tags": [ "whitespace", "emphasis" ], + "parser": "micromark", + "function": function MD037(params, onError) { + + // Initialize variables + const { lines, parsers } = params; + const emphasisTokensByMarker = new Map(); + for (const marker of [ "_", "__", "___", "*", "**", "***" ]) { + emphasisTokensByMarker.set(marker, []); + } + const tokens = filterByPredicate( + parsers.micromark.tokens, + (token) => token.children.some((child) => child.type === "data") + ); + for (const token of tokens) { + + // Build lists of bare tokens for each emphasis marker type + for (const emphasisTokens of emphasisTokensByMarker.values()) { + emphasisTokens.length = 0; + } + for (const child of token.children) { + const { text, type } = child; + if ((type === "data") && (text.length <= 3)) { + const emphasisTokens = emphasisTokensByMarker.get(text); + if (emphasisTokens && !inHtmlFlow(child)) { + emphasisTokens.push(child); + } + } + } + + // Process bare tokens for each emphasis marker type + for (const entry of emphasisTokensByMarker.entries()) { + const [ marker, emphasisTokens ] = entry; + for (let i = 0; i + 1 < emphasisTokens.length; i += 2) { + + // Process start token of start/end pair + const startToken = emphasisTokens[i]; + const startLine = lines[startToken.startLine - 1]; + const startSlice = startLine.slice(startToken.endColumn - 1); + const startMatch = startSlice.match(/^\s+\S/); + if (startMatch) { + const [ startSpaceCharacter ] = startMatch; + const startContext = `${marker}${startSpaceCharacter}`; + const column = startToken.endColumn; + const count = startSpaceCharacter.length - 1; + addError( + onError, + startToken.startLine, + undefined, + startContext, + [ column, count ], + { + "editColumn": column, + "deleteCount": count + } + ); + } + + // Process end token of start/end pair + const endToken = emphasisTokens[i + 1]; + const endLine = lines[endToken.startLine - 1]; + const endSlice = endLine.slice(0, endToken.startColumn - 1); + const endMatch = endSlice.match(/\S\s+$/); + if (endMatch) { + const [ endSpaceCharacter ] = endMatch; + const endContext = `${endSpaceCharacter}${marker}`; + const column = endToken.startColumn - (endSpaceCharacter.length - 1); + const count = endSpaceCharacter.length - 1; + addError( + onError, + endToken.startLine, + undefined, + endContext, + [ column, count ], + { + "editColumn": column, + "deleteCount": count + } + ); + } + } + } + } + } +}; diff --git a/lib/md038.mjs b/lib/md038.mjs new file mode 100644 index 00000000..0955c3ce --- /dev/null +++ b/lib/md038.mjs @@ -0,0 +1,73 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD038", "no-space-in-code" ], + "description": "Spaces inside code span elements", + "tags": [ "whitespace", "code" ], + "parser": "micromark", + "function": function MD038(params, onError) { + const codeTexts = filterByTypesCached([ "codeText" ]); + for (const codeText of codeTexts) { + const datas = getDescendantsByType(codeText, [ "codeTextData" ]); + if (datas.length > 0) { + const paddings = getDescendantsByType(codeText, [ "codeTextPadding" ]); + // Check for extra space at start of code + const startPadding = paddings[0]; + const startData = datas[0]; + const startMatch = /^(\s+)(\S)/.exec(startData.text) || [ null, "", "" ]; + const startBacktick = (startMatch[2] === "`"); + const startCount = startMatch[1].length - ((startBacktick && !startPadding) ? 1 : 0); + const startSpaces = startCount > 0; + // Check for extra space at end of code + const endPadding = paddings[paddings.length - 1]; + const endData = datas[datas.length - 1]; + const endMatch = /(\S)(\s+)$/.exec(endData.text) || [ null, "", "" ]; + const endBacktick = (endMatch[1] === "`"); + const endCount = endMatch[2].length - ((endBacktick && !endPadding) ? 1 : 0); + const endSpaces = endCount > 0; + // Check if safe to remove 1-space padding + const removePadding = startSpaces && endSpaces && startPadding && endPadding && !startBacktick && !endBacktick; + const context = codeText.text; + // If extra space at start, report violation + if (startSpaces) { + const startColumn = (removePadding ? startPadding : startData).startColumn; + const length = startCount + (removePadding ? startPadding.text.length : 0); + addErrorContext( + onError, + startData.startLine, + context, + true, + false, + [ startColumn, length ], + { + "editColumn": startColumn, + "deleteCount": length + } + ); + } + // If extra space at end, report violation + if (endSpaces) { + const endColumn = (removePadding ? endPadding : endData).endColumn; + const length = endCount + (removePadding ? endPadding.text.length : 0); + addErrorContext( + onError, + endData.endLine, + context, + false, + true, + [ endColumn - length, length ], + { + "editColumn": endColumn - length, + "deleteCount": length + } + ); + } + } + } + } +}; diff --git a/lib/md039.mjs b/lib/md039.mjs new file mode 100644 index 00000000..074fefbc --- /dev/null +++ b/lib/md039.mjs @@ -0,0 +1,59 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** + * Adds an error for a label space issue. + * + * @param {import("markdownlint").RuleOnError} onError Error-reporting callback. + * @param {import("markdownlint").MicromarkToken} label Label token. + * @param {import("markdownlint").MicromarkToken} labelText LabelText token. + * @param {boolean} isStart True iff error is at the start of the link. + */ +function addLabelSpaceError(onError, label, labelText, isStart) { + const match = labelText.text.match(isStart ? /^[^\S\r\n]+/ : /[^\S\r\n]+$/); + const range = match ? + [ + (isStart ? (labelText.startColumn) : (labelText.endColumn - match[0].length)), + match[0].length + ] : + undefined; + addErrorContext( + onError, + isStart ? (labelText.startLine + (match ? 0 : 1)) : (labelText.endLine - (match ? 0 : 1)), + label.text.replace(/\s+/g, " "), + isStart, + !isStart, + range, + range ? + { + "editColumn": range[0], + "deleteCount": range[1] + } : + undefined + ); +} + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD039", "no-space-in-links" ], + "description": "Spaces inside link text", + "tags": [ "whitespace", "links" ], + "parser": "micromark", + "function": function MD039(params, onError) { + const labels = filterByTypesCached([ "label" ]) + .filter((label) => label.parent?.type === "link"); + for (const label of labels) { + const labelTexts = label.children.filter((child) => child.type === "labelText"); + for (const labelText of labelTexts) { + if (labelText.text.trimStart().length !== labelText.text.length) { + addLabelSpaceError(onError, label, labelText, true); + } + if (labelText.text.trimEnd().length !== labelText.text.length) { + addLabelSpaceError(onError, label, labelText, false); + } + } + } + } +}; diff --git a/lib/md040.mjs b/lib/md040.mjs new file mode 100644 index 00000000..26e3d625 --- /dev/null +++ b/lib/md040.mjs @@ -0,0 +1,32 @@ +// @ts-check + +import { addError, addErrorContext } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD040", "fenced-code-language" ], + "description": "Fenced code blocks should have a language specified", + "tags": [ "code", "language" ], + "parser": "micromark", + "function": function MD040(params, onError) { + let allowed = params.config.allowed_languages; + allowed = Array.isArray(allowed) ? allowed : []; + const languageOnly = !!params.config.language_only; + const fencedCodes = filterByTypesCached([ "codeFenced" ]); + for (const fencedCode of fencedCodes) { + const openingFence = getDescendantsByType(fencedCode, [ "codeFencedFence" ])[0]; + const { startLine, text } = openingFence; + const info = getDescendantsByType(openingFence, [ "codeFencedFenceInfo" ])[0]?.text; + if (!info) { + addErrorContext(onError, startLine, text); + } else if ((allowed.length > 0) && !allowed.includes(info)) { + addError(onError, startLine, `"${info}" is not allowed`); + } + if (languageOnly && getDescendantsByType(openingFence, [ "codeFencedFenceMeta" ]).length > 0) { + addError(onError, startLine, `Info string contains more than language: "${text}"`); + } + } + } +}; diff --git a/lib/md041.mjs b/lib/md041.mjs new file mode 100644 index 00000000..fc187226 --- /dev/null +++ b/lib/md041.mjs @@ -0,0 +1,71 @@ +// @ts-check + +import { addErrorContext, frontMatterHasTitle } from "../helpers/helpers.cjs"; +import { filterByTypes, getHeadingLevel, getHtmlTagInfo, isHtmlFlowComment, nonContentTokens } from "../helpers/micromark-helpers.cjs"; + +const headingTagNameRe = /^h[1-6]$/; + +/** + * Gets the HTML tag name of an htmlFlow token. + * + * @param {import("markdownlint").MicromarkToken} token Micromark Token. + * @returns {string | null} Tag name. + */ +function getHtmlFlowTagName(token) { + const { children, type } = token; + if (type === "htmlFlow") { + const htmlTexts = filterByTypes(children, [ "htmlText" ], true); + const tagInfo = (htmlTexts.length > 0) && getHtmlTagInfo(htmlTexts[0]); + if (tagInfo) { + return tagInfo.name.toLowerCase(); + } + } + return null; +} + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD041", "first-line-heading", "first-line-h1" ], + "description": "First line in a file should be a top-level heading", + "tags": [ "headings" ], + "parser": "micromark", + "function": function MD041(params, onError) { + const allowPreamble = !!params.config.allow_preamble; + const level = Number(params.config.level || 1); + const { tokens } = params.parsers.micromark; + if ( + !frontMatterHasTitle( + params.frontMatterLines, + params.config.front_matter_title + ) + ) { + let errorLineNumber = 0; + for (const token of tokens) { + const { startLine, type } = token; + if (!nonContentTokens.has(type) && !isHtmlFlowComment(token)) { + let tagName = null; + if ((type === "atxHeading") || (type === "setextHeading")) { + // First heading needs to have the expected level + if (getHeadingLevel(token) !== level) { + errorLineNumber = startLine; + } + break; + } else if ((tagName = getHtmlFlowTagName(token)) && headingTagNameRe.test(tagName)) { + // First HTML element needs to have an with the expected level + if (tagName !== `h${level}`) { + errorLineNumber = startLine; + } + break; + } else if (!allowPreamble) { + // First non-content needs to be a heading with the expected level + errorLineNumber = startLine; + break; + } + } + } + if (errorLineNumber > 0) { + addErrorContext(onError, errorLineNumber, params.lines[errorLineNumber - 1]); + } + } + } +}; diff --git a/lib/md042.mjs b/lib/md042.mjs new file mode 100644 index 00000000..443a6720 --- /dev/null +++ b/lib/md042.mjs @@ -0,0 +1,58 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { getReferenceLinkImageData, filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD042", "no-empty-links" ], + "description": "No empty links", + "tags": [ "links" ], + "parser": "micromark", + "function": function MD042(params, onError) { + const { definitions } = getReferenceLinkImageData(); + const isReferenceDefinitionHash = (/** @type {MicromarkToken} */ token) => { + const definition = definitions.get(token.text.trim()); + return Boolean(definition && (definition[1] === "#")); + }; + const links = filterByTypesCached([ "link" ]); + for (const link of links) { + const labelText = getDescendantsByType(link, [ "label", "labelText" ]); + const reference = getDescendantsByType(link, [ "reference" ]); + const resource = getDescendantsByType(link, [ "resource" ]); + const referenceString = getDescendantsByType(reference, [ "referenceString" ]); + const resourceDestinationString = getDescendantsByType(resource, [ "resourceDestination", [ "resourceDestinationLiteral", "resourceDestinationRaw" ], "resourceDestinationString" ]); + const hasLabelText = labelText.length > 0; + const hasReference = reference.length > 0; + const hasResource = resource.length > 0; + const hasReferenceString = referenceString.length > 0; + const hasResourceDestinationString = resourceDestinationString.length > 0; + let error = false; + if ( + hasLabelText && + ((!hasReference && !hasResource) || (hasReference && !hasReferenceString)) + ) { + error = isReferenceDefinitionHash(labelText[0]); + } else if (hasReferenceString && !hasResourceDestinationString) { + error = isReferenceDefinitionHash(referenceString[0]); + } else if (!hasReferenceString && hasResourceDestinationString) { + error = (resourceDestinationString[0].text.trim() === "#"); + } else if (!hasReferenceString && !hasResourceDestinationString) { + error = true; + } + if (error) { + addErrorContext( + onError, + link.startLine, + link.text, + undefined, + undefined, + [ link.startColumn, link.endColumn - link.startColumn ] + ); + } + } + } +}; diff --git a/lib/md043.mjs b/lib/md043.mjs new file mode 100644 index 00000000..5a234485 --- /dev/null +++ b/lib/md043.mjs @@ -0,0 +1,72 @@ +// @ts-check + +import { addErrorContext, addErrorDetailIf } from "../helpers/helpers.cjs"; +import { getHeadingLevel, getHeadingText } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD043", "required-headings" ], + "description": "Required heading structure", + "tags": [ "headings" ], + "parser": "micromark", + "function": function MD043(params, onError) { + const requiredHeadings = params.config.headings; + if (!Array.isArray(requiredHeadings)) { + // Nothing to check; avoid doing any work + return; + } + const matchCase = params.config.match_case || false; + let i = 0; + let matchAny = false; + let hasError = false; + let anyHeadings = false; + const getExpected = () => String(requiredHeadings[i++] || "[None]"); + const handleCase = (/** @type {string} */ str) => (matchCase ? str : str.toLowerCase()); + for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) { + if (!hasError) { + const headingText = getHeadingText(heading); + const headingLevel = getHeadingLevel(heading); + anyHeadings = true; + const actual = `${"".padEnd(headingLevel, "#")} ${headingText}`; + const expected = getExpected(); + if (expected === "*") { + const nextExpected = getExpected(); + if (handleCase(nextExpected) !== handleCase(actual)) { + matchAny = true; + i--; + } + } else if (expected === "+") { + matchAny = true; + } else if (expected === "?") { + // Allow current, match next + } else if (handleCase(expected) === handleCase(actual)) { + matchAny = false; + } else if (matchAny) { + i--; + } else { + addErrorDetailIf( + onError, + heading.startLine, + expected, + actual + ); + hasError = true; + } + } + } + const extraHeadings = requiredHeadings.length - i; + if ( + !hasError && + ((extraHeadings > 1) || + ((extraHeadings === 1) && (requiredHeadings[i] !== "*"))) && + (anyHeadings || !requiredHeadings.every((heading) => heading === "*")) + ) { + addErrorContext( + onError, + params.lines.length, + requiredHeadings[i] + ); + } + } +}; diff --git a/lib/md044.mjs b/lib/md044.mjs new file mode 100644 index 00000000..0e7d6339 --- /dev/null +++ b/lib/md044.mjs @@ -0,0 +1,110 @@ +// @ts-check + +import { addErrorDetailIf, escapeForRegExp, hasOverlap } from "../helpers/helpers.cjs"; +import { filterByPredicate, filterByTypes } from "../helpers/micromark-helpers.cjs"; +import { parse } from "./micromark-parse.mjs"; + +const ignoredChildTypes = new Set( + [ "codeFencedFence", "definition", "reference", "resource" ] +); + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD044", "proper-names" ], + "description": "Proper names should have the correct capitalization", + "tags": [ "spelling" ], + "parser": "micromark", + "function": function MD044(params, onError) { + let names = params.config.names; + names = Array.isArray(names) ? names : []; + names.sort((/** @type {string} */ a, /** @type {string} */ b) => (b.length - a.length) || a.localeCompare(b)); + if (names.length === 0) { + // Nothing to check; avoid doing any work + return; + } + const codeBlocks = params.config.code_blocks; + const includeCodeBlocks = + (codeBlocks === undefined) ? true : !!codeBlocks; + const htmlElements = params.config.html_elements; + const includeHtmlElements = + (htmlElements === undefined) ? true : !!htmlElements; + const scannedTypes = new Set([ "data" ]); + if (includeCodeBlocks) { + scannedTypes.add("codeFlowValue"); + scannedTypes.add("codeTextData"); + } + if (includeHtmlElements) { + scannedTypes.add("htmlFlowData"); + scannedTypes.add("htmlTextData"); + } + const contentTokens = + filterByPredicate( + params.parsers.micromark.tokens, + (token) => scannedTypes.has(token.type), + (token) => ( + token.children.filter((t) => !ignoredChildTypes.has(t.type)) + ) + ); + /** @type {import("../helpers/helpers.cjs").FileRange[]} */ + const exclusions = []; + const scannedTokens = new Set(); + for (const name of names) { + const escapedName = escapeForRegExp(name); + const startNamePattern = /^\W/.test(name) ? "" : "\\b_*"; + const endNamePattern = /\W$/.test(name) ? "" : "_*\\b"; + const namePattern = `(${startNamePattern})(${escapedName})${endNamePattern}`; + const nameRe = new RegExp(namePattern, "gi"); + for (const token of contentTokens) { + let match = null; + while ((match = nameRe.exec(token.text)) !== null) { + const [ , leftMatch, nameMatch ] = match; + const column = token.startColumn + match.index + leftMatch.length; + const length = nameMatch.length; + const lineNumber = token.startLine; + /** @type {import("../helpers/helpers.cjs").FileRange} */ + const nameRange = { + "startLine": lineNumber, + "startColumn": column, + "endLine": lineNumber, + "endColumn": column + length - 1 + }; + if ( + !names.includes(nameMatch) && + !exclusions.some((exclusion) => hasOverlap(exclusion, nameRange)) + ) { + /** @type {import("../helpers/helpers.cjs").FileRange[]} */ + let autolinkRanges = []; + if (!scannedTokens.has(token)) { + autolinkRanges = filterByTypes(parse(token.text), [ "literalAutolink" ]) + .map((tok) => ({ + "startLine": lineNumber, + "startColumn": token.startColumn + tok.startColumn - 1, + "endLine": lineNumber, + "endColumn": token.endColumn + tok.endColumn - 1 + })); + exclusions.push(...autolinkRanges); + scannedTokens.add(token); + } + if (!autolinkRanges.some((autolinkRange) => hasOverlap(autolinkRange, nameRange))) { + addErrorDetailIf( + onError, + token.startLine, + name, + nameMatch, + undefined, + undefined, + [ column, length ], + { + "editColumn": column, + "deleteCount": length, + "insertText": name + } + ); + } + } + exclusions.push(nameRange); + } + } + } + } +}; diff --git a/lib/md045.mjs b/lib/md045.mjs new file mode 100644 index 00000000..740ddd51 --- /dev/null +++ b/lib/md045.mjs @@ -0,0 +1,61 @@ +// @ts-check + +import { addError, getHtmlAttributeRe, nextLinesRe } from "../helpers/helpers.cjs"; +import { getHtmlTagInfo, getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const altRe = getHtmlAttributeRe("alt"); +const ariaHiddenRe = getHtmlAttributeRe("aria-hidden"); + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD045", "no-alt-text" ], + "description": "Images should have alternate text (alt text)", + "tags": [ "accessibility", "images" ], + "parser": "micromark", + "function": function MD045(params, onError) { + // Process Markdown images + const images = filterByTypesCached([ "image" ]); + for (const image of images) { + const labelTexts = getDescendantsByType(image, [ "label", "labelText" ]); + if (labelTexts.some((labelText) => labelText.text.length === 0)) { + const range = (image.startLine === image.endLine) ? + [ image.startColumn, image.endColumn - image.startColumn ] : + undefined; + addError( + onError, + image.startLine, + undefined, + undefined, + range + ); + } + } + + // Process HTML images + const htmlTexts = filterByTypesCached([ "htmlText" ], true); + for (const htmlText of htmlTexts) { + const { startColumn, startLine, text } = htmlText; + const htmlTagInfo = getHtmlTagInfo(htmlText); + if ( + htmlTagInfo && + !htmlTagInfo.close && + (htmlTagInfo.name.toLowerCase() === "img") && + !altRe.test(text) && + (ariaHiddenRe.exec(text)?.[1].toLowerCase() !== "true") + ) { + const range = [ + startColumn, + text.replace(nextLinesRe, "").length + ]; + addError( + onError, + startLine, + undefined, + undefined, + range + ); + } + } + } +}; diff --git a/lib/md046.mjs b/lib/md046.mjs new file mode 100644 index 00000000..23cba2c1 --- /dev/null +++ b/lib/md046.mjs @@ -0,0 +1,31 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("markdownlint").MicromarkTokenType} MicromarkTokenType */ + +const tokenTypeToStyle = (/** @type {MicromarkTokenType} */ tokenType) => (tokenType === "codeFenced") ? "fenced" : "indented"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD046", "code-block-style" ], + "description": "Code block style", + "tags": [ "code" ], + "parser": "micromark", + "function": function MD046(params, onError) { + let expectedStyle = String(params.config.style || "consistent"); + for (const token of filterByTypesCached([ "codeFenced", "codeIndented" ])) { + const { startLine, type } = token; + if (expectedStyle === "consistent") { + expectedStyle = tokenTypeToStyle(type); + } + addErrorDetailIf( + onError, + startLine, + expectedStyle, + tokenTypeToStyle(type) + ); + } + } +}; diff --git a/lib/md047.mjs b/lib/md047.mjs new file mode 100644 index 00000000..a78b1672 --- /dev/null +++ b/lib/md047.mjs @@ -0,0 +1,28 @@ +// @ts-check + +import { addError, isBlankLine } from "../helpers/helpers.cjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD047", "single-trailing-newline" ], + "description": "Files should end with a single newline character", + "tags": [ "blank_lines" ], + "parser": "none", + "function": function MD047(params, onError) { + const lastLineNumber = params.lines.length; + const lastLine = params.lines[lastLineNumber - 1]; + if (!isBlankLine(lastLine)) { + addError( + onError, + lastLineNumber, + undefined, + undefined, + [ lastLine.length, 1 ], + { + "insertText": "\n", + "editColumn": lastLine.length + 1 + } + ); + } + } +}; diff --git a/lib/md048.mjs b/lib/md048.mjs new file mode 100644 index 00000000..6265a3c2 --- /dev/null +++ b/lib/md048.mjs @@ -0,0 +1,47 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** + * Return the string representation of a fence markup character. + * + * @param {string} markup Fence string. + * @returns {"tilde" | "backtick"} String representation. + */ +function fencedCodeBlockStyleFor(markup) { + switch (markup[0]) { + case "~": + return "tilde"; + default: + return "backtick"; + } +}; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD048", "code-fence-style" ], + "description": "Code fence style", + "tags": [ "code" ], + "parser": "micromark", + "function": function MD048(params, onError) { + const style = String(params.config.style || "consistent"); + let expectedStyle = style; + const codeFenceds = filterByTypesCached([ "codeFenced" ]); + for (const codeFenced of codeFenceds) { + const codeFencedFenceSequence = + getDescendantsByType(codeFenced, [ "codeFencedFence", "codeFencedFenceSequence" ])[0]; + const { startLine, text } = codeFencedFenceSequence; + if (expectedStyle === "consistent") { + expectedStyle = fencedCodeBlockStyleFor(text); + } + addErrorDetailIf( + onError, + startLine, + expectedStyle, + fencedCodeBlockStyleFor(text) + ); + } + } +}; diff --git a/lib/md049-md050.mjs b/lib/md049-md050.mjs new file mode 100644 index 00000000..45fb7882 --- /dev/null +++ b/lib/md049-md050.mjs @@ -0,0 +1,115 @@ +// @ts-check + +import { addError } from "../helpers/helpers.cjs"; +import { filterByPredicate, getDescendantsByType } from "../helpers/micromark-helpers.cjs"; + +const intrawordRe = /^\w$/; + +/** + * Return the string representation of a emphasis or strong markup character. + * + * @param {string} markup Emphasis or strong string. + * @returns {"asterisk" | "underscore"} String representation. + */ +function emphasisOrStrongStyleFor(markup) { + switch (markup[0]) { + case "*": + return "asterisk"; + default: + return "underscore"; + } +}; + +/** + * @param {import("markdownlint").RuleParams} params Rule parameters. + * @param {import("markdownlint").RuleOnError} onError Error-reporting callback. + * @param {import("micromark-util-types").TokenType} type Token type. + * @param {import("micromark-util-types").TokenType} typeSequence Token sequence type. + * @param {"*" | "**"} asterisk Asterisk kind. + * @param {"_" | "__"} underline Underline kind. + * @param {"asterisk" | "consistent" | "underscore"} style Style string. + */ +const impl = + (params, onError, type, typeSequence, asterisk, underline, style = "consistent") => { + const { lines, parsers } = params; + const emphasisTokens = filterByPredicate( + parsers.micromark.tokens, + (token) => token.type === type, + (token) => ((token.type === "htmlFlow") ? [] : token.children) + ); + for (const token of emphasisTokens) { + const sequences = getDescendantsByType(token, [ typeSequence ]); + const startSequence = sequences[0]; + const endSequence = sequences[sequences.length - 1]; + if (startSequence && endSequence) { + const markupStyle = emphasisOrStrongStyleFor(startSequence.text); + if (style === "consistent") { + style = markupStyle; + } + if (style !== markupStyle) { + const underscoreIntraword = (style === "underscore") && ( + intrawordRe.test( + lines[startSequence.startLine - 1][startSequence.startColumn - 2] + ) || + intrawordRe.test( + lines[endSequence.endLine - 1][endSequence.endColumn - 1] + ) + ); + if (!underscoreIntraword) { + for (const sequence of [ startSequence, endSequence ]) { + addError( + onError, + sequence.startLine, + `Expected: ${style}; Actual: ${markupStyle}`, + undefined, + [ sequence.startColumn, sequence.text.length ], + { + "editColumn": sequence.startColumn, + "deleteCount": sequence.text.length, + "insertText": (style === "asterisk") ? asterisk : underline + } + ); + } + } + } + } + } + }; + +/** @type {import("markdownlint").Rule[]} */ +export default [ + { + "names": [ "MD049", "emphasis-style" ], + "description": "Emphasis style", + "tags": [ "emphasis" ], + "parser": "micromark", + "function": function MD049(params, onError) { + return impl( + params, + onError, + "emphasis", + "emphasisSequence", + "*", + "_", + params.config.style || undefined + ); + } + }, + { + "names": [ "MD050", "strong-style" ], + "description": "Strong style", + "tags": [ "emphasis" ], + "parser": "micromark", + "function": function MD050(params, onError) { + return impl( + params, + onError, + "strong", + "strongSequence", + "**", + "__", + params.config.style || undefined + ); + } + } +]; diff --git a/lib/md051.mjs b/lib/md051.mjs new file mode 100644 index 00000000..bcae33b8 --- /dev/null +++ b/lib/md051.mjs @@ -0,0 +1,172 @@ +// @ts-check + +import { addError, getHtmlAttributeRe } from "../helpers/helpers.cjs"; +import { filterByPredicate, filterByTypes, getHtmlTagInfo, isDocfxTab } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +// Regular expression for identifying HTML anchor names +const idRe = getHtmlAttributeRe("id"); +const nameRe = getHtmlAttributeRe("name"); +const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu; +const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/; + +// Sets for filtering heading tokens during conversion +const childrenExclude = new Set([ "image", "reference", "resource" ]); +const tokensInclude = new Set( + [ "characterEscapeValue", "codeTextData", "data", "mathTextData" ] +); + +/** + * Converts a Markdown heading into an HTML fragment according to the rules + * used by GitHub. + * + * @param {import("markdownlint").MicromarkToken} headingText Heading text token. + * @returns {string} Fragment string for heading. + */ +function convertHeadingToHTMLFragment(headingText) { + const inlineText = + filterByPredicate( + headingText.children, + (token) => tokensInclude.has(token.type), + (token) => (childrenExclude.has(token.type) ? [] : token.children) + ) + .map((token) => token.text) + .join(""); + return "#" + encodeURIComponent( + inlineText + .toLowerCase() + // RegExp source with Ruby's \p{Word} expanded into its General Categories + // https://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/toc_filter.rb + // https://ruby-doc.org/core-3.0.2/Regexp.html + .replace( + /[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu, + "" + ) + .replace(/ /gu, "-") + ); +} + +/** + * Unescapes the text of a String-type micromark Token. + * + * @param {import("markdownlint").MicromarkToken} token String-type micromark Token. + * @returns {string} Unescaped token text. + */ +function unescapeStringTokenText(token) { + return filterByTypes(token.children, [ "characterEscapeValue", "data" ]) + .map((child) => child.text) + .join(""); +} + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD051", "link-fragments" ], + "description": "Link fragments should be valid", + "tags": [ "links" ], + "parser": "micromark", + "function": function MD051(params, onError) { + const ignoreCase = params.config.ignore_case || false; + const ignoredPattern = params.config.ignored_pattern || ""; + const ignoredPatternRe = new RegExp(ignoredPattern || "^$"); + /** @type {Map} */ + const fragments = new Map([ [ "#top", 0 ] ]); + + // Process headings + const headingTexts = filterByTypesCached([ "atxHeadingText", "setextHeadingText" ]); + for (const headingText of headingTexts) { + const fragment = convertHeadingToHTMLFragment(headingText); + if (fragment !== "#") { + const count = fragments.get(fragment) || 0; + if (count) { + fragments.set(`${fragment}-${count}`, 0); + } + fragments.set(fragment, count + 1); + let match = null; + while ((match = anchorRe.exec(headingText.text)) !== null) { + const [ , anchor ] = match; + if (!fragments.has(anchor)) { + fragments.set(anchor, 1); + } + } + } + } + + // Process HTML anchors + for (const token of filterByTypesCached([ "htmlText" ], true)) { + const htmlTagInfo = getHtmlTagInfo(token); + if (htmlTagInfo && !htmlTagInfo.close) { + const anchorMatch = idRe.exec(token.text) || + (htmlTagInfo.name.toLowerCase() === "a" && nameRe.exec(token.text)); + if (anchorMatch && anchorMatch.length > 0) { + fragments.set(`#${anchorMatch[1]}`, 0); + } + } + } + + // Process link and definition fragments + /** @type {import("markdownlint").MicromarkTokenType[][]} */ + const parentChilds = [ + [ "link", "resourceDestinationString" ], + [ "definition", "definitionDestinationString" ] + ]; + for (const [ parentType, definitionType ] of parentChilds) { + const links = filterByTypesCached([ parentType ]) + .filter( + (link) => !((link.parent?.type === "atxHeadingText") && isDocfxTab(link.parent.parent)) + ); + for (const link of links) { + const definitions = filterByTypes(link.children, [ definitionType ]); + for (const definition of definitions) { + const { endColumn, startColumn } = definition; + const text = unescapeStringTokenText(definition); + const textSliceOne = text.slice(1); + const encodedText = `#${encodeURIComponent(textSliceOne)}`; + if ( + (text.length > 1) && + text.startsWith("#") && + !fragments.has(encodedText) && + !lineFragmentRe.test(encodedText) && + !ignoredPatternRe.test(textSliceOne) + ) { + let context = undefined; + let range = undefined; + let fixInfo = undefined; + if (link.startLine === link.endLine) { + context = link.text; + range = [ link.startColumn, link.endColumn - link.startColumn ]; + fixInfo = { + "editColumn": startColumn, + "deleteCount": endColumn - startColumn + }; + } + const textLower = text.toLowerCase(); + const mixedCaseKey = [ ...fragments.keys() ] + .find((key) => textLower === key.toLowerCase()); + if (mixedCaseKey) { + // @ts-ignore + (fixInfo || {}).insertText = mixedCaseKey; + if (!ignoreCase && (mixedCaseKey !== text)) { + addError( + onError, + link.startLine, + `Expected: ${mixedCaseKey}; Actual: ${text}`, + context, + range, + fixInfo + ); + } + } else { + addError( + onError, + link.startLine, + undefined, + context, + range + ); + } + } + } + } + } + } +}; diff --git a/lib/md052.mjs b/lib/md052.mjs new file mode 100644 index 00000000..a87215e3 --- /dev/null +++ b/lib/md052.mjs @@ -0,0 +1,40 @@ +// @ts-check + +import { addError } from "../helpers/helpers.cjs"; +import { getReferenceLinkImageData } from "./cache.mjs"; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD052", "reference-links-images" ], + "description": + "Reference links and images should use a label that is defined", + "tags": [ "images", "links" ], + "parser": "none", + "function": function MD052(params, onError) { + const { config, lines } = params; + const shortcutSyntax = config.shortcut_syntax || false; + const ignoredLabels = new Set(config.ignored_labels || [ "x" ]); + const { definitions, references, shortcuts } = getReferenceLinkImageData(); + const entries = shortcutSyntax ? + [ ...references.entries(), ...shortcuts.entries() ] : + references.entries(); + // Look for links/images that use an undefined link reference + for (const reference of entries) { + const [ label, datas ] = reference; + if (!definitions.has(label) && !ignoredLabels.has(label)) { + for (const data of datas) { + const [ lineIndex, index, length ] = data; + // Context will be incomplete if reporting for a multi-line link + const context = lines[lineIndex].slice(index, index + length); + addError( + onError, + lineIndex + 1, + `Missing link or image reference definition: "${label}"`, + context, + [ index + 1, context.length ] + ); + } + } + } + } +}; diff --git a/lib/md053.mjs b/lib/md053.mjs new file mode 100644 index 00000000..c3a9f29e --- /dev/null +++ b/lib/md053.mjs @@ -0,0 +1,60 @@ +// @ts-check + +import { addError, ellipsify } from "../helpers/helpers.cjs"; +import { getReferenceLinkImageData } from "./cache.mjs"; + +const linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])\]:/; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD053", "link-image-reference-definitions" ], + "description": "Link and image reference definitions should be needed", + "tags": [ "images", "links" ], + "parser": "none", + "function": function MD053(params, onError) { + const ignored = new Set(params.config.ignored_definitions || [ "//" ]); + const lines = params.lines; + const { references, shortcuts, definitions, duplicateDefinitions } = + getReferenceLinkImageData(); + const singleLineDefinition = (/** @type {string} */ line) => ( + line.replace(linkReferenceDefinitionRe, "").trim().length > 0 + ); + const deleteFixInfo = { + "deleteCount": -1 + }; + // Look for unused link references (unreferenced by any link/image) + for (const definition of definitions.entries()) { + const [ label, [ lineIndex ] ] = definition; + if ( + !ignored.has(label) && + !references.has(label) && + !shortcuts.has(label) + ) { + const line = lines[lineIndex]; + addError( + onError, + lineIndex + 1, + `Unused link or image reference definition: "${label}"`, + ellipsify(line), + [ 1, line.length ], + singleLineDefinition(line) ? deleteFixInfo : undefined + ); + } + } + // Look for duplicate link references (defined more than once) + for (const duplicateDefinition of duplicateDefinitions) { + const [ label, lineIndex ] = duplicateDefinition; + if (!ignored.has(label)) { + const line = lines[lineIndex]; + addError( + onError, + lineIndex + 1, + `Duplicate link or image reference definition: "${label}"`, + ellipsify(line), + [ 1, line.length ], + singleLineDefinition(line) ? deleteFixInfo : undefined + ); + } + } + } +}; diff --git a/lib/md054.mjs b/lib/md054.mjs new file mode 100644 index 00000000..9ee0679b --- /dev/null +++ b/lib/md054.mjs @@ -0,0 +1,122 @@ +// @ts-check + +import { addErrorContext, nextLinesRe } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { getReferenceLinkImageData, filterByTypesCached } from "./cache.mjs"; + +const backslashEscapeRe = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g; +const removeBackslashEscapes = (/** @type {string} **/ text) => text.replace(backslashEscapeRe, "$1"); +const autolinkDisallowedRe = /[ <>]/; +const autolinkAble = (/** @type {string} */ destination) => { + try { + // eslint-disable-next-line no-new + new URL(destination); + } catch { + // Not an absolute URL + return false; + } + return !autolinkDisallowedRe.test(destination); +}; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD054", "link-image-style" ], + "description": "Link and image style", + "tags": [ "images", "links" ], + "parser": "micromark", + "function": (params, onError) => { + const config = params.config; + const autolink = (config.autolink === undefined) || !!config.autolink; + const inline = (config.inline === undefined) || !!config.inline; + const full = (config.full === undefined) || !!config.full; + const collapsed = (config.collapsed === undefined) || !!config.collapsed; + const shortcut = (config.shortcut === undefined) || !!config.shortcut; + const urlInline = (config.url_inline === undefined) || !!config.url_inline; + if (autolink && inline && full && collapsed && shortcut && urlInline) { + // Everything allowed, nothing to check + return; + } + const { definitions } = getReferenceLinkImageData(); + const links = filterByTypesCached([ "autolink", "image", "link" ]); + for (const link of links) { + let label = null; + let destination = null; + const { + endColumn, endLine, startColumn, startLine, text, type + } = link; + const image = (type === "image"); + let isError = false; + if (type === "autolink") { + // link kind is an autolink + destination = getDescendantsByType(link, [ [ "autolinkEmail", "autolinkProtocol" ] ])[0]?.text; + label = destination; + isError = !autolink && Boolean(destination); + } else { + // link type is "image" or "link" + label = getDescendantsByType(link, [ "label", "labelText" ])[0].text; + destination = + getDescendantsByType(link, [ "resource", "resourceDestination", [ "resourceDestinationLiteral", "resourceDestinationRaw" ], "resourceDestinationString" ])[0]?.text; + if (destination) { + // link kind is an inline link + const title = getDescendantsByType(link, [ "resource", "resourceTitle", "resourceTitleString" ])[0]?.text; + isError = !inline || ( + !urlInline && + autolink && + !image && + !title && + (label === destination) && + autolinkAble(destination) + ); + } else { + // link kind is a full/collapsed/shortcut reference link + const isShortcut = getDescendantsByType(link, [ "reference" ]).length === 0; + const referenceString = getDescendantsByType(link, [ "reference", "referenceString" ])[0]?.text; + const isCollapsed = (referenceString === undefined); + const definition = definitions.get(referenceString || label); + destination = (definition && definition[1]) || ""; + isError = Boolean( + destination && + (isShortcut ? !shortcut : (isCollapsed ? !collapsed : !full)) + ); + } + } + if (isError) { + let range = undefined; + let fixInfo = undefined; + if (startLine === endLine) { + range = [ startColumn, endColumn - startColumn ]; + let insertText = null; + const canInline = (inline && label); + const canAutolink = (autolink && !image && autolinkAble(destination)); + if (canInline && (urlInline || !canAutolink)) { + // Most useful form + const prefix = (image ? "!" : ""); + // @ts-ignore + const escapedLabel = label.replace(/[[\]]/g, "\\$&"); + const escapedDestination = destination.replace(/[()]/g, "\\$&"); + insertText = `${prefix}[${escapedLabel}](${escapedDestination})`; + } else if (canAutolink) { + // Simplest form + insertText = `<${removeBackslashEscapes(destination)}>`; + } + if (insertText) { + fixInfo = { + "editColumn": range[0], + insertText, + "deleteCount": range[1] + }; + } + } + addErrorContext( + onError, + startLine, + text.replace(nextLinesRe, ""), + undefined, + undefined, + range, + fixInfo + ); + } + } + } +}; diff --git a/lib/md055.mjs b/lib/md055.mjs new file mode 100644 index 00000000..aed9c758 --- /dev/null +++ b/lib/md055.mjs @@ -0,0 +1,72 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ +/** @typedef {import("micromark-extension-gfm-table")} */ + +const whitespaceTypes = new Set([ "linePrefix", "whitespace" ]); +const ignoreWhitespace = (/** @type {MicromarkToken[]} */ tokens) => tokens.filter( + (token) => !whitespaceTypes.has(token.type) +); +const firstOrNothing = (/** @type {MicromarkToken[]} */ items) => items[0]; +const lastOrNothing = (/** @type {MicromarkToken[]} */ items) => items[items.length - 1]; +const makeRange = (/** @type {number} */ start, /** @type {number} */ end) => [ start, end - start + 1 ]; + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD055", "table-pipe-style" ], + "description": "Table pipe style", + "tags": [ "table" ], + "parser": "micromark", + "function": function MD055(params, onError) { + const style = String(params.config.style || "consistent"); + let expectedStyle = style; + let expectedLeadingPipe = + ((expectedStyle !== "no_leading_or_trailing") && (expectedStyle !== "trailing_only")); + let expectedTrailingPipe = + ((expectedStyle !== "no_leading_or_trailing") && (expectedStyle !== "leading_only")); + const rows = filterByTypesCached([ "tableDelimiterRow", "tableRow" ]); + for (const row of rows) { + // The following uses of first/lastOrNothing lack fallback handling + // because it seems not to be possible (i.e., 0% coverage) + const firstCell = firstOrNothing(row.children); + const leadingToken = firstOrNothing(ignoreWhitespace(firstCell.children)); + const actualLeadingPipe = (leadingToken.type === "tableCellDivider"); + const lastCell = lastOrNothing(row.children); + const trailingToken = lastOrNothing(ignoreWhitespace(lastCell.children)); + const actualTrailingPipe = (trailingToken.type === "tableCellDivider"); + const actualStyle = actualLeadingPipe ? + (actualTrailingPipe ? "leading_and_trailing" : "leading_only") : + (actualTrailingPipe ? "trailing_only" : "no_leading_or_trailing"); + if (expectedStyle === "consistent") { + expectedStyle = actualStyle; + expectedLeadingPipe = actualLeadingPipe; + expectedTrailingPipe = actualTrailingPipe; + } + if (actualLeadingPipe !== expectedLeadingPipe) { + addErrorDetailIf( + onError, + firstCell.startLine, + expectedStyle, + actualStyle, + `${expectedLeadingPipe ? "Missing" : "Unexpected"} leading pipe`, + undefined, + makeRange(row.startColumn, firstCell.startColumn) + ); + } + if (actualTrailingPipe !== expectedTrailingPipe) { + addErrorDetailIf( + onError, + lastCell.endLine, + expectedStyle, + actualStyle, + `${expectedTrailingPipe ? "Missing" : "Unexpected"} trailing pipe`, + undefined, + makeRange(lastCell.endColumn - 1, row.endColumn - 1) + ); + } + } + } +}; diff --git a/lib/md056.mjs b/lib/md056.mjs new file mode 100644 index 00000000..9a4ce897 --- /dev/null +++ b/lib/md056.mjs @@ -0,0 +1,50 @@ +// @ts-check + +import { addErrorDetailIf } from "../helpers/helpers.cjs"; +import { getParentOfType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +const makeRange = (/** @type {number} */ start, /** @type {number} */ end) => [ start, end - start + 1 ]; + +/** @typedef {import("micromark-extension-gfm-table")} */ + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD056", "table-column-count" ], + "description": "Table column count", + "tags": [ "table" ], + "parser": "micromark", + "function": function MD056(params, onError) { + const rows = filterByTypesCached([ "tableDelimiterRow", "tableRow" ]); + let expectedCount = 0; + let currentTable = null; + for (const row of rows) { + const table = getParentOfType(row, [ "table" ]); + if (currentTable !== table) { + expectedCount = 0; + currentTable = table; + } + const cells = row.children.filter((child) => [ "tableData", "tableDelimiter", "tableHeader" ].includes(child.type)); + const actualCount = cells.length; + expectedCount ||= actualCount; + let detail = undefined; + let range = undefined; + if (actualCount < expectedCount) { + detail = "Too few cells, row will be missing data"; + range = [ row.endColumn - 1, 1 ]; + } else if (expectedCount < actualCount) { + detail = "Too many cells, extra data will be missing"; + range = makeRange(cells[expectedCount].startColumn, row.endColumn - 1); + } + addErrorDetailIf( + onError, + row.endLine, + expectedCount, + actualCount, + detail, + undefined, + range + ); + } + } +}; diff --git a/lib/md058.mjs b/lib/md058.mjs new file mode 100644 index 00000000..4d00857a --- /dev/null +++ b/lib/md058.mjs @@ -0,0 +1,57 @@ +// @ts-check + +import { addErrorContext, isBlankLine } from "../helpers/helpers.cjs"; +import { getBlockQuotePrefixText } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("micromark-extension-gfm-table")} */ + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD058", "blanks-around-tables" ], + "description": "Tables should be surrounded by blank lines", + "tags": [ "table" ], + "parser": "micromark", + "function": function MD058(params, onError) { + const { lines } = params; + const blockQuotePrefixes = filterByTypesCached([ "blockQuotePrefix", "linePrefix" ]); + + // For every table... + const tables = filterByTypesCached([ "table" ]); + for (const table of tables) { + + // Look for a blank line above the table + const firstLineNumber = table.startLine; + if (!isBlankLine(lines[firstLineNumber - 2])) { + addErrorContext( + onError, + firstLineNumber, + lines[firstLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, firstLineNumber) + } + ); + } + + // Look for a blank line below the table + const lastLineNumber = table.endLine; + if (!isBlankLine(lines[lastLineNumber])) { + addErrorContext( + onError, + lastLineNumber, + lines[lastLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "lineNumber": lastLineNumber + 1, + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, lastLineNumber) + } + ); + } + } + } +}; diff --git a/lib/md059.mjs b/lib/md059.mjs new file mode 100644 index 00000000..978dc3f7 --- /dev/null +++ b/lib/md059.mjs @@ -0,0 +1,71 @@ +// @ts-check + +import { addErrorContext } from "../helpers/helpers.cjs"; +import { getDescendantsByType } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; + +/** @typedef {import("markdownlint").MicromarkTokenType} MicromarkTokenType */ +/** @type {Set} */ +const allowedChildrenTypes = new Set([ + "codeText", + "htmlText" +]); +const defaultProhibitedTexts = [ + "click here", + "here", + "link", + "more" +]; + +/** + * Normalizes a string by removing extra whitespaces and punctuation. + * + * @param {string} str String to normalize. + * @returns {string} Normalized string. + */ +function normalize(str) { + return str + .replace(/[\W_]+/g, " ") + .replace(/\s+/g, " ") + .toLowerCase() + .trim(); +} + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD059", "descriptive-link-text" ], + "description": "Link text should be descriptive", + "tags": [ "accessibility", "links" ], + "parser": "micromark", + "function": function MD059(params, onError) { + const prohibitedTexts = new Set( + (params.config.prohibited_texts || defaultProhibitedTexts).map(normalize) + ); + if (prohibitedTexts.size > 0) { + const links = filterByTypesCached([ "link" ]); + for (const link of links) { + const labelTexts = getDescendantsByType(link, [ "label", "labelText" ]); + for (const labelText of labelTexts) { + const { children, endColumn, endLine, parent, startColumn, startLine, text } = labelText; + if ( + !children.some((child) => allowedChildrenTypes.has(child.type)) && + prohibitedTexts.has(normalize(text)) + ) { + const range = (startLine === endLine) ? + [ startColumn, endColumn - startColumn ] : + undefined; + addErrorContext( + onError, + startLine, + // @ts-ignore + parent.text, + undefined, + undefined, + range + ); + } + } + } + } + } +}; diff --git a/lib/md060.mjs b/lib/md060.mjs new file mode 100644 index 00000000..07cc5a57 --- /dev/null +++ b/lib/md060.mjs @@ -0,0 +1,170 @@ +// @ts-check + +import { filterByTypes } from "../helpers/micromark-helpers.cjs"; +import { filterByTypesCached } from "./cache.mjs"; +import stringWidth from "string-width"; + +/** @typedef {import("micromark-extension-gfm-table")} */ +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ +/** @typedef {import("markdownlint").RuleOnErrorInfo} RuleOnErrorInfo */ + +/** + * Adds a RuleOnErrorInfo object to a list of RuleOnErrorInfo objects. + * + * @param {RuleOnErrorInfo[]} errors List of errors. + * @param {number} lineNumber Line number. + * @param {number} column Column number. + * @param {string} detail Detail message. + */ +function addError(errors, lineNumber, column, detail) { + errors.push({ + lineNumber, + detail, + "range": [ column, 1 ] + }); +} + +/** + * @typedef Column + * @property {number} actual Actual column (1-based). + * @property {number} effective Effective column (1-based). + */ + +/** + * Gets a list of table cell divider columns. + * + * @param {readonly string[]} lines File/string lines. + * @param {MicromarkToken} row Micromark row token. + * @returns {Column[]} Divider columns. + */ +function getTableDividerColumns(lines, row) { + return filterByTypes( + row.children, + [ "tableCellDivider" ] + ).map( + (divider) => ({ + "actual": divider.startColumn, + "effective": stringWidth(lines[row.startLine - 1].slice(0, divider.startColumn - 1)) + }) + ); +} + +/** + * Checks the specified table rows for consistency with the "aligned" style. + * + * @param {readonly string[]} lines File/string lines. + * @param {MicromarkToken[]} rows Micromark row tokens. + * @param {string} detail Detail message. + * @returns {RuleOnErrorInfo[]} List of errors. + */ +function checkStyleAligned(lines, rows, detail) { + /** @type {RuleOnErrorInfo[]} */ + const errorInfos = []; + const headerRow = rows[0]; + const headerDividerColumns = getTableDividerColumns(lines, headerRow); + for (const row of rows.slice(1)) { + const remainingHeaderDividerColumns = new Set(headerDividerColumns.map((column) => column.effective)); + const rowDividerColumns = getTableDividerColumns(lines, row); + for (const dividerColumn of rowDividerColumns) { + if ((remainingHeaderDividerColumns.size > 0) && !remainingHeaderDividerColumns.delete(dividerColumn.effective)) { + addError(errorInfos, row.startLine, dividerColumn.actual, detail); + } + } + } + return errorInfos; +} + +/** @type {import("markdownlint").Rule} */ +export default { + "names": [ "MD060", "table-column-style" ], + "description": "Table column style", + "tags": [ "table" ], + "parser": "micromark", + "function": function MD060(params, onError) { + const style = String(params.config.style || "any"); + const styleAlignedAllowed = (style === "any") || (style === "aligned"); + const styleCompactAllowed = (style === "any") || (style === "compact"); + const styleTightAllowed = (style === "any") || (style === "tight"); + const alignedDelimiter = !!params.config.aligned_delimiter; + const lines = params.lines; + + // Scan all tables/rows + const tables = filterByTypesCached([ "table" ]); + for (const table of tables) { + const rows = filterByTypes(table.children, [ "tableDelimiterRow", "tableRow" ]); + + // Determine errors for style "aligned" + /** @type {RuleOnErrorInfo[]} */ + const errorsIfAligned = []; + if (styleAlignedAllowed) { + errorsIfAligned.push(...checkStyleAligned(lines, rows, "Table pipe does not align with header for style \"aligned\"")); + } + + // Determine errors for styles "compact" and "tight" + /** @type {RuleOnErrorInfo[]} */ + const errorsIfCompact = []; + /** @type {RuleOnErrorInfo[]} */ + const errorsIfTight = []; + if ( + (styleCompactAllowed || styleTightAllowed) && + !(styleAlignedAllowed && (errorsIfAligned.length === 0)) + ) { + if (alignedDelimiter) { + const errorInfos = checkStyleAligned(lines, rows.slice(0, 2), "Table pipe does not align with header for option \"aligned_delimiter\""); + errorsIfCompact.push(...errorInfos); + errorsIfTight.push(...errorInfos); + } + for (const row of rows) { + const tokensOfInterest = filterByTypes(row.children, [ "tableCellDivider", "tableContent", "whitespace" ]); + for (let i = 0; i < tokensOfInterest.length; i++) { + const { startColumn, startLine, type } = tokensOfInterest[i]; + if (type === "tableCellDivider") { + const previous = tokensOfInterest[i - 1]; + if (previous) { + if (previous.type === "whitespace") { + if (previous.text.length !== 1) { + addError(errorsIfCompact, startLine, startColumn, "Table pipe has extra space to the left for style \"compact\""); + } + addError(errorsIfTight, startLine, startColumn, "Table pipe has space to the left for style \"tight\""); + } else { + addError(errorsIfCompact, startLine, startColumn, "Table pipe is missing space to the left for style \"compact\""); + } + } + const next = tokensOfInterest[i + 1]; + if (next) { + if (next.type === "whitespace") { + if (next.endColumn !== row.endColumn) { + if (next.text.length !== 1) { + addError(errorsIfCompact, startLine, startColumn, "Table pipe has extra space to the right for style \"compact\""); + } + addError(errorsIfTight, startLine, startColumn, "Table pipe has space to the right for style \"tight\""); + } + } else { + addError(errorsIfCompact, startLine, startColumn, "Table pipe is missing space to the right for style \"compact\""); + } + } + } + } + } + } + + // Report errors for whatever (allowed) style has the fewest + let errorInfos = errorsIfAligned; + if ( + styleCompactAllowed && + ((errorsIfCompact.length < errorInfos.length) || !styleAlignedAllowed) + ) { + errorInfos = errorsIfCompact; + } + if ( + styleTightAllowed && + ((errorsIfTight.length < errorInfos.length) || (!styleAlignedAllowed && !styleCompactAllowed)) + ) { + errorInfos = errorsIfTight; + } + for (const errorInfo of errorInfos) { + onError(errorInfo); + } + } + } +}; diff --git a/lib/micromark-parse.mjs b/lib/micromark-parse.mjs new file mode 100644 index 00000000..e960b3c4 --- /dev/null +++ b/lib/micromark-parse.mjs @@ -0,0 +1,322 @@ +// @ts-check + +import { directive } from "micromark-extension-directive"; +import { gfmAutolinkLiteral } from "micromark-extension-gfm-autolink-literal"; +import { gfmFootnote } from "micromark-extension-gfm-footnote"; +import { gfmTable } from "micromark-extension-gfm-table"; +import { math } from "micromark-extension-math"; +import { parse as micromarkParse, postprocess as micromarkPostprocess, preprocess as micromarkPreprocess } from "micromark"; +// micromark-core-commonmark must exactly match what's used by micromark for the shim below to work correctly +// Unfortunately, omitting this dependency from package.json breaks strict dependency resolution (e.g., pnpm) +import { labelEnd } from "micromark-core-commonmark"; +import { isHtmlFlowComment } from "../helpers/micromark-helpers.cjs"; +import { flatTokensSymbol, htmlFlowSymbol, newLineRe } from "../helpers/shared.cjs"; + +/** @typedef {import("micromark-util-types").Event} Event */ +/** @typedef {import("micromark-util-types").ParseOptions} MicromarkParseOptions */ +/** @typedef {import("micromark-util-types").State} State */ +/** @typedef {import("micromark-util-types").Token} Token */ +/** @typedef {import("micromark-util-types").Tokenizer} Tokenizer */ +/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */ +/** @typedef {import("./micromark-types.d.mts")} */ + +/** + * Gets the Markdown text for a Micromark token. + * + * @param {string} markdown Markdown content. + * @param {Token} token Micromark token. + * @returns {string} Token text. + */ +function getText(markdown, token) { + return markdown.slice(token.start.offset, token.end.offset); +} + +/** + * Parse options. + * + * @typedef {Object} ParseOptions + * @property {boolean} [freezeTokens] Whether to freeze output Tokens. + */ + +/** + * Parses a Markdown document and returns Micromark events. + * + * @param {string} markdown Markdown document. + * @param {MicromarkParseOptions} [micromarkParseOptions] Options for micromark. + * @returns {Event[]} Micromark events. + */ +export function getEvents( + markdown, + micromarkParseOptions = {} +) { + // Customize extensions list to add useful extensions + const extensions = [ + directive(), + gfmAutolinkLiteral(), + gfmFootnote(), + gfmTable(), + math(), + ...(micromarkParseOptions.extensions || []) + ]; + + // // Shim labelEnd to identify undefined link labels + /** @type {Event[][]} */ + const artificialEventLists = []; + const tokenizeOriginal = labelEnd.tokenize; + + /** @type {Tokenizer} */ + function tokenizeShim(effects, okOriginal, nokOriginal) { + // eslint-disable-next-line consistent-this, unicorn/no-this-assignment, no-invalid-this + const tokenizeContext = this; + const events = tokenizeContext.events; + + /** @type {State} */ + const nokShim = (code) => { + // Find start of label (image or link) + let indexStart = events.length; + while (--indexStart >= 0) { + const event = events[indexStart]; + const [ kind, token ] = event; + if (kind === "enter") { + const { type } = token; + if ((type === "labelImage") || (type === "labelLink")) { + // Found it + break; + } + } + } + + // If found... + if (indexStart >= 0) { + // Create artificial enter/exit events and replicate all data/lineEnding events within + const eventStart = events[indexStart]; + const [ , eventStartToken ] = eventStart; + const eventEnd = events[events.length - 1]; + const [ , eventEndToken ] = eventEnd; + /** @type {Token} */ + const undefinedReferenceType = { + "type": "undefinedReferenceShortcut", + "start": eventStartToken.start, + "end": eventEndToken.end + }; + /** @type {Token} */ + const undefinedReference = { + "type": "undefinedReference", + "start": eventStartToken.start, + "end": eventEndToken.end + }; + const eventsToReplicate = events + .slice(indexStart) + .filter((event) => { + const [ , eventToken ] = event; + const { type } = eventToken; + return (type === "data") || (type === "lineEnding"); + }); + + // Determine the type of the undefined reference + const previousUndefinedEvent = (artificialEventLists.length > 0) && artificialEventLists[artificialEventLists.length - 1][0]; + const previousUndefinedToken = previousUndefinedEvent && previousUndefinedEvent[1]; + if ( + previousUndefinedToken && + (previousUndefinedToken.end.line === undefinedReferenceType.start.line) && + (previousUndefinedToken.end.column === undefinedReferenceType.start.column) + ) { + // Previous undefined reference event is immediately before this one + if (eventsToReplicate.length === 0) { + // The pair represent a collapsed reference (ex: [...][]) + previousUndefinedToken.type = "undefinedReferenceCollapsed"; + previousUndefinedToken.end = eventEndToken.end; + } else { + // The pair represent a full reference (ex: [...][...]) + undefinedReferenceType.type = "undefinedReferenceFull"; + undefinedReferenceType.start = previousUndefinedToken.start; + artificialEventLists.pop(); + } + } + + // Create artificial event list and replicate content + const text = eventsToReplicate + .filter((event) => event[0] === "enter") + .map((event) => getText(markdown, event[1])) + .join("") + .trim(); + if ((text.length > 0) && !text.includes("]")) { + /** @type {Event[]} */ + const artificialEvents = [ + [ "enter", undefinedReferenceType, tokenizeContext ], + [ "enter", undefinedReference, tokenizeContext ] + ]; + for (const event of eventsToReplicate) { + const [ kind, token ] = event; + // Copy token because the current object will get modified by the parser + artificialEvents.push([ kind, { ...token }, tokenizeContext ]); + } + artificialEvents.push( + [ "exit", undefinedReference, tokenizeContext ], + [ "exit", undefinedReferenceType, tokenizeContext ] + ); + artificialEventLists.push(artificialEvents); + } + } + + // Continue with original behavior + return nokOriginal(code); + }; + + // Shim nok handler of labelEnd's tokenize + return tokenizeOriginal.call(tokenizeContext, effects, okOriginal, nokShim); + } + + try { + // Shim labelEnd behavior to detect undefined references + labelEnd.tokenize = tokenizeShim; + + // Use micromark to parse document into Events + const encoding = undefined; + const eol = true; + const parseContext = micromarkParse({ ...micromarkParseOptions, extensions }); + const chunks = micromarkPreprocess()(markdown, encoding, eol); + const events = micromarkPostprocess(parseContext.document().write(chunks)); + + // Append artificial events and return all events + // eslint-disable-next-line unicorn/prefer-spread + return events.concat(...artificialEventLists); + } finally { + // Restore shimmed labelEnd behavior + labelEnd.tokenize = tokenizeOriginal; + } +} + +/** + * Parses a Markdown document and returns micromark tokens (internal). + * + * @param {string} markdown Markdown document. + * @param {ParseOptions} [parseOptions] Options. + * @param {MicromarkParseOptions} [micromarkParseOptions] Options for micromark. + * @param {number} [lineDelta] Offset for start/end line. + * @param {MicromarkToken} [ancestor] Parent of top-most tokens. + * @returns {MicromarkToken[]} Micromark tokens. + */ +function parseInternal( + markdown, + parseOptions = {}, + micromarkParseOptions = {}, + lineDelta = 0, + ancestor = undefined +) { + // Get options + const freezeTokens = Boolean(parseOptions.freezeTokens); + + // Use micromark to parse document into Events + const events = getEvents(markdown, micromarkParseOptions); + + // Create Token objects + /** @type {MicromarkToken[]} */ + const document = []; + /** @type {MicromarkToken[]} */ + let flatTokens = []; + /** @type {MicromarkToken} */ + const root = { + "type": "data", + "startLine": -1, + "startColumn": -1, + "endLine": -1, + "endColumn": -1, + "text": "ROOT", + "children": document, + "parent": null + }; + const history = [ root ]; + let current = root; + /** @type {MicromarkParseOptions | null} */ + let reparseOptions = null; + let lines = null; + let skipHtmlFlowChildren = false; + for (const event of events) { + const [ kind, token ] = event; + const { type, start, end } = token; + const { "column": startColumn, "line": startLine } = start; + const { "column": endColumn, "line": endLine } = end; + const text = getText(markdown, token); + if ((kind === "enter") && !skipHtmlFlowChildren) { + const previous = current; + history.push(previous); + current = { + type, + "startLine": startLine + lineDelta, + startColumn, + "endLine": endLine + lineDelta, + endColumn, + text, + "children": [], + "parent": ((previous === root) ? (ancestor || null) : previous) + }; + if (ancestor) { + Object.defineProperty(current, htmlFlowSymbol, { "value": true }); + } + previous.children.push(current); + flatTokens.push(current); + if ((current.type === "htmlFlow") && !isHtmlFlowComment(current)) { + skipHtmlFlowChildren = true; + if (!reparseOptions || !lines) { + reparseOptions = { + ...micromarkParseOptions, + "extensions": [ + { + "disable": { + "null": [ "codeIndented", "htmlFlow" ] + } + } + ] + }; + lines = markdown.split(newLineRe); + } + const reparseMarkdown = lines + .slice(current.startLine - 1, current.endLine) + .join("\n"); + const tokens = parseInternal( + reparseMarkdown, + parseOptions, + reparseOptions, + current.startLine - 1, + current + ); + current.children = tokens; + // Avoid stack overflow of Array.push(...spread) + // @ts-ignore + // eslint-disable-next-line unicorn/prefer-spread + flatTokens = flatTokens.concat(tokens[flatTokensSymbol]); + } + } else if (kind === "exit") { + if (type === "htmlFlow") { + skipHtmlFlowChildren = false; + } + if (!skipHtmlFlowChildren) { + if (freezeTokens) { + Object.freeze(current.children); + Object.freeze(current); + } + // @ts-ignore + current = history.pop(); + } + } + } + + // Return document + Object.defineProperty(document, flatTokensSymbol, { "value": flatTokens }); + if (freezeTokens) { + Object.freeze(document); + } + return document; +} + +/** + * Parses a Markdown document and returns micromark tokens. + * + * @param {string} markdown Markdown document. + * @param {ParseOptions} [parseOptions] Options. + * @returns {MicromarkToken[]} Micromark tokens. + */ +export function parse(markdown, parseOptions) { + return parseInternal(markdown, parseOptions); +} diff --git a/lib/micromark-types.d.mts b/lib/micromark-types.d.mts new file mode 100644 index 00000000..6afc9d0e --- /dev/null +++ b/lib/micromark-types.d.mts @@ -0,0 +1,11 @@ +export {}; + +// Augment TokenTypeMap with markdownlint-specific types. +declare module "micromark-util-types" { + export interface TokenTypeMap { + undefinedReference: "undefinedReference" + undefinedReferenceCollapsed: "undefinedReferenceCollapsed" + undefinedReferenceFull: "undefinedReferenceFull" + undefinedReferenceShortcut: "undefinedReferenceShortcut" + } +} diff --git a/lib/node-imports-browser.mjs b/lib/node-imports-browser.mjs new file mode 100644 index 00000000..6c1aa91c --- /dev/null +++ b/lib/node-imports-browser.mjs @@ -0,0 +1,22 @@ +// @ts-check + +const getError = () => new Error("Node APIs are not available in browser context."); +const throwForSync = () => { + throw getError(); +}; + +export const fs = { + // @ts-ignore + "access": (path, callback) => callback(getError()), + "accessSync": throwForSync, + // @ts-ignore + "readFile": (path, options, callback) => callback(getError()), + "readFileSync": throwForSync +}; + +export const os = {}; + +export const path = { + "dirname": throwForSync, + "resolve": throwForSync +}; diff --git a/lib/node-imports-node.mjs b/lib/node-imports-node.mjs new file mode 100644 index 00000000..4427e97a --- /dev/null +++ b/lib/node-imports-node.mjs @@ -0,0 +1,11 @@ +// @ts-check + +import { access, accessSync, readFile, readFileSync } from "node:fs"; +export const fs = { access, accessSync, readFile, readFileSync }; + +import { EOL, homedir } from "node:os"; +export const os = { EOL, homedir }; + +// eslint-disable-next-line unicorn/import-style +import { dirname, resolve } from "node:path"; +export const path = { dirname, resolve }; diff --git a/lib/parse-configuration.mjs b/lib/parse-configuration.mjs new file mode 100644 index 00000000..b7bd85bc --- /dev/null +++ b/lib/parse-configuration.mjs @@ -0,0 +1,47 @@ +// @ts-check + +/** + * Result of a call to parseConfiguration. + * + * @typedef {Object} ParseConfigurationResult + * @property {import("markdownlint").Configuration | null} config Configuration object if successful. + * @property {string | null} message Error message if an error occurred. + */ + +/** + * Parse the content of a configuration file. + * + * @param {string} name Name of the configuration file. + * @param {string} content Configuration content. + * @param {import("markdownlint").ConfigurationParser[]} [parsers] Parsing function(s). + * @returns {ParseConfigurationResult} Parse configuration result. + */ +export default function parseConfiguration(name, content, parsers) { + let config = null; + let message = null; + const errors = []; + let index = 0; + // Try each parser + const failed = (parsers || [ JSON.parse ]).every((parser) => { + try { + const result = parser(content); + config = (result && (typeof result === "object") && !Array.isArray(result)) ? result : {}; + // Succeeded + return false; + // eslint-disable-next-line jsdoc/reject-any-type + } catch(/** @type {any} */ error) { + errors.push(`Parser ${index++}: ${error?.message}`); + } + // Failed, try the next parser + return true; + }); + // Message if unable to parse + if (failed) { + errors.unshift(`Unable to parse '${name}'`); + message = errors.join("; "); + } + return { + config, + message + }; +} diff --git a/lib/resolve-module.cjs b/lib/resolve-module.cjs new file mode 100644 index 00000000..82922a87 --- /dev/null +++ b/lib/resolve-module.cjs @@ -0,0 +1,52 @@ +// @ts-check + +"use strict"; + +// @ts-ignore +// eslint-disable-next-line camelcase, no-inline-comments, no-undef +const nativeRequire = (typeof __non_webpack_require__ === "undefined") ? require : /* c8 ignore next */ __non_webpack_require__; +// Captures the native require implementation (even under webpack). + +/** + * @typedef RequireResolveOptions + * @property {string[]} [paths] Additional paths to resolve from. + */ + +/** + * @callback RequireResolve + * @param {string} id Module name or path. + * @param {RequireResolveOptions} options Options to apply. + * @returns {string} Resolved module path. + */ + +/** + * Resolves modules according to Node's resolution rules. + * + * @param {RequireResolve} resolve Node-like require.resolve implementation. + * @param {string} id Module name or path. + * @param {string[]} [paths] Additional paths to resolve from. + * @returns {string} Resolved module path. + */ +const resolveModuleCustomResolve = (resolve, id, paths = []) => { + // resolve.paths is sometimes not present under webpack or VS Code + // @ts-ignore + const resolvePaths = resolve.paths?.("") || []; + const allPaths = [ ...paths, ...resolvePaths ]; + return resolve(id, { "paths": allPaths }); +}; + +/** + * Resolves modules according to Node's resolution rules. + * + * @param {string} id Module name or path. + * @param {string[]} [paths] Additional paths to resolve from. + * @returns {string} Resolved module path. + */ +const resolveModule = (id, paths) => ( + resolveModuleCustomResolve(nativeRequire.resolve, id, paths) +); + +module.exports = { + resolveModule, + resolveModuleCustomResolve +}; diff --git a/lib/resolve-module.d.cts b/lib/resolve-module.d.cts new file mode 100644 index 00000000..f3d6a845 --- /dev/null +++ b/lib/resolve-module.d.cts @@ -0,0 +1,34 @@ +export type RequireResolveOptions = { + /** + * Additional paths to resolve from. + */ + paths?: string[]; +}; +export type RequireResolve = (id: string, options: RequireResolveOptions) => string; +/** + * Resolves modules according to Node's resolution rules. + * + * @param {string} id Module name or path. + * @param {string[]} [paths] Additional paths to resolve from. + * @returns {string} Resolved module path. + */ +export function resolveModule(id: string, paths?: string[]): string; +/** + * @typedef RequireResolveOptions + * @property {string[]} [paths] Additional paths to resolve from. + */ +/** + * @callback RequireResolve + * @param {string} id Module name or path. + * @param {RequireResolveOptions} options Options to apply. + * @returns {string} Resolved module path. + */ +/** + * Resolves modules according to Node's resolution rules. + * + * @param {RequireResolve} resolve Node-like require.resolve implementation. + * @param {string} id Module name or path. + * @param {string[]} [paths] Additional paths to resolve from. + * @returns {string} Resolved module path. + */ +export function resolveModuleCustomResolve(resolve: RequireResolve, id: string, paths?: string[]): string; diff --git a/lib/rules.js b/lib/rules.js deleted file mode 100644 index 21b5950c..00000000 --- a/lib/rules.js +++ /dev/null @@ -1,810 +0,0 @@ -"use strict"; - -var shared = require("./shared"); - -// Returns the indent for a token -function indentFor(token) { - return token.line.length - token.line.trimLeft().length; -} - -// Returns the heading style for a heading token -function headingStyleFor(token) { - if ((token.map[1] - token.map[0]) === 1) { - if (/#\s*$/.test(token.line)) { - return "atx_closed"; - } - return "atx"; - } - return "setext"; -} - -// Returns the unordered list style for a list item token -function unorderedListStyleFor(token) { - switch (token.line.trimLeft().substr(0, 1)) { - case "-": - return "dash"; - case "+": - return "plus"; - case "*": - default: - return "asterisk"; - } -} - -// Calls the provided function for each matching token -function filterTokens(params, type, callback) { - (params.tokenLists[type] || []).forEach(callback); -} - -// Calls the provided function for each line (with context) -function forEachLine(params, callback) { - if (!params.forEachLine) { - var lineMetadata = new Array(params.lines.length); - var inFence = false; - // Find fenced code by pattern (parser ignores "``` close fence") - params.lines.forEach(function forLine(line, lineIndex) { - var metadata = 0; - if (/^(```|~~~)/.test(line)) { - metadata = inFence ? -2 : 2; - inFence = !inFence; - } else if (inFence) { - metadata = 1; - } - lineMetadata[lineIndex] = metadata; - }); - // Find code blocks normally - filterTokens(params, "code_block", function forToken(token) { - for (var i = token.map[0]; i < token.map[1]; i++) { - lineMetadata[i] = 1; - } - }); - params.forEachLine = lineMetadata; - } - // Invoke callback - params.lines.forEach(function forLine(line, lineIndex) { - var metadata = params.forEachLine[lineIndex]; - callback(line, lineIndex, !!metadata, (metadata >> 1)); - }); -} - -// Calls the provided function for each specified inline child token -function forEachInlineChild(params, type, callback) { - filterTokens(params, "inline", function forToken(token) { - token.children.forEach(function forChild(child) { - if (child.type === type) { - callback(child, token); - } - }); - }); -} - -// Calls the provided function for each heading's content -function forEachHeading(params, callback) { - var heading = null; - params.tokens.forEach(function forToken(token) { - if (token.type === "heading_open") { - heading = token; - } else if (token.type === "heading_close") { - heading = null; - } else if ((token.type === "inline") && heading) { - callback(heading, token.content); - } - }); -} - -// Returns (nested) lists as a flat array (in order) -function flattenLists(params) { - if (!params.flattenLists) { - var lists = []; - var stack = []; - var current = null; - var lastWithMap = { "map": [ 0, 1 ] }; - params.tokens.forEach(function forToken(token) { - if ((token.type === "bullet_list_open") || - (token.type === "ordered_list_open")) { - // Save current context and start a new one - stack.push(current); - current = { - "ordered": (token.type === "ordered_list_open"), - "open": token, - "items": [], - "nesting": stack.length - 1, - "lastLineIndex": -1, - "insert": lists.length - }; - } else if ((token.type === "bullet_list_close") || - (token.type === "ordered_list_close")) { - // Finalize current context and restore previous - current.lastLineIndex = lastWithMap.map[1]; - lists.splice(current.insert, 0, current); - delete current.insert; - current = stack.pop(); - } else if (token.type === "list_item_open") { - // Add list item - current.items.push(token); - } else if (token.map) { - // Track last token with map - lastWithMap = token; - } - }); - params.flattenLists = lists; - } - return params.flattenLists; -} - -module.exports = [ - { - "name": "MD001", - "desc": "Header levels should only increment by one level at a time", - "tags": [ "headers" ], - "func": function MD001(params, errors) { - var prevLevel = 0; - filterTokens(params, "heading_open", function forToken(token) { - var level = parseInt(token.tag.slice(1), 10); - if (prevLevel && (level > prevLevel + 1)) { - errors.push(token.lineNumber); - } - prevLevel = level; - }); - } - }, - - { - "name": "MD002", - "desc": "First header should be a h1 header", - "tags": [ "headers" ], - "func": function MD002(params, errors) { - params.tokens.every(function forToken(token) { - if (token.type === "heading_open") { - if (token.tag !== "h1") { - errors.push(token.lineNumber); - } - return false; - } - return true; - }); - } - }, - - { - "name": "MD003", - "desc": "Header style", - "tags": [ "headers" ], - "func": function MD003(params, errors) { - var style = params.options.style || "consistent"; - filterTokens(params, "heading_open", function forToken(token) { - var styleForToken = headingStyleFor(token); - if (style === "consistent") { - style = styleForToken; - } - if ((styleForToken !== style) && - !((style === "setext_with_atx") && - (/h[12]/.test(token.tag) && (styleForToken === "setext")) || - (/h[^12]/.test(token.tag) && (styleForToken === "atx")))) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD004", - "desc": "Unordered list style", - "tags": [ "bullet", "ul" ], - "func": function MD004(params, errors) { - var style = params.options.style || "consistent"; - flattenLists(params).forEach(function forList(list) { - if (!list.ordered) { - if (style === "consistent") { - style = unorderedListStyleFor(list.items[0]); - } - list.items.forEach(function forItem(item) { - if (unorderedListStyleFor(item) !== style) { - errors.push(item.lineNumber); - } - }); - } - }); - } - }, - - { - "name": "MD005", - "desc": "Inconsistent indentation for list items at the same level", - "tags": [ "bullet", "ul", "indentation" ], - "func": function MD005(params, errors) { - flattenLists(params).forEach(function forList(list) { - var indent = indentFor(list.items[0]); - list.items.forEach(function forItem(item) { - if (indentFor(item) !== indent) { - errors.push(item.lineNumber); - } - }); - }); - } - }, - - { - "name": "MD006", - "desc": "Consider starting bulleted lists at the beginning of the line", - "tags": [ "bullet", "ul", "indentation" ], - "func": function MD006(params, errors) { - flattenLists(params).forEach(function forList(list) { - if (!list.ordered && !list.nesting && indentFor(list.open)) { - errors.push(list.open.lineNumber); - } - }); - } - }, - - { - "name": "MD007", - "desc": "Unordered list indentation", - "tags": [ "bullet", "ul", "indentation" ], - "func": function MD007(params, errors) { - var optionsIndent = params.options.indent || 2; - var prevIndent = 0; - flattenLists(params).forEach(function forList(list) { - if (!list.ordered) { - var indent = indentFor(list.open); - if ((indent > prevIndent) && - ((indent - prevIndent) !== optionsIndent)) { - errors.push(list.open.lineNumber); - } - prevIndent = indent; - } - }); - } - }, - - { - "name": "MD009", - "desc": "Trailing spaces", - "tags": [ "whitespace" ], - "func": function MD009(params, errors) { - var brSpaces = params.options.br_spaces || 0; - params.lines.forEach(function forLine(line, lineIndex) { - if (/\s$/.test(line) && - ((brSpaces < 2) || - (line.length - line.trimRight().length !== brSpaces))) { - errors.push(lineIndex + 1); - } - }); - } - }, - - { - "name": "MD010", - "desc": "Hard tabs", - "tags": [ "whitespace", "hard_tab" ], - "func": function MD010(params, errors) { - params.lines.forEach(function forLine(line, lineIndex) { - if (/\t/.test(line)) { - errors.push(lineIndex + 1); - } - }); - } - }, - - { - "name": "MD011", - "desc": "Reversed link syntax", - "tags": [ "links" ], - "func": function MD011(params, errors) { - forEachInlineChild(params, "text", function forToken(token) { - if (/\([^)]+\)\[[^\]]+\]/.test(token.content)) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD012", - "desc": "Multiple consecutive blank lines", - "tags": [ "whitespace", "blank_lines" ], - "func": function MD012(params, errors) { - var prevLine = "-"; - forEachLine(params, function forLine(line, lineIndex, inCode) { - line = line.trim(); - if (!inCode && !line.length && !prevLine.length) { - errors.push(lineIndex + 1); - } - prevLine = line; - }); - } - }, - - { - "name": "MD013", - "desc": "Line length", - "tags": [ "line_length" ], - "func": function MD013(params, errors) { - var lineLength = params.options.line_length || 80; - var re = new RegExp("^.{" + lineLength + "}.*\\s"); - params.lines.forEach(function forLine(line, lineIndex) { - if (re.test(line)) { - errors.push(lineIndex + 1); - } - }); - } - }, - - { - "name": "MD014", - "desc": "Dollar signs used before commands without showing output", - "tags": [ "code" ], - "func": function MD014(params, errors) { - [ "code_block", "fence" ].forEach(function forType(type) { - filterTokens(params, type, function forToken(token) { - if (token.content && token.content.split(shared.newLineRe) - .every(function forLine(line) { - return !line || /^\$\s/.test(line); - })) { - errors.push(token.lineNumber); - } - }); - }); - } - }, - - { - "name": "MD018", - "desc": "No space after hash on atx style header", - "tags": [ "headers", "atx", "spaces" ], - "func": function MD018(params, errors) { - forEachLine(params, function forLine(line, lineIndex, inCode) { - if (!inCode && /^#+[^#\s]/.test(line) && !/#$/.test(line)) { - errors.push(lineIndex + 1); - } - }); - } - }, - - { - "name": "MD019", - "desc": "Multiple spaces after hash on atx style header", - "tags": [ "headers", "atx", "spaces" ], - "func": function MD019(params, errors) { - filterTokens(params, "heading_open", function forToken(token) { - if ((headingStyleFor(token) === "atx") && - /^#+\s\s/.test(token.line)) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD020", - "desc": "No space inside hashes on closed atx style header", - "tags": [ "headers", "atx_closed", "spaces" ], - "func": function MD020(params, errors) { - forEachLine(params, function forLine(line, lineIndex, inCode) { - if (!inCode && /^#+[^#]*[^\\]#+$/.test(line) && - (/^#+[^#\s]/.test(line) || /[^#\s]#+$/.test(line))) { - errors.push(lineIndex + 1); - } - }); - } - }, - - { - "name": "MD021", - "desc": "Multiple spaces inside hashes on closed atx style header", - "tags": [ "headers", "atx_closed", "spaces" ], - "func": function MD021(params, errors) { - filterTokens(params, "heading_open", function forToken(token) { - if ((headingStyleFor(token) === "atx_closed") && - (/^#+\s\s/.test(token.line) || /\s\s#+$/.test(token.line))) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD022", - "desc": "Headers should be surrounded by blank lines", - "tags": [ "headers", "blank_lines" ], - "func": function MD022(params, errors) { - var prevHeadingLineNumber = 0; - var prevMaxLineIndex = -1; - var needBlankLine = false; - params.tokens.forEach(function forToken(token) { - if (token.type === "heading_open") { - if ((token.map[0] - prevMaxLineIndex) === 0) { - errors.push(token.lineNumber); - } - prevHeadingLineNumber = token.lineNumber; - } else if (token.type === "heading_close") { - needBlankLine = true; - } else if (token.type === "inline") { - token.content.split(shared.newLineRe) - .forEach(function forLine(line, offset) { - if (/^(-+|=+)\s*$/.test(line)) { - errors.push(token.map[0] + offset); - } - }); - } - if (token.map) { - if (needBlankLine) { - if ((token.map[0] - prevMaxLineIndex) === 0) { - errors.push(prevHeadingLineNumber); - } - needBlankLine = false; - } - prevMaxLineIndex = Math.max(prevMaxLineIndex, token.map[1]); - } - }); - } - }, - - { - "name": "MD023", - "desc": "Headers must start at the beginning of the line", - "tags": [ "headers", "spaces" ], - "func": function MD023(params, errors) { - filterTokens(params, "heading_open", function forToken(token) { - if (/^\s/.test(token.line)) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD024", - "desc": "Multiple headers with the same content", - "tags": [ "headers" ], - "func": function MD024(params, errors) { - var knownContent = []; - forEachHeading(params, function forHeading(heading, content) { - if (knownContent.indexOf(content) === -1) { - knownContent.push(content); - } else { - errors.push(heading.lineNumber); - } - }); - } - }, - - { - "name": "MD025", - "desc": "Multiple top level headers in the same document", - "tags": [ "headers" ], - "func": function MD025(params, errors) { - var hasTopLevelHeading = false; - filterTokens(params, "heading_open", function forToken(token) { - if (token.tag === "h1") { - if (hasTopLevelHeading) { - errors.push(token.lineNumber); - } else if (token.lineNumber === 1) { - hasTopLevelHeading = true; - } - } - }); - } - }, - - { - "name": "MD026", - "desc": "Trailing punctuation in header", - "tags": [ "headers" ], - "func": function MD026(params, errors) { - var punctuation = params.options.punctuation || ".,;:!?"; - var re = new RegExp("[" + punctuation + "]$"); - forEachHeading(params, function forHeading(heading, content) { - if (re.test(content)) { - errors.push(heading.lineNumber); - } - }); - } - }, - - { - "name": "MD027", - "desc": "Multiple spaces after blockquote symbol", - "tags": [ "blockquote", "whitespace", "indentation" ], - "func": function MD027(params, errors) { - var inBlockquote = false; - params.tokens.forEach(function forToken(token) { - if (token.type === "blockquote_open") { - inBlockquote = true; - } else if (token.type === "blockquote_close") { - inBlockquote = false; - } else if ((token.type === "inline") && inBlockquote) { - token.content.split(shared.newLineRe) - .forEach(function forLine(line, offset) { - if (/^\s/.test(line) || - (!offset && /^\s*>\s\s/.test(token.line))) { - errors.push(token.lineNumber + offset); - } - }); - } - }); - } - }, - - { - "name": "MD028", - "desc": "Blank line inside blockquote", - "tags": [ "blockquote", "whitespace" ], - "func": function MD028(params, errors) { - var prevToken = {}; - params.tokens.forEach(function forToken(token) { - if ((token.type === "blockquote_open") && - (prevToken.type === "blockquote_close")) { - errors.push(token.lineNumber - 1); - } - prevToken = token; - }); - } - }, - - { - "name": "MD029", - "desc": "Ordered list item prefix", - "tags": [ "ol" ], - "func": function MD029(params, errors) { - var style = params.options.style || "one"; - flattenLists(params).forEach(function forList(list) { - if (list.ordered) { - var number = 1; - list.items.forEach(function forItem(item) { - var re = new RegExp("^\\s*" + String(number) + "\\."); - if (!re.test(item.line)) { - errors.push(item.lineNumber); - } - if (style === "ordered") { - number++; - } - }); - } - }); - } - }, - - { - "name": "MD030", - "desc": "Spaces after list markers", - "tags": [ "ol", "ul", "whitespace" ], - "func": function MD030(params, errors) { - var ulSingle = params.options.ul_single || 1; - var olSingle = params.options.ol_single || 1; - var ulMulti = params.options.ul_multi || 1; - var olMulti = params.options.ol_multi || 1; - flattenLists(params).forEach(function forList(list) { - var lineCount = list.lastLineIndex - list.open.map[0]; - var allSingle = lineCount === list.items.length; - var expectedSpaces = list.ordered ? - (allSingle ? olSingle : olMulti) : - (allSingle ? ulSingle : ulMulti); - list.items.forEach(function forItem(item) { - var match = /^\s*\S+(\s+)/.exec(item.line); - if (!match || (match[1].length !== expectedSpaces)) { - errors.push(item.lineNumber); - } - }); - }); - } - }, - - { - "name": "MD031", - "desc": "Fenced code blocks should be surrounded by blank lines", - "tags": [ "code", "blank_lines" ], - "func": function MD031(params, errors) { - var lines = params.lines; - forEachLine(params, function forLine(line, i, inCode, onFence) { - if (((onFence > 0) && (i - 1 >= 0) && lines[i - 1].length) || - ((onFence < 0) && (i + 1 < lines.length) && lines[i + 1].length)) { - errors.push(i + 1); - } - }); - } - }, - - { - "name": "MD032", - "desc": "Lists should be surrounded by blank lines", - "tags": [ "bullet", "ul", "ol", "blank_lines" ], - "func": function MD032(params, errors) { - var inList = false; - var prevLine = ""; - forEachLine(params, function forLine(line, lineIndex, inCode, onFence) { - if (!inCode || onFence) { - var listMarker = /^([\*\+\-]|(\d+\.))\s/.test(line.trim()); - if (listMarker && !inList && !/^($|\s)/.test(prevLine)) { - errors.push(lineIndex + 1); - } else if (!listMarker && inList && !/^($|\s)/.test(line)) { - errors.push(lineIndex); - } - inList = listMarker; - } - prevLine = line; - }); - } - }, - - { - "name": "MD033", - "desc": "Inline HTML", - "tags": [ "html" ], - "func": function MD033(params, errors) { - filterTokens(params, "html_block", function forToken(token) { - errors.push(token.lineNumber); - }); - forEachInlineChild(params, "html_inline", function forToken(token) { - errors.push(token.lineNumber); - }); - } - }, - - { - "name": "MD034", - "desc": "Bare URL used", - "tags": [ "links", "url" ], - "func": function MD034(params, errors) { - filterTokens(params, "inline", function forToken(token) { - var inLink = false; - token.children.forEach(function forChild(child) { - if (child.type === "link_open") { - inLink = true; - } else if (child.type === "link_close") { - inLink = false; - } else if ((child.type === "text") && - !inLink && - /https?:\/\//.test(child.content)) { - errors.push(child.lineNumber); - } - }); - }); - } - }, - - { - "name": "MD035", - "desc": "Horizontal rule style", - "tags": [ "hr" ], - "func": function MD035(params, errors) { - var style = params.options.style || "consistent"; - filterTokens(params, "hr", function forToken(token) { - if (style === "consistent") { - style = token.line; - } - if (token.line !== style) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD036", - "desc": "Emphasis used instead of a header", - "tags": [ "headers", "emphasis" ], - "func": function MD036(params, errors) { - function base(token) { - if (token.type === "paragraph_open") { - return function inParagraph(t) { - if ((t.type === "inline") && - (t.children.length === 3) && - ((t.children[0].type === "strong_open") || - (t.children[0].type === "em_open")) && - (t.children[1].type === "text")) { - errors.push(t.lineNumber); - } - }; - } else if (token.type === "blockquote_open") { - return function inBlockquote(t) { - if (t.type !== "blockquote_close") { - return inBlockquote; - } - }; - } - } - var state = base; - params.tokens.forEach(function forToken(token) { - state = state(token) || base; - }); - } - }, - - { - "name": "MD037", - "desc": "Spaces inside emphasis markers", - "tags": [ "whitespace", "emphasis" ], - "func": function MD037(params, errors) { - forEachInlineChild(params, "text", function forToken(token) { - if (/\s(\*\*?|__?)\s.+\1/.test(token.content) || - /(\*\*?|__?).+\s\1\s/.test(token.content)) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD038", - "desc": "Spaces inside code span elements", - "tags": [ "whitespace", "code" ], - "func": function MD038(params, errors) { - forEachInlineChild(params, "code_inline", - function forToken(token, inline) { - if (inline.content.indexOf("`" + token.content + "`") === -1) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD039", - "desc": "Spaces inside link text", - "tags": [ "whitespace", "links" ], - "func": function MD039(params, errors) { - filterTokens(params, "inline", function forToken(token) { - var inLink = false; - var index = 0; - var lastChildRightSpaceLineNumber = 0; - token.children.forEach(function forChild(child) { - if (child.type === "link_open") { - inLink = true; - index = 0; - } else if (child.type === "link_close") { - inLink = false; - if (lastChildRightSpaceLineNumber) { - errors.push(lastChildRightSpaceLineNumber); - } - } else if (inLink) { - if ((index === 0) && - (child.content.trimLeft().length !== child.content.length)) { - errors.push(child.lineNumber); - } - lastChildRightSpaceLineNumber = - (child.content.trimRight().length !== child.content.length) ? - child.lineNumber : 0; - index++; - } - }); - }); - } - }, - - { - "name": "MD040", - "desc": "Fenced code blocks should have a language specified", - "tags": [ "code", "language" ], - "func": function MD040(params, errors) { - filterTokens(params, "fence", function forToken(token) { - if (!token.info.trim()) { - errors.push(token.lineNumber); - } - }); - } - }, - - { - "name": "MD041", - "desc": "First line in file should be a top level header", - "tags": [ "headers" ], - "func": function MD041(params, errors) { - var firstHeader = null; - params.tokens.every(function forToken(token) { - if (token.type === "heading_open") { - firstHeader = token; - return false; - } else if (token.lineNumber > 1) { - return false; - } - return true; - }); - if (!firstHeader || - (firstHeader.lineNumber !== 1) || - (firstHeader.tag !== "h1")) { - errors.push(1); - } - } - } -]; diff --git a/lib/rules.mjs b/lib/rules.mjs new file mode 100644 index 00000000..18148a41 --- /dev/null +++ b/lib/rules.mjs @@ -0,0 +1,122 @@ +// @ts-check + +import { homepage, version } from "./constants.mjs"; + +import md001 from "./md001.mjs"; +import md003 from "./md003.mjs"; +import md004 from "./md004.mjs"; +import md005 from "./md005.mjs"; +import md007 from "./md007.mjs"; +import md009 from "./md009.mjs"; +import md010 from "./md010.mjs"; +import md011 from "./md011.mjs"; +import md012 from "./md012.mjs"; +import md013 from "./md013.mjs"; +import md014 from "./md014.mjs"; +import md018 from "./md018.mjs"; +import md019md021 from "./md019-md021.mjs"; +const [ md019, md021 ] = md019md021; +import md020 from "./md020.mjs"; +import md022 from "./md022.mjs"; +import md023 from "./md023.mjs"; +import md024 from "./md024.mjs"; +import md025 from "./md025.mjs"; +import md026 from "./md026.mjs"; +import md027 from "./md027.mjs"; +import md028 from "./md028.mjs"; +import md029 from "./md029.mjs"; +import md030 from "./md030.mjs"; +import md031 from "./md031.mjs"; +import md032 from "./md032.mjs"; +import md033 from "./md033.mjs"; +import md034 from "./md034.mjs"; +import md035 from "./md035.mjs"; +import md036 from "./md036.mjs"; +import md037 from "./md037.mjs"; +import md038 from "./md038.mjs"; +import md039 from "./md039.mjs"; +import md040 from "./md040.mjs"; +import md041 from "./md041.mjs"; +import md042 from "./md042.mjs"; +import md043 from "./md043.mjs"; +import md044 from "./md044.mjs"; +import md045 from "./md045.mjs"; +import md046 from "./md046.mjs"; +import md047 from "./md047.mjs"; +import md048 from "./md048.mjs"; +import md049md050 from "./md049-md050.mjs"; +const [ md049, md050 ] = md049md050; +import md051 from "./md051.mjs"; +import md052 from "./md052.mjs"; +import md053 from "./md053.mjs"; +import md054 from "./md054.mjs"; +import md055 from "./md055.mjs"; +import md056 from "./md056.mjs"; +import md058 from "./md058.mjs"; +import md059 from "./md059.mjs"; +import md060 from "./md060.mjs"; + +const rules = [ + md001, + // md002: Deprecated and removed + md003, + md004, + md005, + // md006: Deprecated and removed + md007, + md009, + md010, + md011, + md012, + md013, + md014, + md018, + md019, + md020, + md021, + md022, + md023, + md024, + md025, + md026, + md027, + md028, + md029, + md030, + md031, + md032, + md033, + md034, + md035, + md036, + md037, + md038, + md039, + md040, + md041, + md042, + md043, + md044, + md045, + md046, + md047, + md048, + md049, + md050, + md051, + md052, + md053, + md054, + md055, + md056, + // md057: See https://github.com/markdownlint/markdownlint + md058, + md059, + md060 +]; +for (const rule of rules) { + const name = rule.names[0].toLowerCase(); + // eslint-disable-next-line dot-notation + rule["information"] = new URL(`${homepage}/blob/v${version}/doc/${name}.md`); +} +export default rules; diff --git a/lib/shared.js b/lib/shared.js deleted file mode 100644 index 718e8159..00000000 --- a/lib/shared.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -// Regular expression for matching common newline characters -module.exports.newLineRe = /\r\n|\r|\n/; - -// Regular expression for matching common front matter -module.exports.frontMatterRe = /^---$[^]*?^---$(\r\n|\r|\n)/m; - -// readFile options for reading with the UTF-8 encoding -module.exports.utf8Encoding = { "encoding": "utf8" }; diff --git a/lib/types.d.mts b/lib/types.d.mts new file mode 100644 index 00000000..462a7d27 --- /dev/null +++ b/lib/types.d.mts @@ -0,0 +1,13 @@ +export {}; +declare module "markdownlint" { + export * from "./exports.mjs"; +} +declare module "markdownlint/async" { + export * from "./exports-async.mjs"; +} +declare module "markdownlint/promise" { + export * from "./exports-promise.mjs"; +} +declare module "markdownlint/sync" { + export * from "./exports-sync.mjs"; +} diff --git a/package.json b/package.json index 2b08213b..c6195bd9 100644 --- a/package.json +++ b/package.json @@ -1,47 +1,123 @@ { "name": "markdownlint", - "version": "0.0.7", - "description": "A Node.js style checker and lint tool for Markdown files.", - "main": "lib/markdownlint.js", - "author": "David Anson (http://dlaa.me/)", + "version": "0.40.0", + "description": "A Node.js style checker and lint tool for Markdown/CommonMark files.", + "type": "module", + "exports": { + ".": "./lib/exports.mjs", + "./async": "./lib/exports-async.mjs", + "./promise": "./lib/exports-promise.mjs", + "./sync": "./lib/exports-sync.mjs", + "./helpers": "./helpers/helpers.cjs", + "./style/all": "./style/all.json", + "./style/cirosantilli": "./style/cirosantilli.json", + "./style/prettier": "./style/prettier.json", + "./style/relaxed": "./style/relaxed.json" + }, + "imports": { + "#node-imports": { + "markdownlint-imports-browser": "./lib/node-imports-browser.mjs", + "markdownlint-imports-node": "./lib/node-imports-node.mjs", + "browser": "./lib/node-imports-browser.mjs", + "default": "./lib/node-imports-node.mjs" + } + }, + "types": "./lib/types.d.mts", + "author": "David Anson (https://dlaa.me/)", "license": "MIT", "homepage": "https://github.com/DavidAnson/markdownlint", "repository": { "type": "git", - "url": "https://github.com/DavidAnson/markdownlint.git" + "url": "git+https://github.com/DavidAnson/markdownlint.git" }, "bugs": "https://github.com/DavidAnson/markdownlint/issues", + "funding": "https://github.com/sponsors/DavidAnson", "scripts": { - "test": "nodeunit", - "test-cover": "istanbul cover node_modules/nodeunit/bin/nodeunit", - "debug": "node debug node_modules/nodeunit/bin/nodeunit", - "lint": "eslint lib test && eslint --env browser --global markdownit --global markdownlint --rule \"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0\" demo && eslint --rule \"no-console: 0, no-shadow: 0\" example", - "build-demo": "cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && cpy file-header.js . --rename=markdownlint-browser.js && browserify browser-polyfills.js ../lib/markdownlint.js --standalone markdownlint >> markdownlint-browser.js && uglifyjs markdownlint-browser.js --compress --mangle --comments --output markdownlint-browser.min.js", - "example": "npm install through2 && cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint" + "build-config": "npm run build-config-schema && npm run build-config-example", + "build-config-example": "node schema/build-config-example.mjs", + "build-config-schema": "node schema/build-config-schema.mjs", + "build-declaration": "tsc --allowJs --checkJs --declaration --emitDeclarationOnly --module nodenext --outDir dts --rootDir . --target es2015 lib/exports.mjs lib/exports-async.mjs lib/exports-promise.mjs lib/exports-sync.mjs lib/markdownlint.mjs lib/resolve-module.cjs && node scripts/index.mjs copy dts/lib/exports.d.mts lib/exports.d.mts && node scripts/index.mjs copy dts/lib/exports-async.d.mts lib/exports-async.d.mts && node scripts/index.mjs copy dts/lib/exports-promise.d.mts lib/exports-promise.d.mts && node scripts/index.mjs copy dts/lib/exports-sync.d.mts lib/exports-sync.d.mts && node scripts/index.mjs copy dts/lib/markdownlint.d.mts lib/markdownlint.d.mts && node scripts/index.mjs copy dts/lib/resolve-module.d.cts lib/resolve-module.d.cts && node scripts/index.mjs remove dts", + "build-demo": "node scripts/index.mjs copy node_modules/markdown-it/dist/markdown-it.min.js demo/markdown-it.min.js && cd demo && webpack --no-stats", + "build-docs": "node doc-build/build-rules.mjs", + "ci": "npm-run-all --continue-on-error --parallel build-demo lint serial-config-docs serial-declaration test-cover && git diff --exit-code", + "clone-test-repos-apache-airflow": "cd test-repos && git clone https://github.com/apache/airflow apache-airflow --depth 1 --no-tags --quiet", + "clone-test-repos-dotnet-docs": "cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet", + "clone-test-repos-electron-electron": "cd test-repos && git clone https://github.com/electron/electron electron-electron --depth 1 --no-tags --quiet && cd electron-electron && node ../../scripts/index.mjs delete package.json && npm install --no-save --ignore-scripts @electron/lint-roller", + "clone-test-repos-eslint-eslint": "cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet", + "clone-test-repos-mdn-content": "cd test-repos && git clone https://github.com/mdn/content mdn-content --depth 1 --no-tags --quiet", + "clone-test-repos-mkdocs-mkdocs": "cd test-repos && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet", + "clone-test-repos-mochajs-mocha": "cd test-repos && git clone https://github.com/mochajs/mocha mochajs-mocha --depth 1 --no-tags --quiet", + "clone-test-repos-pi-hole-docs": "cd test-repos && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet", + "clone-test-repos-v8-v8-dev": "cd test-repos && git clone https://github.com/v8/v8.dev v8-v8-dev --depth 1 --no-tags --quiet", + "clone-test-repos-webhintio-hint": "cd test-repos && git clone https://github.com/webhintio/hint webhintio-hint --depth 1 --no-tags --quiet", + "clone-test-repos-webpack-webpack-js-org": "cd test-repos && git clone https://github.com/webpack/webpack.js.org webpack-webpack-js-org --depth 1 --no-tags --quiet", + "clone-test-repos": "mkdir test-repos && cd test-repos && npm run clone-test-repos-apache-airflow && npm run clone-test-repos-dotnet-docs && npm run clone-test-repos-electron-electron && npm run clone-test-repos-eslint-eslint && npm run clone-test-repos-mdn-content && npm run clone-test-repos-mkdocs-mkdocs && npm run clone-test-repos-mochajs-mocha && npm run clone-test-repos-pi-hole-docs && npm run clone-test-repos-v8-v8-dev && npm run clone-test-repos-webhintio-hint && npm run clone-test-repos-webpack-webpack-js-org", + "declaration": "npm run build-declaration && npm run test-declaration", + "example": "cd example && node standalone.mjs", + "lint": "eslint --max-warnings 0", + "lint-test-repos": "ava --timeout=10m test/markdownlint-test-repos-*.mjs", + "serial-config-docs": "npm run build-config && npm run build-docs", + "serial-declaration": "npm run build-declaration && npm run test-declaration", + "test": "ava --timeout=30s test/markdownlint-test.mjs test/markdownlint-test-config.mjs test/markdownlint-test-custom-rules.mjs test/markdownlint-test-exports.mjs test/markdownlint-test-fixes.mjs test/markdownlint-test-helpers.mjs test/markdownlint-test-micromark.mjs test/markdownlint-test-project.mjs test/markdownlint-test-result-object.mjs test/markdownlint-test-scenarios.mjs test/parse-configuration-test.mjs test/resolve-module-test.mjs helpers/test.cjs", + "test-cover": "c8 --100 npm test", + "test-declaration": "npm-run-all --continue-on-error --parallel test-declaration-cts test-declaration-mts", + "test-declaration-cts": "cd example/typescript && node ../../scripts/index.mjs copy type-check.ts type-check-commonjs.cts && tsc --module commonjs --esModuleInterop type-check-commonjs.cts", + "test-declaration-mts": "cd example/typescript && node ../../scripts/index.mjs copy type-check.ts type-check-nodenext.mts && tsc --module nodenext type-check-nodenext.mts && node type-check-nodenext.mjs", + "test-extra": "ava --timeout=10m test/markdownlint-test-extra-parse.mjs test/markdownlint-test-extra-type.mjs", + "update-snapshots": "ava --update-snapshots test/markdownlint-test-custom-rules.mjs test/markdownlint-test-exports.mjs test/markdownlint-test-micromark.mjs test/markdownlint-test-scenarios.mjs", + "update-snapshots-test-repos": "ava --timeout=10m --update-snapshots test/markdownlint-test-repos-*.mjs", + "update-test-repos": "node scripts/index.mjs remove ./test-repos && npm run clone-test-repos && npm run update-snapshots-test-repos", + "upgrade": "npx --yes npm-check-updates --upgrade" + }, + "engines": { + "node": ">=20" }, "dependencies": { - "markdown-it": "^4.4.0" + "micromark": "4.0.2", + "micromark-core-commonmark": "2.0.3", + "micromark-extension-directive": "4.0.0", + "micromark-extension-gfm-autolink-literal": "2.1.0", + "micromark-extension-gfm-footnote": "2.1.0", + "micromark-extension-gfm-table": "2.1.1", + "micromark-extension-math": "3.1.0", + "micromark-util-types": "2.0.2", + "string-width": "8.1.0" }, "devDependencies": { - "browserify": "^11.0.1", - "cpy": "^3.4.0", - "eslint": "^0.24.1", - "istanbul": "^0.3.17", - "lodash.assign": "^3.2.0", - "lodash.clone": "^3.0.2", - "nodeunit": "^0.9.1", - "q": "^1.4.0", - "rimraf": "^2.4.2", - "uglify-js": "^2.4.24" + "@eslint/js": "9.39.1", + "@stylistic/eslint-plugin": "5.6.1", + "ajv": "8.17.1", + "ava": "6.4.1", + "c8": "10.1.3", + "character-entities": "2.0.2", + "eslint": "9.39.1", + "eslint-plugin-jsdoc": "61.4.1", + "eslint-plugin-n": "17.23.1", + "eslint-plugin-regexp": "2.10.0", + "eslint-plugin-unicorn": "62.0.0", + "gemoji": "8.1.0", + "globby": "16.0.0", + "js-yaml": "4.1.1", + "json-schema-to-typescript": "15.0.4", + "jsonc-parser": "3.3.1", + "markdown-it": "14.1.0", + "markdown-it-for-inline": "2.0.1", + "markdown-it-sub": "2.0.0", + "markdown-it-sup": "2.0.0", + "markdownlint-rule-extended-ascii": "0.2.1", + "nano-spawn": "2.0.0", + "npm-run-all": "4.1.5", + "terser-webpack-plugin": "5.3.14", + "toml": "3.0.0", + "typescript": "5.9.3", + "webpack": "5.103.0", + "webpack-cli": "6.0.1" }, "keywords": [ "markdown", "lint", "md", - "check", - "validate" - ], - "browser": { - "markdown-it": "./demo/markdown-it-stub.js" - } + "CommonMark", + "markdownlint" + ] } diff --git a/schema/.markdownlint.jsonc b/schema/.markdownlint.jsonc new file mode 100644 index 00000000..c4fe6661 --- /dev/null +++ b/schema/.markdownlint.jsonc @@ -0,0 +1,347 @@ +// Example markdownlint configuration with all properties set to their default value +{ + + // Default state for all rules + "default": true, + + // Path to configuration file to extend + "extends": null, + + // MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md + "MD001": { + // RegExp for matching title in front matter + "front_matter_title": "^\\s*title\\s*[:=]" + }, + + // MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md + "MD003": { + // Heading style + "style": "consistent" + }, + + // MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md + "MD004": { + // List style + "style": "consistent" + }, + + // MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md + "MD005": true, + + // MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md + "MD007": { + // Spaces for indent + "indent": 2, + // Whether to indent the first level of the list + "start_indented": false, + // Spaces for first level indent (when start_indented is set) + "start_indent": 2 + }, + + // MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md + "MD009": { + // Spaces for line break + "br_spaces": 2, + // Include code blocks + "code_blocks": false, + // Allow spaces for empty lines in list items + "list_item_empty_lines": false, + // Include unnecessary breaks + "strict": false + }, + + // MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md + "MD010": { + // Include code blocks + "code_blocks": true, + // Fenced code languages to ignore + "ignore_code_languages": [], + // Number of spaces for each hard tab + "spaces_per_tab": 1 + }, + + // MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md + "MD011": true, + + // MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md + "MD012": { + // Consecutive blank lines + "maximum": 1 + }, + + // MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md + "MD013": { + // Number of characters + "line_length": 80, + // Number of characters for headings + "heading_line_length": 80, + // Number of characters for code blocks + "code_block_line_length": 80, + // Include code blocks + "code_blocks": true, + // Include tables + "tables": true, + // Include headings + "headings": true, + // Strict length checking + "strict": false, + // Stern length checking + "stern": false + }, + + // MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md + "MD014": true, + + // MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md + "MD018": true, + + // MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md + "MD019": true, + + // MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md + "MD020": true, + + // MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md + "MD021": true, + + // MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md + "MD022": { + // Blank lines above heading + "lines_above": 1, + // Blank lines below heading + "lines_below": 1 + }, + + // MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md + "MD023": true, + + // MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md + "MD024": { + // Only check sibling headings + "siblings_only": false + }, + + // MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md + "MD025": { + // RegExp for matching title in front matter + "front_matter_title": "^\\s*title\\s*[:=]", + // Heading level + "level": 1 + }, + + // MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md + "MD026": { + // Punctuation characters + "punctuation": ".,;:!。,;:!" + }, + + // MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md + "MD027": { + // Include list items + "list_items": true + }, + + // MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md + "MD028": true, + + // MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md + "MD029": { + // List style + "style": "one_or_ordered" + }, + + // MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md + "MD030": { + // Spaces for single-line unordered list items + "ul_single": 1, + // Spaces for single-line ordered list items + "ol_single": 1, + // Spaces for multi-line unordered list items + "ul_multi": 1, + // Spaces for multi-line ordered list items + "ol_multi": 1 + }, + + // MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md + "MD031": { + // Include list items + "list_items": true + }, + + // MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md + "MD032": true, + + // MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md + "MD033": { + // Allowed elements + "allowed_elements": [], + // Allowed elements in tables + "table_allowed_elements": [] + }, + + // MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md + "MD034": true, + + // MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md + "MD035": { + // Horizontal rule style + "style": "consistent" + }, + + // MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md + "MD036": { + // Punctuation characters + "punctuation": ".,;:!?。,;:!?" + }, + + // MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md + "MD037": true, + + // MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md + "MD038": true, + + // MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md + "MD039": true, + + // MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md + "MD040": { + // List of languages + "allowed_languages": [], + // Require language only + "language_only": false + }, + + // MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md + "MD041": { + // Allow content before first heading + "allow_preamble": false, + // RegExp for matching title in front matter + "front_matter_title": "^\\s*title\\s*[:=]", + // Heading level + "level": 1 + }, + + // MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md + "MD042": true, + + // MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md + "MD043": { + // List of headings + "headings": [], + // Match case of headings + "match_case": false + }, + + // MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md + "MD044": { + // List of proper names + "names": [], + // Include code blocks + "code_blocks": true, + // Include HTML elements + "html_elements": true + }, + + // MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md + "MD045": true, + + // MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md + "MD046": { + // Block style + "style": "consistent" + }, + + // MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md + "MD047": true, + + // MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md + "MD048": { + // Code fence style + "style": "consistent" + }, + + // MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md + "MD049": { + // Emphasis style + "style": "consistent" + }, + + // MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md + "MD050": { + // Strong style + "style": "consistent" + }, + + // MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md + "MD051": { + // Ignore case of fragments + "ignore_case": false, + // Pattern for ignoring additional fragments + "ignored_pattern": "" + }, + + // MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md + "MD052": { + // Ignored link labels + "ignored_labels": [ + "x" + ], + // Include shortcut syntax + "shortcut_syntax": false + }, + + // MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md + "MD053": { + // Ignored definitions + "ignored_definitions": [ + "//" + ] + }, + + // MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md + "MD054": { + // Allow autolinks + "autolink": true, + // Allow inline links and images + "inline": true, + // Allow full reference links and images + "full": true, + // Allow collapsed reference links and images + "collapsed": true, + // Allow shortcut reference links and images + "shortcut": true, + // Allow URLs as inline links + "url_inline": true + }, + + // MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md + "MD055": { + // Table pipe style + "style": "consistent" + }, + + // MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md + "MD056": true, + + // MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md + "MD058": true, + + // MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md + "MD059": { + // Prohibited link texts + "prohibited_texts": [ + "click here", + "here", + "link", + "more" + ] + }, + + // MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md + "MD060": { + // Table column style + "style": "any", + // Aligned delimiter columns + "aligned_delimiter": false + } +} \ No newline at end of file diff --git a/schema/.markdownlint.yaml b/schema/.markdownlint.yaml new file mode 100644 index 00000000..fe3b6e57 --- /dev/null +++ b/schema/.markdownlint.yaml @@ -0,0 +1,308 @@ +# Example markdownlint configuration with all properties set to their default value + +# Default state for all rules +default: true + +# Path to configuration file to extend +extends: null + +# MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md +MD001: + # RegExp for matching title in front matter + front_matter_title: "^\\s*title\\s*[:=]" + +# MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md +MD003: + # Heading style + style: "consistent" + +# MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md +MD004: + # List style + style: "consistent" + +# MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md +MD005: true + +# MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md +MD007: + # Spaces for indent + indent: 2 + # Whether to indent the first level of the list + start_indented: false + # Spaces for first level indent (when start_indented is set) + start_indent: 2 + +# MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md +MD009: + # Spaces for line break + br_spaces: 2 + # Include code blocks + code_blocks: false + # Allow spaces for empty lines in list items + list_item_empty_lines: false + # Include unnecessary breaks + strict: false + +# MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md +MD010: + # Include code blocks + code_blocks: true + # Fenced code languages to ignore + ignore_code_languages: [] + # Number of spaces for each hard tab + spaces_per_tab: 1 + +# MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md +MD011: true + +# MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md +MD012: + # Consecutive blank lines + maximum: 1 + +# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md +MD013: + # Number of characters + line_length: 80 + # Number of characters for headings + heading_line_length: 80 + # Number of characters for code blocks + code_block_line_length: 80 + # Include code blocks + code_blocks: true + # Include tables + tables: true + # Include headings + headings: true + # Strict length checking + strict: false + # Stern length checking + stern: false + +# MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md +MD014: true + +# MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md +MD018: true + +# MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md +MD019: true + +# MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md +MD020: true + +# MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md +MD021: true + +# MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md +MD022: + # Blank lines above heading + lines_above: 1 + # Blank lines below heading + lines_below: 1 + +# MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md +MD023: true + +# MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md +MD024: + # Only check sibling headings + siblings_only: false + +# MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md +MD025: + # RegExp for matching title in front matter + front_matter_title: "^\\s*title\\s*[:=]" + # Heading level + level: 1 + +# MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md +MD026: + # Punctuation characters + punctuation: ".,;:!。,;:!" + +# MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md +MD027: + # Include list items + list_items: true + +# MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md +MD028: true + +# MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md +MD029: + # List style + style: "one_or_ordered" + +# MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md +MD030: + # Spaces for single-line unordered list items + ul_single: 1 + # Spaces for single-line ordered list items + ol_single: 1 + # Spaces for multi-line unordered list items + ul_multi: 1 + # Spaces for multi-line ordered list items + ol_multi: 1 + +# MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md +MD031: + # Include list items + list_items: true + +# MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md +MD032: true + +# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md +MD033: + # Allowed elements + allowed_elements: [] + # Allowed elements in tables + table_allowed_elements: [] + +# MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md +MD034: true + +# MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md +MD035: + # Horizontal rule style + style: "consistent" + +# MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md +MD036: + # Punctuation characters + punctuation: ".,;:!?。,;:!?" + +# MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md +MD037: true + +# MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md +MD038: true + +# MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md +MD039: true + +# MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md +MD040: + # List of languages + allowed_languages: [] + # Require language only + language_only: false + +# MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md +MD041: + # Allow content before first heading + allow_preamble: false + # RegExp for matching title in front matter + front_matter_title: "^\\s*title\\s*[:=]" + # Heading level + level: 1 + +# MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md +MD042: true + +# MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md +MD043: + # List of headings + headings: [] + # Match case of headings + match_case: false + +# MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md +MD044: + # List of proper names + names: [] + # Include code blocks + code_blocks: true + # Include HTML elements + html_elements: true + +# MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md +MD045: true + +# MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md +MD046: + # Block style + style: "consistent" + +# MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md +MD047: true + +# MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md +MD048: + # Code fence style + style: "consistent" + +# MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md +MD049: + # Emphasis style + style: "consistent" + +# MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md +MD050: + # Strong style + style: "consistent" + +# MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md +MD051: + # Ignore case of fragments + ignore_case: false + # Pattern for ignoring additional fragments + ignored_pattern: "" + +# MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md +MD052: + # Ignored link labels + ignored_labels: + - "x" + # Include shortcut syntax + shortcut_syntax: false + +# MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md +MD053: + # Ignored definitions + ignored_definitions: + - "//" + +# MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md +MD054: + # Allow autolinks + autolink: true + # Allow inline links and images + inline: true + # Allow full reference links and images + full: true + # Allow collapsed reference links and images + collapsed: true + # Allow shortcut reference links and images + shortcut: true + # Allow URLs as inline links + url_inline: true + +# MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md +MD055: + # Table pipe style + style: "consistent" + +# MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md +MD056: true + +# MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md +MD058: true + +# MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md +MD059: + # Prohibited link texts + prohibited_texts: + - "click here" + - "here" + - "link" + - "more" + +# MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md +MD060: + # Table column style + style: "any" + # Aligned delimiter columns + aligned_delimiter: false diff --git a/schema/ValidatingConfiguration.md b/schema/ValidatingConfiguration.md new file mode 100644 index 00000000..5d842c49 --- /dev/null +++ b/schema/ValidatingConfiguration.md @@ -0,0 +1,26 @@ +# Validating Configuration + +A [JSON Schema][json-schema] is provided to enable validating configuration +objects: [`markdownlint-config-schema.json`][markdownlint-config-schema]. + +Some editors automatically use a JSON Schema with files that reference it. For +example, a `.markdownlint.json` file with: + +```json +"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json" +``` + +A JSON Schema validator can be used to check configuration files like so: + +```bash +npx ajv-cli validate -s ./markdownlint/schema/markdownlint-config-schema.json -d "**/.markdownlint.{json,yaml}" --strict=false +``` + +By default, any rule name is valid because of custom rules. To allow only +built-in rules, use the +[`markdownlint-config-schema-strict.json`][markdownlint-config-schema-strict] +JSON Schema instead. + +[json-schema]: https://json-schema.org +[markdownlint-config-schema]: markdownlint-config-schema.json +[markdownlint-config-schema-strict]: markdownlint-config-schema-strict.json diff --git a/schema/build-config-example.mjs b/schema/build-config-example.mjs new file mode 100644 index 00000000..6f9334c4 --- /dev/null +++ b/schema/build-config-example.mjs @@ -0,0 +1,69 @@ +// @ts-check + +import fs from "node:fs/promises"; +import path from "node:path"; +import yaml from "js-yaml"; +import { __dirname, importWithTypeJson } from "../test/esm-helpers.mjs"; +const configSchema = await importWithTypeJson(import.meta, "../schema/markdownlint-config-schema.json"); + +/** @type {import("markdownlint").Configuration} */ +const configExample = {}; +for (const rule in configSchema.properties) { + if (/^(?:MD\d{3}|default|extends)$/.test(rule)) { + const properties = configSchema.properties[rule]; + configExample[rule + "-description"] = properties.description; + configExample[rule] = properties.default; + const subproperties = Object.fromEntries( + Object.entries( + properties.oneOf?.at(-1).properties || [] + ).filter(([ key ]) => ((key !== "enabled") && (key !== "severity"))) + ); + if (Object.keys(subproperties).length > 0) { + /** @type {import("markdownlint").Configuration} */ + const ruleExample = {}; + // eslint-disable-next-line guard-for-in + for (const property in subproperties) { + const ruleProperties = subproperties[property]; + ruleExample[property + "-sub-description"] = ruleProperties.description; + ruleExample[property] = ruleProperties.default; + } + configExample[rule] = ruleExample; + } + } +} + +/** + * Transforms comments to use the specified prefix. + * + * @param {string} input Markdown input. + * @param {string} commentPrefix Comment prefix. + * @returns {string} Transformed input. + */ +const transformComments = (input, commentPrefix) => ( + commentPrefix + + " Example markdownlint configuration with all properties set to their default value\n" + + input + .replace(/^(\s*)[^-\s]+-sub-description"?: "?([^"\n]+)"?,?$/gm, "$1" + commentPrefix + " $2") + .replace(/^(\s*)[^-\s]+-description"?: "?([^"\n]+)"?,?$/gm, "\n$1" + commentPrefix + " $2") +); + +const configStringJson = JSON.stringify(configExample, null, 2); +await fs.writeFile( + path.join(__dirname(import.meta), ".markdownlint.jsonc"), + transformComments(configStringJson, "//"), + "utf8" +); + +const configStringYaml = yaml.dump( + configExample, + { + "forceQuotes": true, + "lineWidth": -1, + "quotingType": "\"" + } +); +await fs.writeFile( + path.join(__dirname(import.meta), ".markdownlint.yaml"), + transformComments(configStringYaml, "#"), + "utf8" +); diff --git a/schema/build-config-schema.mjs b/schema/build-config-schema.mjs new file mode 100644 index 00000000..0c44c872 --- /dev/null +++ b/schema/build-config-schema.mjs @@ -0,0 +1,702 @@ +// @ts-check + +import fs from "node:fs/promises"; +import path from "node:path"; +/** @type {import("markdownlint").Rule[]} */ +import rules from "../lib/rules.mjs"; +import jsonSchemaToTypeScript from "json-schema-to-typescript"; +import { version } from "../lib/constants.mjs"; +import { __dirname } from "../test/esm-helpers.mjs"; + +const schemaName = "markdownlint-config-schema.json"; +const schemaUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/${schemaName}`; +const schemaStrictName = "markdownlint-config-schema-strict.json"; +const schemaStrictUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/${schemaStrictName}`; + +// Schema scaffolding +const schema = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": schemaUri, + "title": "markdownlint configuration schema", + "type": "object", + /** @type {Object.} */ + "properties": { + "$schema": { + "description": "JSON Schema URI (expected by some editors)", + "type": "string", + "default": schemaUri + }, + "default": { + "description": "Default state for all rules", + "oneOf": [ + { "type": "boolean" }, + { "enum": [ "error", "warning" ] } + ], + "default": true + }, + "extends": { + "description": "Path to configuration file to extend", + "type": [ + "string", + "null" + ], + "default": null + } + }, + "additionalProperties": { + "type": [ + "boolean", + "object" + ] + } +}; +/** @type {Object.} */ +const tags = {}; + +// Add rules +for (const rule of rules) { + const ruleName = rule.names[0]; + for (const tag of rule.tags) { + const tagRules = tags[tag] || []; + tagRules.push(ruleName); + tags[tag] = tagRules; + } + const scheme = { + "description": + `${rule.names.join("/")} : ${rule.description} : ${rule.information}`, + "oneOf": [ + { "type": "boolean" }, + { "enum": [ "error", "warning" ] } + ], + "default": true + }; + const subscheme = { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ "error", "warning" ], + "default": "error" + } + } + }; + scheme.oneOf.push(subscheme); + /* eslint-disable camelcase */ + switch (ruleName) { + case "MD001": + // @ts-ignore + subscheme.properties.front_matter_title = { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }; + break; + case "MD003": + // @ts-ignore + subscheme.properties.style = { + "description": "Heading style", + "type": "string", + "enum": [ + "consistent", + "atx", + "atx_closed", + "setext", + "setext_with_atx", + "setext_with_atx_closed" + ], + "default": "consistent" + }; + break; + case "MD004": + // @ts-ignore + subscheme.properties.style = { + "description": "List style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "plus", + "dash", + "sublist" + ], + "default": "consistent" + }; + break; + case "MD007": + // @ts-ignore + subscheme.properties.indent = { + "description": "Spaces for indent", + "type": "integer", + "minimum": 1, + "default": 2 + }; + // @ts-ignore + subscheme.properties.start_indented = { + "description": "Whether to indent the first level of the list", + "type": "boolean", + "default": false + }; + // @ts-ignore + subscheme.properties.start_indent = { + "description": + "Spaces for first level indent (when start_indented is set)", + "type": "integer", + "minimum": 1, + "default": 2 + }; + break; + case "MD009": + // @ts-ignore + subscheme.properties.br_spaces = { + "description": "Spaces for line break", + "type": "integer", + "minimum": 0, + "default": 2 + }; + // @ts-ignore + subscheme.properties.code_blocks = { + "description": "Include code blocks", + "type": "boolean", + "default": false + }; + // @ts-ignore + subscheme.properties.list_item_empty_lines = { + "description": "Allow spaces for empty lines in list items", + "type": "boolean", + "default": false + }; + // @ts-ignore + subscheme.properties.strict = { + "description": "Include unnecessary breaks", + "type": "boolean", + "default": false + }; + break; + case "MD010": + // @ts-ignore + subscheme.properties.code_blocks = { + "description": "Include code blocks", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.ignore_code_languages = { + "description": "Fenced code languages to ignore", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }; + // @ts-ignore + subscheme.properties.spaces_per_tab = { + "description": "Number of spaces for each hard tab", + "type": "integer", + "minimum": 0, + "default": 1 + }; + break; + case "MD012": + // @ts-ignore + subscheme.properties.maximum = { + "description": "Consecutive blank lines", + "type": "integer", + "minimum": 1, + "default": 1 + }; + break; + case "MD013": + // @ts-ignore + subscheme.properties.line_length = { + "description": "Number of characters", + "type": "integer", + "minimum": 1, + "default": 80 + }; + // @ts-ignore + subscheme.properties.heading_line_length = { + "description": "Number of characters for headings", + "type": "integer", + "minimum": 1, + "default": 80 + }; + // @ts-ignore + subscheme.properties.code_block_line_length = { + "description": "Number of characters for code blocks", + "type": "integer", + "minimum": 1, + "default": 80 + }; + // @ts-ignore + subscheme.properties.code_blocks = { + "description": "Include code blocks", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.tables = { + "description": "Include tables", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.headings = { + "description": "Include headings", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.strict = { + "description": "Strict length checking", + "type": "boolean", + "default": false + }; + // @ts-ignore + subscheme.properties.stern = { + "description": "Stern length checking", + "type": "boolean", + "default": false + }; + break; + case "MD022": + // @ts-ignore + subscheme.properties.lines_above = { + "description": "Blank lines above heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }; + // @ts-ignore + subscheme.properties.lines_below = { + "description": "Blank lines below heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }; + break; + case "MD024": + // @ts-ignore + subscheme.properties.siblings_only = { + "description": "Only check sibling headings", + "type": "boolean", + "default": false + }; + break; + case "MD026": + case "MD036": + // @ts-ignore + subscheme.properties.punctuation = { + "description": "Punctuation characters", + "type": "string", + "default": (ruleName === "MD026") ? ".,;:!。,;:!" : ".,;:!?。,;:!?" + }; + break; + case "MD027": + // @ts-ignore + subscheme.properties.list_items = { + "description": "Include list items", + "type": "boolean", + "default": true + }; + break; + case "MD029": + // @ts-ignore + subscheme.properties.style = { + "description": "List style", + "type": "string", + "enum": [ + "one", + "ordered", + "one_or_ordered", + "zero" + ], + "default": "one_or_ordered" + }; + break; + case "MD030": + // @ts-ignore + subscheme.properties.ul_single = { + "description": "Spaces for single-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }; + // @ts-ignore + subscheme.properties.ol_single = { + "description": "Spaces for single-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }; + // @ts-ignore + subscheme.properties.ul_multi = { + "description": "Spaces for multi-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }; + // @ts-ignore + subscheme.properties.ol_multi = { + "description": "Spaces for multi-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }; + break; + case "MD031": + // @ts-ignore + subscheme.properties.list_items = { + "description": "Include list items", + "type": "boolean", + "default": true + }; + break; + case "MD033": + // @ts-ignore + subscheme.properties.allowed_elements = { + "description": "Allowed elements", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }; + // @ts-ignore + subscheme.properties.table_allowed_elements = { + "description": "Allowed elements in tables", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }; + break; + case "MD035": + // @ts-ignore + subscheme.properties.style = { + "description": "Horizontal rule style", + "type": "string", + "default": "consistent" + }; + break; + case "MD040": + // @ts-ignore + subscheme.properties.allowed_languages = { + "description": "List of languages", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }; + // @ts-ignore + subscheme.properties.language_only = { + "description": "Require language only", + "type": "boolean", + "default": false + }; + break; + case "MD025": + case "MD041": + if (ruleName === "MD041") { + // @ts-ignore + subscheme.properties.allow_preamble = { + "description": "Allow content before first heading", + "type": "boolean", + "default": false + }; + } + // @ts-ignore + subscheme.properties.front_matter_title = { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }; + // @ts-ignore + subscheme.properties.level = { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + }; + break; + case "MD043": + // @ts-ignore + subscheme.properties.headings = { + "description": "List of headings", + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\*|\\+|\\?|#{1,6}\\s+\\S.*)$" + }, + "default": [] + }; + // @ts-ignore + subscheme.properties.match_case = { + "description": "Match case of headings", + "type": "boolean", + "default": false + }; + break; + case "MD044": + // @ts-ignore + subscheme.properties.names = { + "description": "List of proper names", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }; + // @ts-ignore + subscheme.properties.code_blocks = { + "description": "Include code blocks", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.html_elements = { + "description": "Include HTML elements", + "type": "boolean", + "default": true + }; + break; + case "MD046": + // @ts-ignore + subscheme.properties.style = { + "description": "Block style", + "type": "string", + "enum": [ + "consistent", + "fenced", + "indented" + ], + "default": "consistent" + }; + break; + case "MD048": + // @ts-ignore + subscheme.properties.style = { + "description": "Code fence style", + "type": "string", + "enum": [ + "consistent", + "backtick", + "tilde" + ], + "default": "consistent" + }; + break; + case "MD049": + case "MD050": + // @ts-ignore + subscheme.properties.style = { + "description": (ruleName === "MD049") ? "Emphasis style" : "Strong style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + }; + break; + case "MD051": + // @ts-ignore + subscheme.properties.ignore_case = { + "description": "Ignore case of fragments", + "type": "boolean", + "default": false + }; + // @ts-ignore + subscheme.properties.ignored_pattern = { + "description": "Pattern for ignoring additional fragments", + "type": "string", + "default": "" + }; + break; + case "MD052": + // @ts-ignore + subscheme.properties.ignored_labels = { + "description": "Ignored link labels", + "type": "array", + "items": { + "type": "string" + }, + "default": [ "x" ] + }; + // @ts-ignore + subscheme.properties.shortcut_syntax = { + "description": "Include shortcut syntax", + "type": "boolean", + "default": false + }; + break; + case "MD053": + // @ts-ignore + subscheme.properties.ignored_definitions = { + "description": "Ignored definitions", + "type": "array", + "items": { + "type": "string" + }, + "default": [ "//" ] + }; + break; + case "MD054": + // @ts-ignore + subscheme.properties.autolink = { + "description": "Allow autolinks", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.inline = { + "description": "Allow inline links and images", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.full = { + "description": "Allow full reference links and images", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.collapsed = { + "description": "Allow collapsed reference links and images", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.shortcut = { + "description": "Allow shortcut reference links and images", + "type": "boolean", + "default": true + }; + // @ts-ignore + subscheme.properties.url_inline = { + "description": "Allow URLs as inline links", + "type": "boolean", + "default": true + }; + break; + case "MD055": + // @ts-ignore + subscheme.properties.style = { + "description": "Table pipe style", + "type": "string", + "enum": [ + "consistent", + "leading_only", + "trailing_only", + "leading_and_trailing", + "no_leading_or_trailing" + ], + "default": "consistent" + }; + break; + case "MD059": + // @ts-ignore + subscheme.properties.prohibited_texts = { + "description": "Prohibited link texts", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "click here", + "here", + "link", + "more" + ] + }; + break; + case "MD060": + // @ts-ignore + subscheme.properties.style = { + "description": "Table column style", + "type": "string", + "enum": [ + "any", + "aligned", + "compact", + "tight" + ], + "default": "any" + }; + // @ts-ignore + subscheme.properties.aligned_delimiter = { + "description": "Aligned delimiter columns", + "type": "boolean", + "default": false + }; + break; + default: + break; + } + /* eslint-enable camelcase */ + for (const name of rule.names) { + schema.properties[name] = scheme; + // Using $ref causes rule aliases not to get JSDoc comments + // schema.properties[name] = (index === 0) ? scheme : { + // "$ref": `#/properties/${firstName}` + // }; + } +} + +// Add tags +for (const [ tag, tagTags ] of Object.entries(tags)) { + const scheme = { + "description": `${tag} : ${tagTags.join(", ")}`, + "oneOf": [ + { "type": "boolean" }, + { "enum": [ "error", "warning" ] } + ], + "default": true + }; + schema.properties[tag] = scheme; +} + +// Write schema +const schemaFile = path.join(__dirname(import.meta), schemaName); +await fs.writeFile(schemaFile, JSON.stringify(schema, null, " ")); + +// Create and write strict schema +const schemaStrict = { + ...schema, + "$id": schemaStrictUri, + "additionalProperties": false +}; +const schemaFileStrict = path.join(__dirname(import.meta), schemaStrictName); +await fs.writeFile(schemaFileStrict, JSON.stringify(schemaStrict, null, " ")); + +// Write TypeScript declaration file +const declarationStrictName = path.join(__dirname(import.meta), "..", "lib", "configuration-strict.d.ts"); +schemaStrict.title = "ConfigurationStrict"; +const declaration = await jsonSchemaToTypeScript.compile( + // @ts-ignore + schemaStrict, + "UNUSED" +); +await fs.writeFile(declarationStrictName, declaration); diff --git a/schema/markdownlint-config-schema-strict.json b/schema/markdownlint-config-schema-strict.json new file mode 100644 index 00000000..d211feb6 --- /dev/null +++ b/schema/markdownlint-config-schema-strict.json @@ -0,0 +1,5128 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.40.0/schema/markdownlint-config-schema-strict.json", + "title": "markdownlint configuration schema", + "type": "object", + "properties": { + "$schema": { + "description": "JSON Schema URI (expected by some editors)", + "type": "string", + "default": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.40.0/schema/markdownlint-config-schema.json" + }, + "default": { + "description": "Default state for all rules", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "extends": { + "description": "Path to configuration file to extend", + "type": [ + "string", + "null" + ], + "default": null + }, + "MD001": { + "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + } + } + ], + "default": true + }, + "heading-increment": { + "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + } + } + ], + "default": true + }, + "MD003": { + "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Heading style", + "type": "string", + "enum": [ + "consistent", + "atx", + "atx_closed", + "setext", + "setext_with_atx", + "setext_with_atx_closed" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "heading-style": { + "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Heading style", + "type": "string", + "enum": [ + "consistent", + "atx", + "atx_closed", + "setext", + "setext_with_atx", + "setext_with_atx_closed" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD004": { + "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "plus", + "dash", + "sublist" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "ul-style": { + "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "plus", + "dash", + "sublist" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD005": { + "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "list-indent": { + "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD007": { + "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "indent": { + "description": "Spaces for indent", + "type": "integer", + "minimum": 1, + "default": 2 + }, + "start_indented": { + "description": "Whether to indent the first level of the list", + "type": "boolean", + "default": false + }, + "start_indent": { + "description": "Spaces for first level indent (when start_indented is set)", + "type": "integer", + "minimum": 1, + "default": 2 + } + } + } + ], + "default": true + }, + "ul-indent": { + "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "indent": { + "description": "Spaces for indent", + "type": "integer", + "minimum": 1, + "default": 2 + }, + "start_indented": { + "description": "Whether to indent the first level of the list", + "type": "boolean", + "default": false + }, + "start_indent": { + "description": "Spaces for first level indent (when start_indented is set)", + "type": "integer", + "minimum": 1, + "default": 2 + } + } + } + ], + "default": true + }, + "MD009": { + "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "br_spaces": { + "description": "Spaces for line break", + "type": "integer", + "minimum": 0, + "default": 2 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": false + }, + "list_item_empty_lines": { + "description": "Allow spaces for empty lines in list items", + "type": "boolean", + "default": false + }, + "strict": { + "description": "Include unnecessary breaks", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "no-trailing-spaces": { + "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "br_spaces": { + "description": "Spaces for line break", + "type": "integer", + "minimum": 0, + "default": 2 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": false + }, + "list_item_empty_lines": { + "description": "Allow spaces for empty lines in list items", + "type": "boolean", + "default": false + }, + "strict": { + "description": "Include unnecessary breaks", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD010": { + "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "ignore_code_languages": { + "description": "Fenced code languages to ignore", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "spaces_per_tab": { + "description": "Number of spaces for each hard tab", + "type": "integer", + "minimum": 0, + "default": 1 + } + } + } + ], + "default": true + }, + "no-hard-tabs": { + "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "ignore_code_languages": { + "description": "Fenced code languages to ignore", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "spaces_per_tab": { + "description": "Number of spaces for each hard tab", + "type": "integer", + "minimum": 0, + "default": 1 + } + } + } + ], + "default": true + }, + "MD011": { + "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-reversed-links": { + "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD012": { + "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "maximum": { + "description": "Consecutive blank lines", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "no-multiple-blanks": { + "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "maximum": { + "description": "Consecutive blank lines", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "MD013": { + "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "line_length": { + "description": "Number of characters", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "heading_line_length": { + "description": "Number of characters for headings", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_block_line_length": { + "description": "Number of characters for code blocks", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "tables": { + "description": "Include tables", + "type": "boolean", + "default": true + }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, + "strict": { + "description": "Strict length checking", + "type": "boolean", + "default": false + }, + "stern": { + "description": "Stern length checking", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "line-length": { + "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "line_length": { + "description": "Number of characters", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "heading_line_length": { + "description": "Number of characters for headings", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_block_line_length": { + "description": "Number of characters for code blocks", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "tables": { + "description": "Include tables", + "type": "boolean", + "default": true + }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, + "strict": { + "description": "Strict length checking", + "type": "boolean", + "default": false + }, + "stern": { + "description": "Stern length checking", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD014": { + "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "commands-show-output": { + "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD018": { + "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-missing-space-atx": { + "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD019": { + "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-multiple-space-atx": { + "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD020": { + "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-missing-space-closed-atx": { + "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD021": { + "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-multiple-space-closed-atx": { + "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD022": { + "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "lines_above": { + "description": "Blank lines above heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }, + "lines_below": { + "description": "Blank lines below heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + } + } + } + ], + "default": true + }, + "blanks-around-headings": { + "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "lines_above": { + "description": "Blank lines above heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }, + "lines_below": { + "description": "Blank lines below heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + } + } + } + ], + "default": true + }, + "MD023": { + "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "heading-start-left": { + "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD024": { + "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "siblings_only": { + "description": "Only check sibling headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "no-duplicate-heading": { + "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "siblings_only": { + "description": "Only check sibling headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD025": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "single-title": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "single-h1": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "MD026": { + "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!。,;:!" + } + } + } + ], + "default": true + }, + "no-trailing-punctuation": { + "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!。,;:!" + } + } + } + ], + "default": true + }, + "MD027": { + "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "no-multiple-space-blockquote": { + "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD028": { + "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-blanks-blockquote": { + "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD029": { + "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "one", + "ordered", + "one_or_ordered", + "zero" + ], + "default": "one_or_ordered" + } + } + } + ], + "default": true + }, + "ol-prefix": { + "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "one", + "ordered", + "one_or_ordered", + "zero" + ], + "default": "one_or_ordered" + } + } + } + ], + "default": true + }, + "MD030": { + "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ul_single": { + "description": "Spaces for single-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_single": { + "description": "Spaces for single-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ul_multi": { + "description": "Spaces for multi-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_multi": { + "description": "Spaces for multi-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "list-marker-space": { + "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ul_single": { + "description": "Spaces for single-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_single": { + "description": "Spaces for single-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ul_multi": { + "description": "Spaces for multi-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_multi": { + "description": "Spaces for multi-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "MD031": { + "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "blanks-around-fences": { + "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD032": { + "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "blanks-around-lists": { + "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD033": { + "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_elements": { + "description": "Allowed elements", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "table_allowed_elements": { + "description": "Allowed elements in tables", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + } + } + ], + "default": true + }, + "no-inline-html": { + "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_elements": { + "description": "Allowed elements", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "table_allowed_elements": { + "description": "Allowed elements in tables", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + } + } + ], + "default": true + }, + "MD034": { + "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-bare-urls": { + "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD035": { + "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Horizontal rule style", + "type": "string", + "default": "consistent" + } + } + } + ], + "default": true + }, + "hr-style": { + "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Horizontal rule style", + "type": "string", + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD036": { + "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!?。,;:!?" + } + } + } + ], + "default": true + }, + "no-emphasis-as-heading": { + "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!?。,;:!?" + } + } + } + ], + "default": true + }, + "MD037": { + "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-space-in-emphasis": { + "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD038": { + "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-space-in-code": { + "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD039": { + "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-space-in-links": { + "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD040": { + "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_languages": { + "description": "List of languages", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "language_only": { + "description": "Require language only", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "fenced-code-language": { + "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_languages": { + "description": "List of languages", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "language_only": { + "description": "Require language only", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD041": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allow_preamble": { + "description": "Allow content before first heading", + "type": "boolean", + "default": false + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "first-line-heading": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allow_preamble": { + "description": "Allow content before first heading", + "type": "boolean", + "default": false + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "first-line-h1": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allow_preamble": { + "description": "Allow content before first heading", + "type": "boolean", + "default": false + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "MD042": { + "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-empty-links": { + "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD043": { + "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "headings": { + "description": "List of headings", + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\*|\\+|\\?|#{1,6}\\s+\\S.*)$" + }, + "default": [] + }, + "match_case": { + "description": "Match case of headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "required-headings": { + "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "headings": { + "description": "List of headings", + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\*|\\+|\\?|#{1,6}\\s+\\S.*)$" + }, + "default": [] + }, + "match_case": { + "description": "Match case of headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD044": { + "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "names": { + "description": "List of proper names", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "html_elements": { + "description": "Include HTML elements", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "proper-names": { + "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "names": { + "description": "List of proper names", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "html_elements": { + "description": "Include HTML elements", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD045": { + "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-alt-text": { + "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD046": { + "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Block style", + "type": "string", + "enum": [ + "consistent", + "fenced", + "indented" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "code-block-style": { + "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Block style", + "type": "string", + "enum": [ + "consistent", + "fenced", + "indented" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD047": { + "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "single-trailing-newline": { + "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD048": { + "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Code fence style", + "type": "string", + "enum": [ + "consistent", + "backtick", + "tilde" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "code-fence-style": { + "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Code fence style", + "type": "string", + "enum": [ + "consistent", + "backtick", + "tilde" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD049": { + "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Emphasis style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "emphasis-style": { + "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Emphasis style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD050": { + "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Strong style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "strong-style": { + "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Strong style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD051": { + "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignore_case": { + "description": "Ignore case of fragments", + "type": "boolean", + "default": false + }, + "ignored_pattern": { + "description": "Pattern for ignoring additional fragments", + "type": "string", + "default": "" + } + } + } + ], + "default": true + }, + "link-fragments": { + "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignore_case": { + "description": "Ignore case of fragments", + "type": "boolean", + "default": false + }, + "ignored_pattern": { + "description": "Pattern for ignoring additional fragments", + "type": "string", + "default": "" + } + } + } + ], + "default": true + }, + "MD052": { + "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_labels": { + "description": "Ignored link labels", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "x" + ] + }, + "shortcut_syntax": { + "description": "Include shortcut syntax", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "reference-links-images": { + "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_labels": { + "description": "Ignored link labels", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "x" + ] + }, + "shortcut_syntax": { + "description": "Include shortcut syntax", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD053": { + "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_definitions": { + "description": "Ignored definitions", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "//" + ] + } + } + } + ], + "default": true + }, + "link-image-reference-definitions": { + "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_definitions": { + "description": "Ignored definitions", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "//" + ] + } + } + } + ], + "default": true + }, + "MD054": { + "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "autolink": { + "description": "Allow autolinks", + "type": "boolean", + "default": true + }, + "inline": { + "description": "Allow inline links and images", + "type": "boolean", + "default": true + }, + "full": { + "description": "Allow full reference links and images", + "type": "boolean", + "default": true + }, + "collapsed": { + "description": "Allow collapsed reference links and images", + "type": "boolean", + "default": true + }, + "shortcut": { + "description": "Allow shortcut reference links and images", + "type": "boolean", + "default": true + }, + "url_inline": { + "description": "Allow URLs as inline links", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "link-image-style": { + "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "autolink": { + "description": "Allow autolinks", + "type": "boolean", + "default": true + }, + "inline": { + "description": "Allow inline links and images", + "type": "boolean", + "default": true + }, + "full": { + "description": "Allow full reference links and images", + "type": "boolean", + "default": true + }, + "collapsed": { + "description": "Allow collapsed reference links and images", + "type": "boolean", + "default": true + }, + "shortcut": { + "description": "Allow shortcut reference links and images", + "type": "boolean", + "default": true + }, + "url_inline": { + "description": "Allow URLs as inline links", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD055": { + "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table pipe style", + "type": "string", + "enum": [ + "consistent", + "leading_only", + "trailing_only", + "leading_and_trailing", + "no_leading_or_trailing" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "table-pipe-style": { + "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table pipe style", + "type": "string", + "enum": [ + "consistent", + "leading_only", + "trailing_only", + "leading_and_trailing", + "no_leading_or_trailing" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD056": { + "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "table-column-count": { + "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD058": { + "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "blanks-around-tables": { + "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD059": { + "description": "MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "prohibited_texts": { + "description": "Prohibited link texts", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "click here", + "here", + "link", + "more" + ] + } + } + } + ], + "default": true + }, + "descriptive-link-text": { + "description": "MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "prohibited_texts": { + "description": "Prohibited link texts", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "click here", + "here", + "link", + "more" + ] + } + } + } + ], + "default": true + }, + "MD060": { + "description": "MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table column style", + "type": "string", + "enum": [ + "any", + "aligned", + "compact", + "tight" + ], + "default": "any" + }, + "aligned_delimiter": { + "description": "Aligned delimiter columns", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "table-column-style": { + "description": "MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table column style", + "type": "string", + "enum": [ + "any", + "aligned", + "compact", + "tight" + ], + "default": "any" + }, + "aligned_delimiter": { + "description": "Aligned delimiter columns", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "headings": { + "description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "bullet": { + "description": "bullet : MD004, MD005, MD007, MD032", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "ul": { + "description": "ul : MD004, MD005, MD007, MD030, MD032", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "indentation": { + "description": "indentation : MD005, MD007, MD027", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "whitespace": { + "description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "hard_tab": { + "description": "hard_tab : MD010", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "links": { + "description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "blank_lines": { + "description": "blank_lines : MD012, MD022, MD031, MD032, MD047", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "line_length": { + "description": "line_length : MD013", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "code": { + "description": "code : MD014, MD031, MD038, MD040, MD046, MD048", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "atx": { + "description": "atx : MD018, MD019", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "spaces": { + "description": "spaces : MD018, MD019, MD020, MD021, MD023", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "atx_closed": { + "description": "atx_closed : MD020, MD021", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "blockquote": { + "description": "blockquote : MD027, MD028", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "ol": { + "description": "ol : MD029, MD030, MD032", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "html": { + "description": "html : MD033", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "url": { + "description": "url : MD034", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "hr": { + "description": "hr : MD035", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "emphasis": { + "description": "emphasis : MD036, MD037, MD049, MD050", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "language": { + "description": "language : MD040", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "spelling": { + "description": "spelling : MD044", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "accessibility": { + "description": "accessibility : MD045, MD059", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "images": { + "description": "images : MD045, MD052, MD053, MD054", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "table": { + "description": "table : MD055, MD056, MD058, MD060", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schema/markdownlint-config-schema.json b/schema/markdownlint-config-schema.json new file mode 100644 index 00000000..8a76a313 --- /dev/null +++ b/schema/markdownlint-config-schema.json @@ -0,0 +1,5133 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.40.0/schema/markdownlint-config-schema.json", + "title": "markdownlint configuration schema", + "type": "object", + "properties": { + "$schema": { + "description": "JSON Schema URI (expected by some editors)", + "type": "string", + "default": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.40.0/schema/markdownlint-config-schema.json" + }, + "default": { + "description": "Default state for all rules", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "extends": { + "description": "Path to configuration file to extend", + "type": [ + "string", + "null" + ], + "default": null + }, + "MD001": { + "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + } + } + ], + "default": true + }, + "heading-increment": { + "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md001.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + } + } + ], + "default": true + }, + "MD003": { + "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Heading style", + "type": "string", + "enum": [ + "consistent", + "atx", + "atx_closed", + "setext", + "setext_with_atx", + "setext_with_atx_closed" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "heading-style": { + "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md003.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Heading style", + "type": "string", + "enum": [ + "consistent", + "atx", + "atx_closed", + "setext", + "setext_with_atx", + "setext_with_atx_closed" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD004": { + "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "plus", + "dash", + "sublist" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "ul-style": { + "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md004.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "plus", + "dash", + "sublist" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD005": { + "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "list-indent": { + "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md005.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD007": { + "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "indent": { + "description": "Spaces for indent", + "type": "integer", + "minimum": 1, + "default": 2 + }, + "start_indented": { + "description": "Whether to indent the first level of the list", + "type": "boolean", + "default": false + }, + "start_indent": { + "description": "Spaces for first level indent (when start_indented is set)", + "type": "integer", + "minimum": 1, + "default": 2 + } + } + } + ], + "default": true + }, + "ul-indent": { + "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md007.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "indent": { + "description": "Spaces for indent", + "type": "integer", + "minimum": 1, + "default": 2 + }, + "start_indented": { + "description": "Whether to indent the first level of the list", + "type": "boolean", + "default": false + }, + "start_indent": { + "description": "Spaces for first level indent (when start_indented is set)", + "type": "integer", + "minimum": 1, + "default": 2 + } + } + } + ], + "default": true + }, + "MD009": { + "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "br_spaces": { + "description": "Spaces for line break", + "type": "integer", + "minimum": 0, + "default": 2 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": false + }, + "list_item_empty_lines": { + "description": "Allow spaces for empty lines in list items", + "type": "boolean", + "default": false + }, + "strict": { + "description": "Include unnecessary breaks", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "no-trailing-spaces": { + "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md009.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "br_spaces": { + "description": "Spaces for line break", + "type": "integer", + "minimum": 0, + "default": 2 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": false + }, + "list_item_empty_lines": { + "description": "Allow spaces for empty lines in list items", + "type": "boolean", + "default": false + }, + "strict": { + "description": "Include unnecessary breaks", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD010": { + "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "ignore_code_languages": { + "description": "Fenced code languages to ignore", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "spaces_per_tab": { + "description": "Number of spaces for each hard tab", + "type": "integer", + "minimum": 0, + "default": 1 + } + } + } + ], + "default": true + }, + "no-hard-tabs": { + "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "ignore_code_languages": { + "description": "Fenced code languages to ignore", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "spaces_per_tab": { + "description": "Number of spaces for each hard tab", + "type": "integer", + "minimum": 0, + "default": 1 + } + } + } + ], + "default": true + }, + "MD011": { + "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-reversed-links": { + "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md011.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD012": { + "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "maximum": { + "description": "Consecutive blank lines", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "no-multiple-blanks": { + "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "maximum": { + "description": "Consecutive blank lines", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "MD013": { + "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "line_length": { + "description": "Number of characters", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "heading_line_length": { + "description": "Number of characters for headings", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_block_line_length": { + "description": "Number of characters for code blocks", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "tables": { + "description": "Include tables", + "type": "boolean", + "default": true + }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, + "strict": { + "description": "Strict length checking", + "type": "boolean", + "default": false + }, + "stern": { + "description": "Stern length checking", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "line-length": { + "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md013.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "line_length": { + "description": "Number of characters", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "heading_line_length": { + "description": "Number of characters for headings", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_block_line_length": { + "description": "Number of characters for code blocks", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "tables": { + "description": "Include tables", + "type": "boolean", + "default": true + }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, + "strict": { + "description": "Strict length checking", + "type": "boolean", + "default": false + }, + "stern": { + "description": "Stern length checking", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD014": { + "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "commands-show-output": { + "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md014.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD018": { + "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-missing-space-atx": { + "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD019": { + "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-multiple-space-atx": { + "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md019.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD020": { + "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-missing-space-closed-atx": { + "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md020.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD021": { + "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-multiple-space-closed-atx": { + "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md021.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD022": { + "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "lines_above": { + "description": "Blank lines above heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }, + "lines_below": { + "description": "Blank lines below heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + } + } + } + ], + "default": true + }, + "blanks-around-headings": { + "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md022.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "lines_above": { + "description": "Blank lines above heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }, + "lines_below": { + "description": "Blank lines below heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + } + } + } + ], + "default": true + }, + "MD023": { + "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "heading-start-left": { + "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md023.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD024": { + "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "siblings_only": { + "description": "Only check sibling headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "no-duplicate-heading": { + "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md024.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "siblings_only": { + "description": "Only check sibling headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD025": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "single-title": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "single-h1": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md025.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "MD026": { + "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!。,;:!" + } + } + } + ], + "default": true + }, + "no-trailing-punctuation": { + "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!。,;:!" + } + } + } + ], + "default": true + }, + "MD027": { + "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "no-multiple-space-blockquote": { + "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md027.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD028": { + "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-blanks-blockquote": { + "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md028.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD029": { + "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "one", + "ordered", + "one_or_ordered", + "zero" + ], + "default": "one_or_ordered" + } + } + } + ], + "default": true + }, + "ol-prefix": { + "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md029.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "List style", + "type": "string", + "enum": [ + "one", + "ordered", + "one_or_ordered", + "zero" + ], + "default": "one_or_ordered" + } + } + } + ], + "default": true + }, + "MD030": { + "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ul_single": { + "description": "Spaces for single-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_single": { + "description": "Spaces for single-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ul_multi": { + "description": "Spaces for multi-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_multi": { + "description": "Spaces for multi-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "list-marker-space": { + "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md030.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ul_single": { + "description": "Spaces for single-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_single": { + "description": "Spaces for single-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ul_multi": { + "description": "Spaces for multi-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_multi": { + "description": "Spaces for multi-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + } + } + } + ], + "default": true + }, + "MD031": { + "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "blanks-around-fences": { + "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md031.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD032": { + "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "blanks-around-lists": { + "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md032.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD033": { + "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_elements": { + "description": "Allowed elements", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "table_allowed_elements": { + "description": "Allowed elements in tables", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + } + } + ], + "default": true + }, + "no-inline-html": { + "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_elements": { + "description": "Allowed elements", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "table_allowed_elements": { + "description": "Allowed elements in tables", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + } + } + ], + "default": true + }, + "MD034": { + "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-bare-urls": { + "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md034.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD035": { + "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Horizontal rule style", + "type": "string", + "default": "consistent" + } + } + } + ], + "default": true + }, + "hr-style": { + "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md035.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Horizontal rule style", + "type": "string", + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD036": { + "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!?。,;:!?" + } + } + } + ], + "default": true + }, + "no-emphasis-as-heading": { + "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md036.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!?。,;:!?" + } + } + } + ], + "default": true + }, + "MD037": { + "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-space-in-emphasis": { + "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md037.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD038": { + "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-space-in-code": { + "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md038.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD039": { + "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-space-in-links": { + "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md039.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD040": { + "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_languages": { + "description": "List of languages", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "language_only": { + "description": "Require language only", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "fenced-code-language": { + "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md040.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allowed_languages": { + "description": "List of languages", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "language_only": { + "description": "Require language only", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD041": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allow_preamble": { + "description": "Allow content before first heading", + "type": "boolean", + "default": false + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "first-line-heading": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allow_preamble": { + "description": "Allow content before first heading", + "type": "boolean", + "default": false + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "first-line-h1": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "allow_preamble": { + "description": "Allow content before first heading", + "type": "boolean", + "default": false + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + }, + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + } + } + } + ], + "default": true + }, + "MD042": { + "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-empty-links": { + "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md042.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD043": { + "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "headings": { + "description": "List of headings", + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\*|\\+|\\?|#{1,6}\\s+\\S.*)$" + }, + "default": [] + }, + "match_case": { + "description": "Match case of headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "required-headings": { + "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md043.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "headings": { + "description": "List of headings", + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\*|\\+|\\?|#{1,6}\\s+\\S.*)$" + }, + "default": [] + }, + "match_case": { + "description": "Match case of headings", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD044": { + "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "names": { + "description": "List of proper names", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "html_elements": { + "description": "Include HTML elements", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "proper-names": { + "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md044.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "names": { + "description": "List of proper names", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "html_elements": { + "description": "Include HTML elements", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD045": { + "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "no-alt-text": { + "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md045.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD046": { + "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Block style", + "type": "string", + "enum": [ + "consistent", + "fenced", + "indented" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "code-block-style": { + "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md046.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Block style", + "type": "string", + "enum": [ + "consistent", + "fenced", + "indented" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD047": { + "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "single-trailing-newline": { + "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD048": { + "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Code fence style", + "type": "string", + "enum": [ + "consistent", + "backtick", + "tilde" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "code-fence-style": { + "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md048.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Code fence style", + "type": "string", + "enum": [ + "consistent", + "backtick", + "tilde" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD049": { + "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Emphasis style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "emphasis-style": { + "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md049.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Emphasis style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD050": { + "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Strong style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "strong-style": { + "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md050.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Strong style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD051": { + "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignore_case": { + "description": "Ignore case of fragments", + "type": "boolean", + "default": false + }, + "ignored_pattern": { + "description": "Pattern for ignoring additional fragments", + "type": "string", + "default": "" + } + } + } + ], + "default": true + }, + "link-fragments": { + "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md051.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignore_case": { + "description": "Ignore case of fragments", + "type": "boolean", + "default": false + }, + "ignored_pattern": { + "description": "Pattern for ignoring additional fragments", + "type": "string", + "default": "" + } + } + } + ], + "default": true + }, + "MD052": { + "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_labels": { + "description": "Ignored link labels", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "x" + ] + }, + "shortcut_syntax": { + "description": "Include shortcut syntax", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "reference-links-images": { + "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md052.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_labels": { + "description": "Ignored link labels", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "x" + ] + }, + "shortcut_syntax": { + "description": "Include shortcut syntax", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "MD053": { + "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_definitions": { + "description": "Ignored definitions", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "//" + ] + } + } + } + ], + "default": true + }, + "link-image-reference-definitions": { + "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md053.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "ignored_definitions": { + "description": "Ignored definitions", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "//" + ] + } + } + } + ], + "default": true + }, + "MD054": { + "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "autolink": { + "description": "Allow autolinks", + "type": "boolean", + "default": true + }, + "inline": { + "description": "Allow inline links and images", + "type": "boolean", + "default": true + }, + "full": { + "description": "Allow full reference links and images", + "type": "boolean", + "default": true + }, + "collapsed": { + "description": "Allow collapsed reference links and images", + "type": "boolean", + "default": true + }, + "shortcut": { + "description": "Allow shortcut reference links and images", + "type": "boolean", + "default": true + }, + "url_inline": { + "description": "Allow URLs as inline links", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "link-image-style": { + "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md054.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "autolink": { + "description": "Allow autolinks", + "type": "boolean", + "default": true + }, + "inline": { + "description": "Allow inline links and images", + "type": "boolean", + "default": true + }, + "full": { + "description": "Allow full reference links and images", + "type": "boolean", + "default": true + }, + "collapsed": { + "description": "Allow collapsed reference links and images", + "type": "boolean", + "default": true + }, + "shortcut": { + "description": "Allow shortcut reference links and images", + "type": "boolean", + "default": true + }, + "url_inline": { + "description": "Allow URLs as inline links", + "type": "boolean", + "default": true + } + } + } + ], + "default": true + }, + "MD055": { + "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table pipe style", + "type": "string", + "enum": [ + "consistent", + "leading_only", + "trailing_only", + "leading_and_trailing", + "no_leading_or_trailing" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "table-pipe-style": { + "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md055.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table pipe style", + "type": "string", + "enum": [ + "consistent", + "leading_only", + "trailing_only", + "leading_and_trailing", + "no_leading_or_trailing" + ], + "default": "consistent" + } + } + } + ], + "default": true + }, + "MD056": { + "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "table-column-count": { + "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md056.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD058": { + "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "blanks-around-tables": { + "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md058.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + } + } + } + ], + "default": true + }, + "MD059": { + "description": "MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "prohibited_texts": { + "description": "Prohibited link texts", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "click here", + "here", + "link", + "more" + ] + } + } + } + ], + "default": true + }, + "descriptive-link-text": { + "description": "MD059/descriptive-link-text : Link text should be descriptive : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md059.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "prohibited_texts": { + "description": "Prohibited link texts", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "click here", + "here", + "link", + "more" + ] + } + } + } + ], + "default": true + }, + "MD060": { + "description": "MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table column style", + "type": "string", + "enum": [ + "any", + "aligned", + "compact", + "tight" + ], + "default": "any" + }, + "aligned_delimiter": { + "description": "Aligned delimiter columns", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "table-column-style": { + "description": "MD060/table-column-style : Table column style : https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether to enable the rule", + "type": "boolean", + "default": true + }, + "severity": { + "description": "Rule severity", + "type": "string", + "enum": [ + "error", + "warning" + ], + "default": "error" + }, + "style": { + "description": "Table column style", + "type": "string", + "enum": [ + "any", + "aligned", + "compact", + "tight" + ], + "default": "any" + }, + "aligned_delimiter": { + "description": "Aligned delimiter columns", + "type": "boolean", + "default": false + } + } + } + ], + "default": true + }, + "headings": { + "description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "bullet": { + "description": "bullet : MD004, MD005, MD007, MD032", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "ul": { + "description": "ul : MD004, MD005, MD007, MD030, MD032", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "indentation": { + "description": "indentation : MD005, MD007, MD027", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "whitespace": { + "description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "hard_tab": { + "description": "hard_tab : MD010", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "links": { + "description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "blank_lines": { + "description": "blank_lines : MD012, MD022, MD031, MD032, MD047", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "line_length": { + "description": "line_length : MD013", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "code": { + "description": "code : MD014, MD031, MD038, MD040, MD046, MD048", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "atx": { + "description": "atx : MD018, MD019", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "spaces": { + "description": "spaces : MD018, MD019, MD020, MD021, MD023", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "atx_closed": { + "description": "atx_closed : MD020, MD021", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "blockquote": { + "description": "blockquote : MD027, MD028", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "ol": { + "description": "ol : MD029, MD030, MD032", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "html": { + "description": "html : MD033", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "url": { + "description": "url : MD034", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "hr": { + "description": "hr : MD035", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "emphasis": { + "description": "emphasis : MD036, MD037, MD049, MD050", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "language": { + "description": "language : MD040", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "spelling": { + "description": "spelling : MD044", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "accessibility": { + "description": "accessibility : MD045, MD059", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "images": { + "description": "images : MD045, MD052, MD053, MD054", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + }, + "table": { + "description": "table : MD055, MD056, MD058, MD060", + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "error", + "warning" + ] + } + ], + "default": true + } + }, + "additionalProperties": { + "type": [ + "boolean", + "object" + ] + } +} \ No newline at end of file diff --git a/scripts/index.mjs b/scripts/index.mjs new file mode 100644 index 00000000..8ae0ef48 --- /dev/null +++ b/scripts/index.mjs @@ -0,0 +1,24 @@ +// @ts-check + +import { constants, copyFile, rm, unlink } from "node:fs/promises"; +import { globby } from "globby"; + +const [ command, ...args ] = process.argv.slice(2); + +if (command === "copy") { + const [ src, dest ] = args; + await copyFile(src, dest, constants.COPYFILE_FICLONE); +} else if (command === "delete") { + await Promise.all( + args.flatMap( + (glob) => globby(glob) + .then( + (files) => files.map((file) => unlink(file)) + ) + ) + ); +} else if (command === "remove") { + await Promise.all(args.map((dir) => rm(dir, { "force": true, "recursive": true }))); +} else { + throw new Error(`Unsupported command: ${command}`); +} diff --git a/style/cirosantilli.json b/style/cirosantilli.json index 41dae224..609a3bfe 100644 --- a/style/cirosantilli.json +++ b/style/cirosantilli.json @@ -1,5 +1,5 @@ { - "comment": "Rules for the style guide at http://www.cirosantilli.com/markdown-style-guide/", + "comment": "Rules for the style guide at https://www.cirosantilli.com/markdown-style-guide/", "default": true, "MD003": { diff --git a/style/prettier.json b/style/prettier.json new file mode 100644 index 00000000..29a24e62 --- /dev/null +++ b/style/prettier.json @@ -0,0 +1,27 @@ +{ + "comment": "Disables rules that may conflict with Prettier", + + "blanks-around-fences": false, + "blanks-around-headings": false, + "blanks-around-lists": false, + "code-fence-style": false, + "emphasis-style": false, + "heading-start-left": false, + "heading-style": false, + "hr-style": false, + "line-length": false, + "list-indent": false, + "list-marker-space": false, + "no-blanks-blockquote": false, + "no-hard-tabs": false, + "no-missing-space-atx": false, + "no-missing-space-closed-atx": false, + "no-multiple-blanks": false, + "no-multiple-space-atx": false, + "no-multiple-space-blockquote": false, + "no-multiple-space-closed-atx": false, + "no-trailing-spaces": false, + "ol-prefix": false, + "strong-style": false, + "ul-indent": false +} diff --git a/style/relaxed.json b/style/relaxed.json index f2e51faf..1070b598 100644 --- a/style/relaxed.json +++ b/style/relaxed.json @@ -4,10 +4,9 @@ "default": true, "whitespace": false, "line_length": false, - "MD006": false, - "MD007": false, - "MD033": false, - "MD034": false, - "MD040": false, - "MD041": false + "ul-indent": false, + "no-inline-html": false, + "no-bare-urls": false, + "fenced-code-language": false, + "first-line-h1": false } diff --git a/test/.markdownlint.json b/test/.markdownlint.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/test/.markdownlint.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/4-tabs-MD010.md b/test/4-tabs-MD010.md new file mode 100644 index 00000000..6ecf23bb --- /dev/null +++ b/test/4-tabs-MD010.md @@ -0,0 +1,11 @@ + text {MD010} +text and text 2 {MD010} +texts with trailing spaces {MD010} + + diff --git a/test/MD001-MD010.md b/test/MD001-MD010.md new file mode 100644 index 00000000..d9d90a86 --- /dev/null +++ b/test/MD001-MD010.md @@ -0,0 +1,34 @@ +## One + +#### Two {MD001} + +### Three {MD003} ### + +* Alpha + * Bravo {MD005} {MD007} + +- Charlie {MD004} + + * Delta {MD007} + * Echo {MD007} + +Text {MD009} + +Text text {MD010} + + 1. One + 2. Two + 3. Three + 4. Four +5. Five {MD005} + 6. Six + 7. Seven + 8. Eight + 9. Nine +10. Ten + 11. Eleven {MD005} +12. Twelve + + diff --git a/test/MD011-MD021.md b/test/MD011-MD021.md new file mode 100644 index 00000000..5efa51a6 --- /dev/null +++ b/test/MD011-MD021.md @@ -0,0 +1,34 @@ +# Top level heading + + + +A (reversed)[link] example. {MD011} + + +123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 + +## 123456789 123456789 123456789 123456789 123456789 123456789 + + $ command with no output {MD014} + +##No space A {MD018} + +## Multiple spaces B {MD019} + +##No space C {MD020} ## + +## No space D {MD020}## + +## Multiple spaces E {MD021} ## + +## Multiple spaces F {MD021} ## + +*Another* (reversed)[link] example. {MD011} + +{MD012:7} {MD013:8} {MD013:10} + + diff --git a/test/MD022-MD030.md b/test/MD022-MD030.md new file mode 100644 index 00000000..cfedbd44 --- /dev/null +++ b/test/MD022-MD030.md @@ -0,0 +1,21 @@ + # Heading +Text + +# Heading + +## Another heading {MD026}. + +> Multiple spaces {MD027} + +> Blank line above + +1. Alpha +3. Beta {MD029} {MD030} + +> > Multiple spaces, multiple blockquotes {MD027} +> > +> > > Multiple spaces, multiple blockquotes {MD027} +> > > +> > > Multiple spaces, multiple blockquotes {MD027} + +{MD022:1} {MD023:1} {MD024:4} {MD025:4} {MD028:9} diff --git a/test/MD030-warning-message.md b/test/MD030-warning-message.md new file mode 100644 index 00000000..8fe013cf --- /dev/null +++ b/test/MD030-warning-message.md @@ -0,0 +1,21 @@ +# + +- +(bare list item marker {MD032:3}) + +1. +(bare list item marker {MD032:6}) + +-a +(not a list item) + +1.a +(not a list item) + +- a + +1. a + +- a {MD030} + +1. a {MD030} diff --git a/test/MD031-MD040.md b/test/MD031-MD040.md new file mode 100644 index 00000000..73477e9a --- /dev/null +++ b/test/MD031-MD040.md @@ -0,0 +1,71 @@ +```js +debugger; +``` +* List {MD032} + +Inline
HTML {MD033} + +Bare https://example.com link {MD034} + +--- +*** + +*Emphasis {MD036}* + +Space * inside * emphasis {MD037} + +Space ` inside` code span {MD038} + +Space [ inside ](link) text {MD039} + +``` +``` + +space `` inside`` code {MD038} +space `inside` of ` code` elements {MD038} +`space` inside `of` code ` elements` {MD038} +space ``inside`` of `` code`` elements {MD038} +`` ` embedded backtick`` {MD038} +``embedded backtick` `` {MD038} + +some *space* in * some* emphasis {MD037} +some *space* in *some * emphasis {MD037} +some *space* in **some ** emphasis {MD037} +some _space_ in _ some_ emphasis {MD037} +some __space__ in __ some __ emphasis {MD037} + +Text +text ` code {MD038} +span` text +text. + +Text +text `code +span ` text {MD038} +text. + +* List {MD032} +--- + +Text +text ```code +span code +span code ``` text {MD038} +text +text text ```` code {MD038} +span code +span```` text +text. + +Text [ space](link) text [space ](link) text [ space ](link) text. {MD039} + +Space * inside {MD037} +multi-line * emphasis. {MD037} + + {MD031:3} {MD035:11} {MD040:21} + + diff --git a/test/MD041-MD050.md b/test/MD041-MD050.md new file mode 100644 index 00000000..32e14263 --- /dev/null +++ b/test/MD041-MD050.md @@ -0,0 +1,64 @@ +Not a heading {MD041} + +An [empty]() link {MD042} + +An [empty](#) link with fragment {MD042} + +An [empty](<>) link with angle brackets {MD042} + +This is a test file for the MARKDOWNLINT package. {MD044} + +This is a paragraph +about Markdownlint {MD044} +that capitalizes the +name wrong twice: +MarkDownLint. {MD044} + +A [normal](link) and an [empty one]() and a [fragment](#one). {MD042} + +An image without alternate text ![](image.jpg) {MD045} + +```text +Fenced code +``` + + Indented code {MD046} + +~~~text +Fenced code {MD048:27} +~~~ + +Mixed *emphasis* on _this_ line *with* multiple _issues_ {MD049} + +Mixed __strong emphasis__ on **this** line __with__ multiple **issues** {MD050} + +Inconsistent +emphasis _text {MD049} +spanning_ many {MD049} +lines + +Inconsistent +strong **emphasis {MD050} +spanning** many {MD050} +lines + +Inconsistent _double_ text _interleaved_ text _double_ _interleaved_ emphasis. {MD049} + +Inconsistent **double** text **interleaved** text **double** **interleaved** strong emphasis. {MD050} + + + +Missing newline character {MD043} {MD047} \ No newline at end of file diff --git a/test/MD051-MD060.md b/test/MD051-MD060.md new file mode 100644 index 00000000..e934b141 --- /dev/null +++ b/test/MD051-MD060.md @@ -0,0 +1,10 @@ +# detailed-results-MD051-MD060 + +A [link with a missing](#fragment) {MD051} + +A [link with a][defined-label] + +A [link with a][undefined-label] {MD052} + +[defined-label]: https://example.com +[unused-label]: {MD053} diff --git a/test/alternate_top_level_heading.md b/test/alternate_top_level_heading.md new file mode 100644 index 00000000..cc4e755d --- /dev/null +++ b/test/alternate_top_level_heading.md @@ -0,0 +1,12 @@ +## A level 2 top level heading + +## Another one {MD025} + + diff --git a/test/atx-heading-spacing-trailing-spaces.md b/test/atx-heading-spacing-trailing-spaces.md new file mode 100644 index 00000000..3201e6dc --- /dev/null +++ b/test/atx-heading-spacing-trailing-spaces.md @@ -0,0 +1,19 @@ +# atx-heading-spacing-trailing-spaces + + + +##Heading 1 {MD018} + +## Heading 2 {MD019} + +##Heading 3 {MD020} ## + +## Heading 4 {MD020}## + +##Heading 5 {MD020}## + +## Heading 5 {MD021} ## + +## Heading 6 {MD021} ## + +## Heading 7 {MD021} ## diff --git a/test/atx_closed_header_spacing.json b/test/atx_closed_header_spacing.json deleted file mode 100644 index 2f37f5bb..00000000 --- a/test/atx_closed_header_spacing.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "MD002": false -} diff --git a/test/atx_closed_header_spacing.md b/test/atx_closed_header_spacing.md deleted file mode 100644 index e9a296b3..00000000 --- a/test/atx_closed_header_spacing.md +++ /dev/null @@ -1,17 +0,0 @@ -#Header 1 {MD020} # - -## Header 2 {MD020}## - -##Header 3 {MD020}## - -## Header 4 {MD021} ## - -## Header 5 {MD021} ## - -## Header 6 {MD021} ## - -## Header 7 {MD021} ## - -## Header 8 \# - -## Header 9 \# diff --git a/test/atx_closed_heading_spacing.md b/test/atx_closed_heading_spacing.md new file mode 100644 index 00000000..fbc885a5 --- /dev/null +++ b/test/atx_closed_heading_spacing.md @@ -0,0 +1,24 @@ +#Heading 1 {MD020} # + +## Heading 2 {MD020}## + +##Heading 3 {MD020}## + +## Heading 4 {MD021} ## + +## Heading 5 {MD021} ## + +## Heading 6 {MD021} ## + +## Heading 7 {MD021} ## + +## Heading 8\# + +## Heading 9 \# + +## Heading 10 \# + + diff --git a/test/atx_header_spacing.json b/test/atx_header_spacing.json deleted file mode 100644 index 2f37f5bb..00000000 --- a/test/atx_header_spacing.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "MD002": false -} diff --git a/test/atx_header_spacing.md b/test/atx_header_spacing.md deleted file mode 100644 index b2c8838a..00000000 --- a/test/atx_header_spacing.md +++ /dev/null @@ -1,5 +0,0 @@ -#Header 1 {MD018} - -## Header 2 {MD019} - -## Header 3 {MD019} \ No newline at end of file diff --git a/test/atx_heading_spacing.md b/test/atx_heading_spacing.md new file mode 100644 index 00000000..cbf2aa23 --- /dev/null +++ b/test/atx_heading_spacing.md @@ -0,0 +1,9 @@ +#Heading 1 {MD018} + +## Heading 2 {MD019} + +## Heading 3 {MD019} + + diff --git a/test/backslashes-and-backticks.md b/test/backslashes-and-backticks.md new file mode 100644 index 00000000..6a213d1a --- /dev/null +++ b/test/backslashes-and-backticks.md @@ -0,0 +1,4 @@ +# Heading + +\\`\\ +\\`\\ diff --git a/test/bare-list-markers.md b/test/bare-list-markers.md index ebc9403b..0d9e053a 100644 --- a/test/bare-list-markers.md +++ b/test/bare-list-markers.md @@ -1,10 +1,33 @@ -* +# Bare List Markers -+ - -- +## Ordered 1/1/1 +1. +1. 1. -{MD004:3}{MD004:5} -{MD030:1}{MD030:3}{MD030:5}{MD030:7} +## Ordered 1/2/3 + +1. +2. +3. + +## Unordered * + +* +* +* + +## Unordered + + ++ ++ ++ + +## Unordered - + +- +- +- + + diff --git a/test/bare-urls-in-html.md b/test/bare-urls-in-html.md new file mode 100644 index 00000000..1698cbf9 --- /dev/null +++ b/test/bare-urls-in-html.md @@ -0,0 +1,28 @@ +# Bare URLs in HTML + +

+https://example.com/pass +

+ +Text https://example.com/fail text. {MD034} + +Text https://example.com/pass text. + +Text https://example.com/pass text https://example.com/fail text. {MD034} + +Text https://example.com/pass text https://example.com/fail text https://example.com/pass text. {MD034} + +Text text text https://example.com/pass text. + +Text text text https://example.com/pass text. + +Text text text text https://example.com/fail text. {MD034} + +Text
text https://example.com/fail
text. {MD034} + +Text
text https://example.com/fail
text. {MD034} + + diff --git a/test/bare-urls.md b/test/bare-urls.md new file mode 100644 index 00000000..1f9f8277 --- /dev/null +++ b/test/bare-urls.md @@ -0,0 +1,111 @@ +# Detailed Results Bare URLs + +For more, see https://example.com. {MD034} + +For more, see https://example.com/. {MD034} + +For more, see https://example.com/?query=string#hash. {MD034} + +For more, see https://example.com/info.htm. {MD034} + +Visit https://example.com, then refresh. {MD034} + +The site (https://example.com) is down. {MD034} + + + +Some documents use to link. + +Or to link. + +Or repeat the URL https://example.com. + +Or https://example.com/info.htm. + +This is allowed to avoid embedding angle brackets in HTML Text https://example.com. + +As is https://example.com/info.htm text. + +
Another violation: https://example.com. {MD034}
+ +
Another violation: https://example.com. {MD034}
+ +This is not a bare [link]( https://example.com ). + +Nor is [link](https://example.com/path-with(parens)). + +Or . + +URLs in HTML attributes are not bare: + + + Text + + + + +URLs surrounded by HTML tags are not bare: + +Not https://example.com bare. + +Not
https://example.com
bare. + +

+Not bare due to being in an HTML block: +https://example.com +https://example.com +

https://example.com
+

+ +
+https://example.com +
+ +
+https://example.com + +
+ +
+ +https://example.com {MD034} +
+ +
+ +https://example.com {MD034} + +
+ +URLs in link and image text are not bare: + +Text [link to https://example.com site](https://example.com) text. + +Image ![for https://example.com site](https://example.com) text. + +URLs may end with a dash: https://example.com#heading- {MD034} + +... when explicit: + +... when embedded: https://example.com#heading- + +Links with spaces inside angle brackets are okay: [blue jay]() + +Email addresses are treated similarly: user@example.com {MD034} + +Angle brackets work the same for email: + +Unusual email addresses are handled: + +--- + +[is-a-valid]: https://example.com + +Links bind to the innermost [link that [is-a-valid] link](https://example.com) {MD034} + +But not if the [link [is-not-a-valid] link](https://example.com) + +Escaping both inner square brackets avoids confusion: +[link \[is-not-a-valid\] link](https://example.com) diff --git a/test/blanks-around-fences-in-lists.md b/test/blanks-around-fences-in-lists.md new file mode 100644 index 00000000..1965ab6c --- /dev/null +++ b/test/blanks-around-fences-in-lists.md @@ -0,0 +1,76 @@ +# Blanks Around Fences In Lists + +1. ```text + Text + ``` +2. ```text + Text + ``` +3. ```text + Text + ``` + +Text + +- ```text + Text + ``` +- ```text + Text + ``` +- ```text + Text + ``` + +Text + +> 1. ```text +> Text +> ``` +> 2. ```text +> Text +> ``` +> 3. ```text +> Text +> ``` + +Text + +> - ```text +> Text +> ``` +> - ```text +> Text +> ``` +> - ```text +> Text +> ``` + +Text + +> > 1. ```text +> > Text +> > ``` +> > 2. ```text +> > Text +> > ``` +> > 3. ```text +> > Text +> > ``` + +Text + +> > - ```text +> > Text +> > ``` +> > - ```text +> > Text +> > ``` +> > - ```text +> > Text +> > ``` + +{MD031:5} {MD031:6} {MD031:8} {MD031:9} {MD031:17} {MD031:18} {MD031:20} +{MD031:21} {MD031:29} {MD031:30} {MD031:32} {MD031:33} {MD031:41} {MD031:42} +{MD031:44} {MD031:45} {MD031:53} {MD031:54} {MD031:56} {MD031:57} {MD031:65} +{MD031:66} {MD031:68} {MD031:69} diff --git a/test/blanks-around-headings--1-1.md b/test/blanks-around-headings--1-1.md new file mode 100644 index 00000000..049d408d --- /dev/null +++ b/test/blanks-around-headings--1-1.md @@ -0,0 +1,33 @@ +# Blanks Around Headings + +## Apple + +Text +## Banana + +Text + +## Cherry + +Text + + +## Durian ## + +Text + +Elderberry {MD022} +------------------ +Text + +--- +## Fig + + diff --git a/test/blanks-around-headings-0-2.md b/test/blanks-around-headings-0-2.md new file mode 100644 index 00000000..88a62504 --- /dev/null +++ b/test/blanks-around-headings-0-2.md @@ -0,0 +1,33 @@ +# Blanks Around Headings + + +## Apple + + +Text +## Banana {MD022} + +Text +## Cherry + + +Text +## Durian ## + + +Text + +--- +Elderberry {MD022} +------------------ +Text +## Fig + + diff --git a/test/blanks-around-headings-1--1.md b/test/blanks-around-headings-1--1.md new file mode 100644 index 00000000..0d5ce864 --- /dev/null +++ b/test/blanks-around-headings-1--1.md @@ -0,0 +1,35 @@ +# Blanks Around Headings + +## Apple +Text + +## Banana + +Text + +## Cherry + + +Text + +--- +## Durian {MD022} ## + +Text + +--- + +Elderberry +------------------ +Text + +## Fig + + diff --git a/test/blanks-around-headings-3-0.md b/test/blanks-around-headings-3-0.md new file mode 100644 index 00000000..12f253e4 --- /dev/null +++ b/test/blanks-around-headings-3-0.md @@ -0,0 +1,37 @@ +# Blanks Around Headings + + + +## Apple +Text + + + +## Banana +Text + + + +## Cherry +Text + + +## Durian {MD022} ## +Text + +Elderberry {MD022} +------------------ +Text + + + +## Fig + + diff --git a/test/blanks-around-headings-arrays.md b/test/blanks-around-headings-arrays.md new file mode 100644 index 00000000..bae0cd96 --- /dev/null +++ b/test/blanks-around-headings-arrays.md @@ -0,0 +1,127 @@ +# Blanks Around Headings (Arrays) + +# Apple - Good +Text +# Apple - Top {MD022} +Text + +# Apple - Bottom + +Text + + +## Banana - Good + + +Text + +## Banana - Top {MD022} + + +Text + + +## Banana - Bottom {MD022} + +Text + + + +### Cherry - Good + +Text + + +### Cherry - Top {MD022} + +Text + + + +### Cherry - Bottom {MD022} +Text +#### Durian - Good #### + + + +Text + +#### Durian - Top #### + + + +Text +#### Durian - Bottom {MD022} #### + +Text + +##### Elderberry - Good + +Text +##### Elderberry - Top {MD022} + +Text + +##### Elderberry - Bottom +Text + +###### Fig - Good ###### + + + + +Text +###### Fig - Top {MD022} ###### + + + + +Text + +###### Fig - Bottom {MD022} ###### + +Text + +Grape - Good +============ + +--- +Grape - Top {MD022} +=================== + +Text + +Grape - Bottom +============== + + +Text + + +Honeycomb - Good +--------- + + +Text + +Honeycomb - Top {MD022} +----------------------- + + +Text + + +Honeycomb - Bottom {MD022} +-------------------------- + +Text + + diff --git a/test/blanks-around-headings.md b/test/blanks-around-headings.md new file mode 100644 index 00000000..77949c5c --- /dev/null +++ b/test/blanks-around-headings.md @@ -0,0 +1,26 @@ +# Blanks Around Headings + +## Apple + +Text + +## Banana {MD022} +Text + +## Cherry + +Text +## Durian {MD022} ## + +Text + +--- +Elderberry {MD022} +------------------ +Text + +## Fig + + diff --git a/test/blanks-around-tables.md b/test/blanks-around-tables.md new file mode 100644 index 00000000..310d4c67 --- /dev/null +++ b/test/blanks-around-tables.md @@ -0,0 +1,51 @@ +# Blanks Around Tables + +| Header | Header | +| ------ | ------ | +| Cell | Cell | + +Text +| Header | {MD058} | +| ------ | ------- | +| Cell | Cell | + +| Header | Header | +| ------ | ------ | +| Cell | Cell | +Part of table {MD055} {MD056} + +| Header | Header | +| ------ | ------- | +| Cell | {MD058} | +> Blockquote + +Text + +> Text +> | Header | {MD058} | +> | ------ | ------- | +> | Cell | {MD058} | +Text + +> | Header | Header | +> | ------ | ------- | +> | Cell | {MD058} | +> > Blockquote + +- List Item + | Header | {MD058} | + | ------ | ------- | + | Cell | {MD058} | +- List Item + +1. List Item + | Header | {MD058} | + | ------ | ------- | + | Cell | {MD058} | +1. List Item + +:::directive +| Header | {MD058} | +| ------ | ------- | +| Cell | {MD058} | +::: diff --git a/test/blanks-around.md b/test/blanks-around.md new file mode 100644 index 00000000..88dc8b30 --- /dev/null +++ b/test/blanks-around.md @@ -0,0 +1,61 @@ +# Blanks Around + +--- + +## MD022/blanks-around-headings + +> +### Alpha +> > + + +### Beta + + +> Text +> +> ### Gamma +> > +> > Text + +--- + +## MD031/blanks-around-fences + +> > +```js +console.log(); +``` +> + + +```js +console.log(); +``` + + +> Text +> +> ```js +> console.log(); +> ``` +> > +> >Text + +--- + +## MD032/blanks-around-lists + +> +- List item +>> + + +- List item + + +> Text +> +> - List item +>> +>> Text diff --git a/test/blockquote-headings.md b/test/blockquote-headings.md new file mode 100644 index 00000000..46d6fb81 --- /dev/null +++ b/test/blockquote-headings.md @@ -0,0 +1,74 @@ +# Heading + +## Sub-heading + +> # Quoted heading {MD025} + +Text + +> > # Double-quoted heading {MD025} + +Text + +> ## Quoted sub-heading + +Text + +> ## Quoted indented sub-heading {MD023} {MD027} + +Text + +- Item + item + > # Quoted heading in list {MD022} {MD025} +- Item + item + > > # Double-quoted heading in list {MD022} {MD025} +- Item + item + > ## Quoted sub-heading in list {MD022} +- Item +- Item + item + > ## Quoted indented sub-heading in list {MD022} {MD023} {MD027} +- Item + +Text + +> Text +> +> ## Heading One {MD022} +> Text + +Text + +> Text +> ## Heading Two {MD022} +> +> Text + +Text + +> Text +> ## Heading Three {MD022} +> Text + +Text + +> > Text +> > ### Heading Four {MD022} +> > Text + +Text + +> Text +> > ### Heading Five {MD022} +> > Text + +Text + +> > Text +> > ### Heading Six {MD022} +> Text + +Text diff --git a/test/blockquote-spaces-nested.md b/test/blockquote-spaces-nested.md new file mode 100644 index 00000000..1ba7fe5c --- /dev/null +++ b/test/blockquote-spaces-nested.md @@ -0,0 +1,75 @@ +# Nested blockquote + +> A {MD027} +> +> > B {MD027} +> +> C {MD027} + +Text + +> A {MD027} +> +> > B {MD027} +> > +> > > C {MD027} +> > +> > D {MD027} +> +> E {MD027} + +Text + +> A {MD027} +> +>> B {MD027} +>> +>>> C {MD027} +>> +>> D {MD027} +> +> E {MD027} + +Text + +> > Text {MD027} + +Text + + > > Text {MD027} + +Text + + > > Text {MD027} + +Text + +> > Text {MD027} + +Text + +> > > Text {MD027} + +Text + +> > > > Text {MD027} + +Text + +>> >> Text {MD027} + +Text + + > > Text {MD027} + +Text + + > > Text {MD027} + +Text + + > > Text {MD027} + +Text + + > > Text {MD027} diff --git a/test/blockquote_blank_lines.md b/test/blockquote_blank_lines.md index e163a761..e46fe5e1 100644 --- a/test/blockquote_blank_lines.md +++ b/test/blockquote_blank_lines.md @@ -1,3 +1,5 @@ +# blockquote_blank_lines + Some text > a quote @@ -26,6 +28,6 @@ Some text Expected errors: -{MD028:5} {MD028:8} {MD028:10} {MD028:17} -{MD009:10} (trailing space is intentional) -{MD012:8} (multiple blank lines are intentional) +{MD028:7} {MD028:9} {MD028:10} {MD028:12} {MD028:19} +{MD009:12} (trailing space is intentional) +{MD012:10} (multiple blank lines are intentional) diff --git a/test/blockquote_spaces.md b/test/blockquote_spaces.md index 7492e7d2..a2ae64a6 100644 --- a/test/blockquote_spaces.md +++ b/test/blockquote_spaces.md @@ -1,3 +1,5 @@ +# blockquote_spaces + Some text > Hello world @@ -6,16 +8,55 @@ Some text This tests other things embedded in the blockquote: +- foo + > *Hello world* > *foo* {MD027} > **bar** {MD027} > "Baz" {MD027} -> *foo* -> **bar** -> 'baz' +> `qux` {MD027} +> *foo* more text +> **bar** more text +> 'baz' more text +> `qux` more text +> +> - foo Test the first line being indented too much: > Foo {MD027} > Bar {MD027} -> Baz \ No newline at end of file +> Baz + +Test spaces before the blockquote: + + > Text {MD027} + +Text + + > Text {MD027} + +Text + + > Text {MD027} + +Test nothing in the blockquote: + + + +> +{MD027:-1} + + + +> Blockquoted code blocks: +> +> Code +> Code +> Code +> +> ```text +> Code +> Code +> Code +> ``` diff --git a/test/break-all-the-rules.json b/test/break-all-the-rules.json deleted file mode 100644 index 054e8566..00000000 --- a/test/break-all-the-rules.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "MD041": true -} diff --git a/test/break-all-the-rules.md b/test/break-all-the-rules.md index 689fb2ae..e1daf687 100644 --- a/test/break-all-the-rules.md +++ b/test/break-all-the-rules.md @@ -1,11 +1,11 @@ -## Header 1 {MD002} {MD041} +## Heading 1 {MD041:1} -#### Header 2 {MD001} +#### Heading 2 {MD001:3} -# Header 3 {MD003} # +# Heading 3 {MD003} {MD043} # -* list - + list {MD004} {MD006} {MD007} {MD030} +* list {MD032} + + list {MD004} {MD007} {MD030} {MD032} * list * list {MD007} @@ -22,39 +22,39 @@ long line long line long line long line long line long line long line long line $ dollar {MD014} -#Header 4 {MD018} +#Heading 4 {MD018} -# Header 5 {MD019} +# Heading 5 {MD019} -#Header 6 {MD020} # - # Header 7 {MD021} {MD022} {MD023} {MD003} # +#Heading 6 {MD020} # -# Header 8 +# Heading 7 {MD021} {MD003} # -# Header 8 +# Heading 8 -{MD024:34} +# Heading 8 -Note: Can not break MD025 and MD002 in the same file +{MD024:35} +Note: Can not break MD025 and MD041 in the same file -# Header 9 {MD026}. + # Heading 9 {MD023} {MD026}. > {MD027} > {MD028:43} 1. list -2. list {MD029} +3. list {MD029} ```js ``` -* list {MD032} +* list {MD032} {MD046:49} {MD031:50}
{MD033} -http://example.com/page {MD034} +https://example.com/page {MD034} --- @@ -62,14 +62,83 @@ http://example.com/page {MD034} {MD035:61} -_Section {MD036} Header_ +_Section {MD036} Heading_ -Emphasis *with * space {MD037} +Emphasis _with _ space {MD037} Code `with ` space {MD038} [link with space ](link) {MD039} ``` -code fence without language {MD040:73} +code fence without language {MD040:73} {MD046:73} ``` + +~~~js +code fence with different style {MD048:77} {MD046:77} +~~~ + +[empty link]() {MD042} + +markdownLint {MD044} + +![](image.jpg) {MD045} +## Heading 10 {MD022} + +Emphasis _with_ underscore style + +Emphasis *with* different style {MD049} + +Strong __with__ underscore style + +Strong **with** different style {MD050} + +[Missing link fragment](#missing) {MD051} + +[Missing link][label] {MD052} + +[unused]: link-destination +{MD053:100} + +[text][url] {MD054} + + +[url]: https://example.com/page + +| table | header | +|--------|--------| + {MD055} | cell | + +{MD060:-2} + +| table | header | +|---------|--------| +| {MD056} | + +Text +| table {MD058} | +| ------- | +| cell {MD058} | +> Blockquote + +[click here](https://example.org) {MD059} + + + +EOF {MD047} \ No newline at end of file diff --git a/test/bulleted_list_2_space_indent.json b/test/bulleted_list_2_space_indent.json deleted file mode 100644 index cb9e58ac..00000000 --- a/test/bulleted_list_2_space_indent.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD007": { - "indent": 4 - } -} diff --git a/test/bulleted_list_2_space_indent.md b/test/bulleted_list_2_space_indent.md index 268c9b05..1fb1cfaf 100644 --- a/test/bulleted_list_2_space_indent.md +++ b/test/bulleted_list_2_space_indent.md @@ -1,6 +1,14 @@ +# bulleted_list_2_space_indent + This is a document where the lists are indented by 2 spaces, but the style is set to 4 space indents for lists: * Test X * Test Y {MD007} * Test Z {MD007} + + diff --git a/test/bulleted_list_4_space_indent.md b/test/bulleted_list_4_space_indent.md index 1c5e75db..2480f23e 100644 --- a/test/bulleted_list_4_space_indent.md +++ b/test/bulleted_list_4_space_indent.md @@ -1,3 +1,5 @@ +# bulleted_list_4_space_indent + * Test X * Test Y {MD007} - * Test Z {MD007} \ No newline at end of file + * Test Z {MD007} diff --git a/test/bulleted_list_not_at_beginning_of_line.md b/test/bulleted_list_not_at_beginning_of_line.md index 84bd0ba9..21cbe537 100644 --- a/test/bulleted_list_not_at_beginning_of_line.md +++ b/test/bulleted_list_not_at_beginning_of_line.md @@ -1,14 +1,59 @@ -Some text +# Bulleted List Not at Beginning of Line - * Item {MD006} - * Item - * Item - * Item - * Item +Text + +* Item * Item * Item + * Item + * Item +* Item +* Item -Some more text +Text - * Item {MD006} - * Item \ No newline at end of file + * Item {MD007} + * Item {MD007} + * Item {MD007} + * Item {MD007} + * Item {MD007} + * Item {MD007} + * Item {MD007} + +Text + +* Item + * Item + +Text + + * Item {MD007} + * Item {MD007} + +Text + +* Item +* Item +* Item + +Text + + * Item {MD007} + * Item {MD007} + * Item {MD007} + +Text + +* Item + +* Item + +* Item + +Text + + * Item {MD007} + + * Item {MD007} + + * Item {MD007} diff --git a/test/byte-order-marker-utf8.md b/test/byte-order-marker-utf8.md new file mode 100644 index 00000000..e2764de1 --- /dev/null +++ b/test/byte-order-marker-utf8.md @@ -0,0 +1,3 @@ +# Heading + +Text diff --git a/test/code-block-in-list.md b/test/code-block-in-list.md new file mode 100644 index 00000000..f1613714 --- /dev/null +++ b/test/code-block-in-list.md @@ -0,0 +1,21 @@ +# Code Block in List + +Text + +```js +// Code +``` + +Text + +1. Item + + ```js + // Code + ``` + +1. Item + + ```js + // Code + ``` diff --git a/test/code-block-trailing-spaces.md b/test/code-block-trailing-spaces.md new file mode 100644 index 00000000..65e73bca --- /dev/null +++ b/test/code-block-trailing-spaces.md @@ -0,0 +1,40 @@ +# code-block-trailing-spaces + +Text + +Two trailing spaces {MD009} + +Text + + Indented code block + + Statement + Indented statement + + Statement + Indented statement + + Two trailing spaces + +Text + +```text +Fenced code block + + Statement + Indented statement + + Statement + Indented statement + + Two trailing spaces +``` + +Text + + diff --git a/test/code-block-with-language-allowed.md b/test/code-block-with-language-allowed.md new file mode 100644 index 00000000..c7c80c3c --- /dev/null +++ b/test/code-block-with-language-allowed.md @@ -0,0 +1,60 @@ +# Heading + +```js +if (true) { + console.log("true"); + if (false) { + console.log("false"); + } +} +``` + +```js +if (true) { + console.log("true"); + if (false) { + console.log("false"); + } +} +``` + + if (true) { + console.log("true"); + if (false) { + console.log("false"); + } + } + +``` Text + hello + world +} +``` + + if (true) { // {MD010} + console.log("true"); // {MD010} + if (false) { // {MD010} + console.log("false"); // {MD010} + } // {MD010} + } // {MD010} + +Line with hard tab. {MD010} + +```javascript +if (true) { + console.log("true"); // {MD010} + if (false) { // {MD010} + console.log("false"); // {MD010} + } // {MD010} +} +``` + + diff --git a/test/code-block-with-tabs-allowed.md b/test/code-block-with-tabs-allowed.md new file mode 100644 index 00000000..fd43cacd --- /dev/null +++ b/test/code-block-with-tabs-allowed.md @@ -0,0 +1,41 @@ +# Heading + +```js +if (true) { + console.log("true"); + if (false) { + console.log("false"); + } +} +``` + +```js +if (true) { + console.log("true"); + if (false) { + console.log("false"); + } +} +``` + + if (true) { // {MD046} + console.log("true"); + if (false) { + console.log("false"); + } + } + + if (true) { + console.log("true"); + if (false) { + console.log("false"); + } + } + +Line with hard tab. {MD010} + + diff --git a/test/code-block-with-tabs.md b/test/code-block-with-tabs.md new file mode 100644 index 00000000..a3285be3 --- /dev/null +++ b/test/code-block-with-tabs.md @@ -0,0 +1,35 @@ +# Heading + +```js +if (true) { + console.log("true"); + if (false) { + console.log("false"); + } +} +``` + +```js +if (true) { + console.log("true"); // {MD010} + if (false) { // {MD010} + console.log("false"); // {MD010} + } // {MD010} +} +``` + + if (true) { // {MD046} + console.log("true"); + if (false) { + console.log("false"); + } + } + + if (true) { // {MD010} + console.log("true"); // {MD010} + if (false) { // {MD010} + console.log("false"); // {MD010} + } // {MD010} + } // {MD010} + +Line with hard tab. {MD010} diff --git a/test/code-blocks-and-spans.md b/test/code-blocks-and-spans.md new file mode 100644 index 00000000..54a243a9 --- /dev/null +++ b/test/code-blocks-and-spans.md @@ -0,0 +1,38 @@ +# Code Blocks and Spans {MD044} + +Text CODE text {MD044} + +Text `CODE` text + +```lang +CODE + +CODE +``` + +`CODE` text `CODE` + + CODE + + CODE + +Text `CODE +CODE` text +text text +text `CODE +CODE CODE +CODE` text + +Text `CODE {MD044} + +Text `CODE {MD044} + + diff --git a/test/code-blocks-prefixed-by-spaces.md b/test/code-blocks-prefixed-by-spaces.md new file mode 100644 index 00000000..fc994147 --- /dev/null +++ b/test/code-blocks-prefixed-by-spaces.md @@ -0,0 +1,45 @@ +# md013-code-blocks-spaces + +Text text text text text text text text text text text text text text text text text text. {MD013} + +```text +Text text text text text text text text text text text text text text text text text text. +``` + + ```text + Text text text text text text text text text text text text text text text text text text. + ``` + + ```text + Text text text text text text text text text text text text text text text text text text. + ``` + + ```text + Text text text text text text text text text text text text text text text text text text. + ``` + + ```text + Text text text text text text text text text text text text text text text text text text. {MD046:21} + ``` + +Text text text text text text text text text text text text text text text text text text. {MD013} + + ```text + Text text text text text text text text text text text text text text text text text text. +``` + + ```text + Text text text text text text text text text text text text text text text text text text. +``` + + ```text + Text text text text text text text text text text text text text text text text text text. + ``` + +Text text text text text text text text text text text text text text text text text text. {MD013} + + diff --git a/test/code-fences-in-blockquotes.md b/test/code-fences-in-blockquotes.md new file mode 100644 index 00000000..ba39452a --- /dev/null +++ b/test/code-fences-in-blockquotes.md @@ -0,0 +1,20 @@ +# Detailed Results Code Fences in Blockquotes + +Text +```markdown +Text +``` +Text + +> Text +> ```markdown +> Text +> ``` +> Text +> > Text +> > ```markdown +> > Text +> > ``` +> > Text + +{MD031:4} {MD031:6} {MD031:10} {MD031:12} {MD031:15} {MD031:17} diff --git a/test/code-with-tabs-allowed.md b/test/code-with-tabs-allowed.md new file mode 100644 index 00000000..b86f0a36 --- /dev/null +++ b/test/code-with-tabs-allowed.md @@ -0,0 +1,33 @@ +# Code With Tabs Allowed + +Text text {MD010} + +Text `code code` text + +Text ` code` text + +Text `code ` text + +Text `code code +code code +code code` text + + console.log(" "); + +```js +console.log(" "); +``` + +```j s {MD010} +console.log(" "); +``` + + console.log(""); + + diff --git a/test/code-with-tabs-blocked.md b/test/code-with-tabs-blocked.md new file mode 100644 index 00000000..10464557 --- /dev/null +++ b/test/code-with-tabs-blocked.md @@ -0,0 +1,33 @@ +# Code With Tabs Blocked + +Text text {MD010} + +Text `code code` text {MD010} + +Text ` code` text {MD010} + +Text `code ` text {MD010} + +Text `code code +code code {MD010} +code code` text + + console.log(" "); // {MD010} + +```js +console.log(" "); // {MD010} +``` + +```j s {MD010} +console.log(" "); // {MD010} +``` + + console.log(""); // {MD010} + + diff --git a/test/code_block_consistency.md b/test/code_block_consistency.md new file mode 100644 index 00000000..1f28a193 --- /dev/null +++ b/test/code_block_consistency.md @@ -0,0 +1,13 @@ +# code_block_consistency + +This is text. + + This is a + code block. + +And here is more text + +```text +and here is a different {MD046:10} +code block +``` diff --git a/test/code_block_dollar.md b/test/code_block_dollar.md index 4c53cb27..019d0c20 100644 --- a/test/code_block_dollar.md +++ b/test/code_block_dollar.md @@ -1,9 +1,11 @@ +# Code Block Dollar + The following code block shouldn't have $ before the commands: $ ls {MD014} - $ less foo + $ less foo {MD014} - $ cat bar + $ cat bar {MD014} However the following code block shows output, and $ can be used to distinguish between command and output: @@ -27,7 +29,52 @@ The following code block doesn't have any dollar signs, and shouldn't fire: cat bar The following (fenced) code block doesn't have any content at all, and -shouldn't fire: +shouldn't fire: {MD046:34} ```bash ``` + +Mixed content: + + $ ls + file.md other.md + $ git branch + $ cat stuff + + output + +More mixed content: + + $ ls + $ git branch + $ cat stuff + stuff here + more stuff + $ tail cat + meow + +Command with blank lines in output: + + $ dig example.com + + ; ... + ;; ... + + ;; ... + +Some commands with no output: + + $ mkdir test + mkdir: created directory 'test' + $ cd test + $ ls test + +All commands with no output: + + $ mkdir test {MD014} + $ cd test {MD014} + $ ls test {MD014} + +Space-prefixed command with no output: + + $ ls example {MD014} diff --git a/test/code_block_dollar_fence-empty.md b/test/code_block_dollar_fence-empty.md new file mode 100644 index 00000000..e8664e4d --- /dev/null +++ b/test/code_block_dollar_fence-empty.md @@ -0,0 +1,20 @@ +# Heading + +```js + +``` + +```css + + +``` + +```spaces + +``` + + diff --git a/test/code_block_dollar_fence.md b/test/code_block_dollar_fence.md new file mode 100644 index 00000000..6f844b3e --- /dev/null +++ b/test/code_block_dollar_fence.md @@ -0,0 +1,47 @@ +# Code Block Dollar Fence + +```fence +$ code {MD014} +``` + +text + +```fence +$ code {MD014} +``` + +text + +```fence +$ code {MD014} +$ code {MD014} +``` + +text + +```fence +$ code {MD014} +$ code {MD014} +``` + +text + +```fence +$ code +code +$ code +code +``` + +text + +```sh + +$ npm install --save multimatch {MD014} +``` + +Space-prefixed command with no output: + +```sh + $ ls example {MD014} +``` diff --git a/test/code_block_fenced.md b/test/code_block_fenced.md new file mode 100644 index 00000000..1b301e4c --- /dev/null +++ b/test/code_block_fenced.md @@ -0,0 +1,25 @@ +# code_block_fenced + +This is text. + + This is a {MD046} + code block. + +And here is more text + +```text +This is a code block that won't trigger. +``` + +But we'll do another: + + And this {MD046} + will. + +Final text is here + + diff --git a/test/code_block_indented.md b/test/code_block_indented.md new file mode 100644 index 00000000..0e050772 --- /dev/null +++ b/test/code_block_indented.md @@ -0,0 +1,29 @@ +# code_block_indented + +This is text. + + This is a + code block. + +And here is more text + +```text +This is {MD046:10} also a code block. +``` + +But we'll do another: + + And this + will. + +One last one: + + This is code + + with an empty indented line. + + diff --git a/test/code_fence_style_backtick.md b/test/code_fence_style_backtick.md new file mode 100644 index 00000000..0d072b8a --- /dev/null +++ b/test/code_fence_style_backtick.md @@ -0,0 +1,27 @@ +# code_fence_style_backtick + +```text +This is a code block +``` + +~~~text +This is {MD048:7} a code block +~~~ + +```text +~~~ +This is fine +~~~ +``` + +~~~text +``` +This is not {MD048:17} +``` +~~~ + + diff --git a/test/code_fence_style_tilde.md b/test/code_fence_style_tilde.md new file mode 100644 index 00000000..00187737 --- /dev/null +++ b/test/code_fence_style_tilde.md @@ -0,0 +1,27 @@ +# code_fence_style_tilde + +```text +This is {MD048:3} a code block +``` + +~~~text +This is a code block +~~~ + +```text +~~~ +This is not fine {MD048:11} +~~~ +``` + +~~~text +``` +This is +``` +~~~ + + diff --git a/test/config/config-badchildfile.json b/test/config/config-badchildfile.json new file mode 100644 index 00000000..774a3b8a --- /dev/null +++ b/test/config/config-badchildfile.json @@ -0,0 +1,4 @@ +{ + "extends": "config-badfile.json", + "default": true +} diff --git a/test/config/config-badchildjson.json b/test/config/config-badchildjson.json new file mode 100644 index 00000000..551ecb41 --- /dev/null +++ b/test/config/config-badchildjson.json @@ -0,0 +1,4 @@ +{ + "extends": "config-badjson.json", + "default": true +} diff --git a/test/config/config-badchildpackage.json b/test/config/config-badchildpackage.json new file mode 100644 index 00000000..43b4ede8 --- /dev/null +++ b/test/config/config-badchildpackage.json @@ -0,0 +1,4 @@ +{ + "extends": "@oops/markdownlint-config", + "default": true +} diff --git a/test/config/config-badcontent.txt b/test/config/config-badcontent.txt new file mode 100644 index 00000000..b516b2c4 --- /dev/null +++ b/test/config/config-badcontent.txt @@ -0,0 +1 @@ +@ \ No newline at end of file diff --git a/test/config/config-badjson.json b/test/config/config-badjson.json new file mode 100644 index 00000000..9f37b62b --- /dev/null +++ b/test/config/config-badjson.json @@ -0,0 +1,3 @@ +{ + bad json +} diff --git a/test/config/config-child.json b/test/config/config-child.json new file mode 100644 index 00000000..f56f00bf --- /dev/null +++ b/test/config/config-child.json @@ -0,0 +1,4 @@ +{ + "no-hard-tabs": false, + "whitespace": false +} diff --git a/test/config/config-child.yaml b/test/config/config-child.yaml new file mode 100644 index 00000000..7ae6a307 --- /dev/null +++ b/test/config/config-child.yaml @@ -0,0 +1,2 @@ +no-hard-tabs: false +whitespace: false diff --git a/test/config/config-grandparent-hybrid.yaml b/test/config/config-grandparent-hybrid.yaml new file mode 100644 index 00000000..25978390 --- /dev/null +++ b/test/config/config-grandparent-hybrid.yaml @@ -0,0 +1,6 @@ +extends: config-parent-hybrid.toml +MD003: + style: atx_closed +MD007: + indent: 2 +no-hard-tabs: false diff --git a/test/config/config-grandparent.json b/test/config/config-grandparent.json new file mode 100644 index 00000000..4a45360c --- /dev/null +++ b/test/config/config-grandparent.json @@ -0,0 +1,6 @@ +{ + "extends": "config-parent.json", + "MD003": { "style": "atx_closed" }, + "MD007": { "indent": 2 }, + "no-hard-tabs": false +} diff --git a/test/config/config-grandparent.yaml b/test/config/config-grandparent.yaml new file mode 100644 index 00000000..0888823a --- /dev/null +++ b/test/config/config-grandparent.yaml @@ -0,0 +1,6 @@ +extends: config-parent.yaml +MD003: + style: atx_closed +MD007: + indent: 2 +no-hard-tabs: false diff --git a/test/config/config-packageparent.json b/test/config/config-packageparent.json new file mode 100644 index 00000000..e0f91b80 --- /dev/null +++ b/test/config/config-packageparent.json @@ -0,0 +1,7 @@ +{ + "extends": "pseudo-package", + "MD003": false, + "MD007": { "indent": 4 }, + "no-hard-tabs": true, + "line-length": { "line_length": 200 } +} diff --git a/test/config/config-parent-hybrid.toml b/test/config/config-parent-hybrid.toml new file mode 100644 index 00000000..3eabb0c4 --- /dev/null +++ b/test/config/config-parent-hybrid.toml @@ -0,0 +1,9 @@ +extends = "config-child.json" +MD003 = false +no-hard-tabs = true + +[MD007] +indent = 4 + +[line-length] +line_length = 200 diff --git a/test/config/config-parent.json b/test/config/config-parent.json new file mode 100644 index 00000000..172b646c --- /dev/null +++ b/test/config/config-parent.json @@ -0,0 +1,7 @@ +{ + "extends": "config-child.json", + "MD003": false, + "MD007": { "indent": 4 }, + "no-hard-tabs": true, + "line-length": { "line_length": 200 } +} diff --git a/test/config/config-parent.yaml b/test/config/config-parent.yaml new file mode 100644 index 00000000..47341b69 --- /dev/null +++ b/test/config/config-parent.yaml @@ -0,0 +1,7 @@ +extends: config-child.yaml +MD003: false +MD007: + indent: 4 +no-hard-tabs: true +line-length: + line_length: 200 diff --git a/test/configure-file-off-enable-inline.md b/test/configure-file-off-enable-inline.md new file mode 100644 index 00000000..a99c81f8 --- /dev/null +++ b/test/configure-file-off-enable-inline.md @@ -0,0 +1,47 @@ +# Configure File Off Enable Inline + ++ List item + +Text (text)[.] + + + ++ List item + +Text (text)[.] + + + ++ List item + +Text (text)[.] + + + ++ List item {MD004} + +Text (text)[.] {MD011} + + + ++ List item + +Text (text)[.] + + + ++ List item {MD004} + +Text (text)[.] {MD011} + + diff --git a/test/configure-file-with-severity-alias.md b/test/configure-file-with-severity-alias.md new file mode 100644 index 00000000..d0230e25 --- /dev/null +++ b/test/configure-file-with-severity-alias.md @@ -0,0 +1,58 @@ +# Configure File With Severity Alias + +Text * text* {MD037} + +Text ` text` {MD038} + +Text [ text](.) + ++ List item {MD004} + +Text (text)[.] {MD011} + +2. List item + + + +Text * text* + +Text ` text` + +Text [ text](.) + ++ List item + +Text (text)[.] + +2. List item + + + +Text * text* {MD037} + +Text ` text` {MD038} + +Text [ text](.) + ++ List item {MD004} + +Text (text)[.] {MD011} + +2. List item + + diff --git a/test/configure-file-with-severity-name.md b/test/configure-file-with-severity-name.md new file mode 100644 index 00000000..11a6b00e --- /dev/null +++ b/test/configure-file-with-severity-name.md @@ -0,0 +1,58 @@ +# Configure File With Severity Name + +Text * text* {MD037} + +Text ` text` {MD038} + +Text [ text](.) + ++ List item {MD004} + +Text (text)[.] {MD011} + +2. List item + + + +Text * text* + +Text ` text` + +Text [ text](.) + ++ List item + +Text (text)[.] + +2. List item + + + +Text * text* {MD037} + +Text ` text` {MD038} + +Text [ text](.) + ++ List item {MD004} + +Text (text)[.] {MD011} + +2. List item + + diff --git a/test/configure-file-with-severity-tag.md b/test/configure-file-with-severity-tag.md new file mode 100644 index 00000000..c03e7f7c --- /dev/null +++ b/test/configure-file-with-severity-tag.md @@ -0,0 +1,50 @@ +# Configure File With Severity Tag + +Text * text* {MD037} + +Text ` text` {MD038} + +Text [ text](.) {MD039} + ++ List item + +Text (text)[.] {MD011} + +2. List item {MD029} + + + +Text * text* + +Text ` text` + +Text [ text](.) + ++ List item + +Text (text)[.] + +2. List item + + + +Text * text* {MD037} + +Text ` text` {MD038} + +Text [ text](.) {MD039} + ++ List item + +Text (text)[.] {MD011} + +2. List item {MD029} + + diff --git a/test/consecutive_blank_lines.md b/test/consecutive_blank_lines.md index 9d403503..3468c6cb 100644 --- a/test/consecutive_blank_lines.md +++ b/test/consecutive_blank_lines.md @@ -1,11 +1,13 @@ +# consecutive_blank_lines + Some text -Some text {MD012:3} +Some text {MD012:5} This is a code block with two blank lines in it -Some more text \ No newline at end of file +Some more text diff --git a/test/consistent_bullet_styles_asterisk.md b/test/consistent_bullet_styles_asterisk.md index e8ccdee3..a06162cd 100644 --- a/test/consistent_bullet_styles_asterisk.md +++ b/test/consistent_bullet_styles_asterisk.md @@ -1,3 +1,5 @@ +# consistent_bullet_styles_asterisk + * Item * Item - * Item \ No newline at end of file + * Item diff --git a/test/consistent_bullet_styles_dash.md b/test/consistent_bullet_styles_dash.md index b6c50290..a41b13e4 100644 --- a/test/consistent_bullet_styles_dash.md +++ b/test/consistent_bullet_styles_dash.md @@ -1,3 +1,5 @@ +# consistent_bullet_styles_dash + - Item - Item - - Item \ No newline at end of file + - Item diff --git a/test/consistent_bullet_styles_plus.md b/test/consistent_bullet_styles_plus.md index 7930238c..6e73c106 100644 --- a/test/consistent_bullet_styles_plus.md +++ b/test/consistent_bullet_styles_plus.md @@ -1,3 +1,5 @@ +# consistent_bullet_styles_plus + + Item + Item - + Item \ No newline at end of file + + Item diff --git a/test/custom-rules.md b/test/custom-rules.md new file mode 100644 index 00000000..ecfc65d3 --- /dev/null +++ b/test/custom-rules.md @@ -0,0 +1,12 @@ +# Heading + +Sample text. + +Sample text. + +Sample text. + +Sample text. + + +> Blockquote diff --git a/test/default-spaces-MD010.md b/test/default-spaces-MD010.md new file mode 100644 index 00000000..85d43b48 --- /dev/null +++ b/test/default-spaces-MD010.md @@ -0,0 +1,8 @@ + text {MD010} +text and text 2 {MD010} +texts with trailing spaces {MD010} + + diff --git a/test/descriptive-link-text-empty-config.md b/test/descriptive-link-text-empty-config.md new file mode 100644 index 00000000..c291739b --- /dev/null +++ b/test/descriptive-link-text-empty-config.md @@ -0,0 +1,13 @@ +# Descriptive Link Text Empty Config + +[Learn more](https://example.com/images/about) about us. + +[Click here](https://example.com/dir/file.txt). + +Go to this [link](https://example.com/second). + + diff --git a/test/descriptive-link-text-override.md b/test/descriptive-link-text-override.md new file mode 100644 index 00000000..f4e4a270 --- /dev/null +++ b/test/descriptive-link-text-override.md @@ -0,0 +1,23 @@ +# Descriptive Link Text Override + +[Go here](https://example.com/javascript/about) {MD059} + +[Learn more](https://example.com/javascript/about). + +[Click here](https://example.com/javascript/about). + +To learn more, go [here!](https://example.com/site). + +To learn more, go to this [link!](https://example.com/links). + +If you need additional guidance, read [this](https://example.com/links). {MD059} + +[link][url] + +[url]: https://example.com + + diff --git a/test/descriptive-link-text.md b/test/descriptive-link-text.md new file mode 100644 index 00000000..03a3a55c --- /dev/null +++ b/test/descriptive-link-text.md @@ -0,0 +1,40 @@ +# Descriptive Link Text + +[Learn about Javascript](https://example.com/javascript/about) + +[About Javascript](https://example.com/file.txt) + +Learn about [our mission](https://example.com/mission). + +Go [here](https://example.com/descriptive-links) {MD059} + +[Learn more](https://example.com/images/about) about us. + +[Click here](https://example.com/dir/file.txt). {MD059} + +[Read more](https://example.com/guide). + +To get more support, go [here!](https://example.com/contact). {MD059} + +Learn [more](https://example.com/contact). {MD059} + +To learn more, [click here!!!!](https://example.com/about). {MD059} + +[click-here!!!!](https://example.com/first). {MD059} + +Go to this [link](https://example.com/second). {MD059} + +[link][Example URL] {MD059} + +[Example URL]: https://example.com + +{MD059} [click +here](https://example.com) + +[link](destination) {MD059} +[ link ](destination) {MD039} {MD059} +[*link*](destination) {MD059} +[_link_](destination) {MD049} {MD059} +[~~link~~](destination) {MD059} +[`link`](destination) +[](destination) {MD033} diff --git a/test/docfx-tab-syntax.md b/test/docfx-tab-syntax.md new file mode 100644 index 00000000..82342b43 --- /dev/null +++ b/test/docfx-tab-syntax.md @@ -0,0 +1,39 @@ +# Docfx Tab Syntax + +Examples copied from: + +--- + +# [Tab Display Name](#tab/tab-id) + +--- + +# [Linux](#tab/linux) + +Content for Linux... + +# [Windows](#tab/windows) + +Content for Windows... + +--- + +# [.NET](#tab/dotnet/linux) + +.NET content for Linux... + +# [.NET](#tab/dotnet/windows) + +.NET content for Windows... + +# [TypeScript](#tab/typescript/linux) + +TypeScript content for Linux... + +# [TypeScript](#tab/typescript/windows) + +TypeScript content for Windows... + +# [REST API](#tab/rest) + +REST API content, independent of platform... diff --git a/test/emoji-headings.md b/test/emoji-headings.md new file mode 100644 index 00000000..f0a3af21 --- /dev/null +++ b/test/emoji-headings.md @@ -0,0 +1,23 @@ +# Emoji Headings + +#️⃣ Keycap Number Sign + + + +# #️⃣ Keycap Number Sign + +Text + +##️⃣ Keycap Number Sign {MD018} + +Text + +# Keycap Number Sign #️⃣ + +Text + +# Keycap Number Sign#️⃣ + +Text + + diff --git a/test/emphasis-markers.md b/test/emphasis-markers.md new file mode 100644 index 00000000..ed5cc2d0 --- /dev/null +++ b/test/emphasis-markers.md @@ -0,0 +1,29 @@ +# Emphasis Markers + +Text to _set_ the **preferences**. + +This is *bad* {MD049} + +This `is +also` *bad* {MD049} + +This `is +also +very` *bad* {MD049} + +This is __bad__ {MD050} + +This `is +also` __bad__ {MD050} + +This `is +also +very` __bad__ {MD050} + +

HTML __should__ *be* ignored

+ +

+HTML __should__ *be* ignored +

+ + diff --git a/test/emphasis-not-heading-in-blockquote.md b/test/emphasis-not-heading-in-blockquote.md new file mode 100644 index 00000000..f9991e91 --- /dev/null +++ b/test/emphasis-not-heading-in-blockquote.md @@ -0,0 +1,23 @@ +# Heading + +> _Text_ + +Text + +> _Text text text_ + +Text + +> *Text* {MD049} + +Text + +> *Text text text* {MD049} + +Text + +> **Text** + +Text + +> **Text text text** diff --git a/test/emphasis_instead_of_headers.md b/test/emphasis_instead_of_headings.md similarity index 66% rename from test/emphasis_instead_of_headers.md rename to test/emphasis_instead_of_headings.md index bf9cff0d..e87992ff 100644 --- a/test/emphasis_instead_of_headers.md +++ b/test/emphasis_instead_of_headings.md @@ -1,3 +1,5 @@ +# emphasis_instead_of_headings + **Section 1: the first section {MD036}** Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor @@ -7,7 +9,7 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -__Section 1.1: another section {MD036}__ +__Section 1.1: another section {MD036} {MD050}__ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis @@ -25,7 +27,7 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -_Section 3: oh no more sections {MD036}_ +_Section 3: oh no more sections {MD036} {MD049}_ This is a normal paragraph **that just happens to have emphasized text in** @@ -33,3 +35,24 @@ even though the emphasized text is on its own line. This is another **normal** paragraph with some text in it. This also should not trigger the rule. + +**This is an entire paragraph that has been emphasized, and shouldn't be +detected as a heading because it's on multiple lines** + +**This also shouldn't be detected as a heading as it ends in punctuation.** + +**This shouldn't be detected as a heading as it ends in full-width punctuation。** + +**[This as well since it is a link](https://example.com)** + +*Section 4: emphasis as heading {MD036}* + +Emphasis as heading followed by an HTML comment + + __Section 5: emphasis as heading {MD036}__ + +Emphasis as heading following an HTML comment + +*Section 6: emphasis as non-heading* + +Embedded HTML comments are unusual and cause the emphasis to be ignored/allowed diff --git a/test/emphasis_style_asterisk.md b/test/emphasis_style_asterisk.md new file mode 100644 index 00000000..609f409f --- /dev/null +++ b/test/emphasis_style_asterisk.md @@ -0,0 +1,26 @@ +# Emphasis style asterisk + +*This* is fine + +This *is* fine + +This is *fine* + +_This_ is not + +This _is_ not + +This is _not_ + +{MD049:-2} {MD049:-4} {MD049:-6} + +Internal emphasis is preserved: +apple*banana*cherry, apple*banana*, *banana*cherry +apple_banana_cherry, apple_banana_, _banana_cherry + + diff --git a/test/emphasis_style_underscore.md b/test/emphasis_style_underscore.md new file mode 100644 index 00000000..05e2e46c --- /dev/null +++ b/test/emphasis_style_underscore.md @@ -0,0 +1,26 @@ +# Emphasis style underscore + +_This_ is fine + +This _is_ fine + +This is _fine_ + +*This* is not + +This *is* not + +This is *not* + +{MD049:-2} {MD049:-4} {MD049:-6} + +Internal emphasis is preserved: +apple*banana*cherry, apple*banana*, *banana*cherry +apple_banana_cherry, apple_banana_, _banana_cherry + + diff --git a/test/empty-links.md b/test/empty-links.md new file mode 100644 index 00000000..17d4760a --- /dev/null +++ b/test/empty-links.md @@ -0,0 +1,86 @@ +# Heading + +## Empty links + +[text]() {MD042} + +[text](<>) {MD042} + +[text]( <> ) {MD042} + +[text](<> "title") {MD042} + +[text]( <> "title" ) {MD042} + +[text](#) {MD042} + +[text]( # ) {MD042} + +[text](# "title") {MD042} + +[text]( # "title" ) {MD042} + +[text][frag] {MD042} + +[text][ frag ] {MD042} + +[frag][] {MD042} + +[frag] {MD042} + +[frag]: # + +## Non-empty links + +### frag + +[text](link) + +[text]( link ) + +[text](link "title") + +[text]( link "title" ) + +[text]() + +[text]( ) + +[text]( "title") + +[text]( "title" ) + +[text](#frag) + +[text]( #frag ) + +[text](#frag "title") + +[text]( #frag "title" ) + +[text][ref] + +[text][ ref ] + +[ref]: link + +[text] + +[text]: link + +## Inline of links with empty link (#308) + +[text](link-1) +[text]() {MD042} +[text](link-3) + +[text](link-1) +[text]() {MD042} +[text](link-3) +[text]() {MD042} + +[text](link-1) +[text]() {MD042} +[text](link-3) +[text]() {MD042} +[text](link-5) diff --git a/test/escaped-emphasis-markers.md b/test/escaped-emphasis-markers.md new file mode 100644 index 00000000..cbc74eec --- /dev/null +++ b/test/escaped-emphasis-markers.md @@ -0,0 +1,43 @@ +# Heading + +## Single-character markers + +None are valid emphasis without spaces. + +Escaped asterisks \* should \* be ignored by MD037. + +Escaped asterisks \* should * be ignored by MD037. + +Escaped asterisks * should \* be ignored by MD037. + +Escaped underscores \_ should \_ be ignored by MD037. + +Escaped underscores \_ should _ be ignored by MD037. + +Escaped underscores _ should \_ be ignored by MD037. + +## Double-character markers, start + +All *could* be reported because they are valid single-character +marker emphasis when no spaces are present. + +Escaped asterisks \** should ** be ignored by MD037. + +Escaped asterisks *\* should ** be ignored by MD037. + +Escaped underscores \__ should __ be ignored by MD037. + +Escaped underscores _\_ should __ be ignored by MD037. + +## Double-character markers, end + +All should be reported, but are ignored because they look like +the start of an embedded emphasis. + +Escaped asterisks ** should \** be ignored by MD037. + +Escaped asterisks ** should *\* be ignored by MD037. + +Escaped underscores __ should \__ be ignored by MD037. + +Escaped underscores __ should _\_ be ignored by MD037. diff --git a/test/esm-helpers.mjs b/test/esm-helpers.mjs new file mode 100644 index 00000000..19f39af9 --- /dev/null +++ b/test/esm-helpers.mjs @@ -0,0 +1,42 @@ +// @ts-check + +import fs from "node:fs/promises"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +/* eslint-disable jsdoc/no-undefined-types */ + +/** + * Gets the file name of the current module. + * Shims import.meta.filename for Node 18. + * + * @param {ImportMeta} meta ESM import.meta object. + * @returns {string} File name. + */ +// eslint-disable-next-line no-underscore-dangle +export const __filename = (meta) => fileURLToPath(meta.url); + +/** + * Gets the directory name of the current module. + * Shims import.meta.dirname for Node 18. + * + * @param {ImportMeta} meta ESM import.meta object. + * @returns {string} Directory name. + */ +// eslint-disable-next-line no-underscore-dangle +export const __dirname = (meta) => path.dirname(__filename(meta)); + +/* eslint-disable jsdoc/reject-any-type */ + +/** + * Imports a file as JSON. + * Avoids "ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time". + * + * @param {ImportMeta} meta ESM import.meta object. + * @param {string} file JSON file to import. + * @returns {Promise} JSON object. + */ +export const importWithTypeJson = async(meta, file) => ( + // @ts-ignore + JSON.parse(await fs.readFile(path.resolve(__dirname(meta), file))) +); diff --git a/test/every-markdown-syntax.md b/test/every-markdown-syntax.md new file mode 100644 index 00000000..02623d04 --- /dev/null +++ b/test/every-markdown-syntax.md @@ -0,0 +1,51 @@ +Every Markdown Syntax +===================== + +## Level 2 ATX Heading + +### Level 3 Closed ATX Heading ### + +--- + +Text *emphasized* **strong** ___emphasized+strong___. +Text `code` html . +Text [link](https://example.com/page) [link][] [link] ![image][link]. +Text https://example.com/page. + +Hard +line break + +[link]: https://example.com/page "Title" + +> Block quote +> > Nested + +- Unordered +- List + - Items + Indented + + Content + +1. Ordered +2. List + 1. Items + Indented + + Content + +```markdown options +Fenced code block +``` + + Indented code block + +

+HTML block +

+ +| Table | Heading | +| ----- | ------- | +| Table | Cell | + + diff --git a/test/fenced-code-in-list.md b/test/fenced-code-in-list.md new file mode 100644 index 00000000..32d330b7 --- /dev/null +++ b/test/fenced-code-in-list.md @@ -0,0 +1,41 @@ +# Heading + +- Item + + ```javascript + debugger; + + + debugger; + ``` + + text + +- Item + + - Subitem + + ```javascript + debugger; + + + debugger; + ``` + + text + + - Subitem + +- Item + + - Subitem + + ```javascript + debugger; debugger; debugger; debugger; debugger; debugger; debugger; debugger; debugger; debugger; + ``` + + diff --git a/test/fenced-code-unmatched.md b/test/fenced-code-unmatched.md new file mode 100644 index 00000000..20827215 --- /dev/null +++ b/test/fenced-code-unmatched.md @@ -0,0 +1,13 @@ +# Heading + +Text + +```code``` + +Text + +```javascript +var x = 5; +``` + +Text diff --git a/test/fenced_code_blocks.md b/test/fenced_code_blocks.md index cf902840..e8a87671 100644 --- a/test/fenced_code_blocks.md +++ b/test/fenced_code_blocks.md @@ -1,3 +1,5 @@ +# fenced_code_blocks + This is a GFM-style fenced code block: ``` bash @@ -24,4 +26,4 @@ None of the above should trigger any heading related rules. Code block without a language specifier ``` -{MD040:23} +{MD040:25} {MD048:15} diff --git a/test/fenced_code_blocks_in_lists.md b/test/fenced_code_blocks_in_lists.md new file mode 100644 index 00000000..ed5302a7 --- /dev/null +++ b/test/fenced_code_blocks_in_lists.md @@ -0,0 +1,40 @@ +# test doc + +this is some text + +* This is a list item + + ```fenced + this is a code block within the list item. + ``` + + with more text here + +* and another list item here + +And another paragraph. + + But this code block {MD046} + + is *NOT* in a list and should error. + +And in addition to that... + + ```text + This code block is both indented + and fenced and should *also* error. + ``` + +And finally: + +```text +This is a code block + + And this is a code block in a code block and should *not* error + +More stuff here +``` + +all + +{MD046:23} diff --git a/test/fenced_code_with_nesting.md b/test/fenced_code_with_nesting.md new file mode 100644 index 00000000..39ef410a --- /dev/null +++ b/test/fenced_code_with_nesting.md @@ -0,0 +1,73 @@ +# heading + +text {MD031:4} +```fence +code {MD031:6} +``` +text {MD031:8} {MD048:8} +~~~fence +code +~~~ +text {MD031:10} {MD031:12} +```fence +~~~fence +code +~~~ +``` +text {MD031:16} {MD031:18} {MD048:18} +~~~fence +```fence +code +``` +~~~ +text {MD031:22} {MD031:24} +```fence + +~~~fence +code +~~~ + +``` +text {MD031:30} {MD031:32} {MD048:32} +~~~fence + +```fence +code +``` + +~~~ +text {MD031:38} {MD031:40} +```fence +code +~~~ +``` +text {MD031:43} {MD031:45} {MD048:45} +~~~fence +code +``` +~~~ +text {MD031:48} {MD031:50} +````fence +```fence +code +``` +```` +text {MD031:54} {MD031:56} {MD048:56} +~~~~fence +~~~fence +code +~~~ +~~~~ +text {MD031:60} {MD031:62} +````fence +```fence +code +``` +````` +text {MD031:66} {MD031:68} {MD048:68} +~~~~fence +~~~fence +code +~~~ +~~~~~ +text {MD031:72} diff --git a/test/fenced_code_without_blank_lines.json b/test/fenced_code_without_blank_lines.json deleted file mode 100644 index 29614326..00000000 --- a/test/fenced_code_without_blank_lines.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "MD040": false -} diff --git a/test/fenced_code_without_blank_lines.md b/test/fenced_code_without_blank_lines.md index e3adeaf2..3707def1 100644 --- a/test/fenced_code_without_blank_lines.md +++ b/test/fenced_code_without_blank_lines.md @@ -9,18 +9,18 @@ code ``` text -``` {MD031} +``` code -``` {MD031} -text +``` +text {MD031:12} {MD031:14} ``` code -``` {MD031} -text +``` +text {MD031:19} -text -``` {MD031} +text {MD031:23} +``` code ``` @@ -37,6 +37,11 @@ code text + + ``` -code at end of file without newline +code at end of file without newline {MD047:47} ``` \ No newline at end of file diff --git a/test/first-line-heading-allow-preamble-false.md b/test/first-line-heading-allow-preamble-false.md new file mode 100644 index 00000000..11a59612 --- /dev/null +++ b/test/first-line-heading-allow-preamble-false.md @@ -0,0 +1,22 @@ +Text {MD041} + + + +Text + +

HTML

+ +Text + +- List item + +# Heading + +Text + + diff --git a/test/first-line-heading-allow-preamble-h1.md b/test/first-line-heading-allow-preamble-h1.md new file mode 100644 index 00000000..58db39bd --- /dev/null +++ b/test/first-line-heading-allow-preamble-h1.md @@ -0,0 +1,22 @@ +Text + + + +Text + +

HTML

+ +Text + +- List item + +

Heading

+ +Text + + diff --git a/test/first-line-heading-allow-preamble-violation.md b/test/first-line-heading-allow-preamble-violation.md new file mode 100644 index 00000000..f760cd96 --- /dev/null +++ b/test/first-line-heading-allow-preamble-violation.md @@ -0,0 +1,22 @@ +Text + + + +Text + +

HTML

+ +Text + +- List item + +## Heading {MD041} + +Text + + diff --git a/test/first-line-heading-allow-preamble.md b/test/first-line-heading-allow-preamble.md new file mode 100644 index 00000000..1d3e3035 --- /dev/null +++ b/test/first-line-heading-allow-preamble.md @@ -0,0 +1,22 @@ +Text + + + +Text + +

HTML

+ +Text + +- List item + +# Heading + +Text + + diff --git a/test/first_header_bad_atx.md b/test/first_header_bad_atx.md deleted file mode 100644 index a8e79371..00000000 --- a/test/first_header_bad_atx.md +++ /dev/null @@ -1 +0,0 @@ -## Header {MD002} \ No newline at end of file diff --git a/test/first_header_bad_setext.md b/test/first_header_bad_setext.md deleted file mode 100644 index 207501fb..00000000 --- a/test/first_header_bad_setext.md +++ /dev/null @@ -1,2 +0,0 @@ -Header {MD002} --------------- \ No newline at end of file diff --git a/test/first_header_good_atx.md b/test/first_header_good_atx.md deleted file mode 100644 index 7b163ace..00000000 --- a/test/first_header_good_atx.md +++ /dev/null @@ -1 +0,0 @@ -# Header \ No newline at end of file diff --git a/test/first_header_good_setext.md b/test/first_header_good_setext.md deleted file mode 100644 index e016d0fa..00000000 --- a/test/first_header_good_setext.md +++ /dev/null @@ -1,2 +0,0 @@ -Header -====== \ No newline at end of file diff --git a/test/first_heading_bad_atx.md b/test/first_heading_bad_atx.md new file mode 100644 index 00000000..27db14f6 --- /dev/null +++ b/test/first_heading_bad_atx.md @@ -0,0 +1,5 @@ +## Heading + + diff --git a/test/first_heading_bad_setext.md b/test/first_heading_bad_setext.md new file mode 100644 index 00000000..1568873b --- /dev/null +++ b/test/first_heading_bad_setext.md @@ -0,0 +1,6 @@ +Heading +------- + + diff --git a/test/first_heading_good_atx.md b/test/first_heading_good_atx.md new file mode 100644 index 00000000..7c1f8312 --- /dev/null +++ b/test/first_heading_good_atx.md @@ -0,0 +1 @@ +# Heading diff --git a/test/first_heading_good_setext.md b/test/first_heading_good_setext.md new file mode 100644 index 00000000..5c4577b4 --- /dev/null +++ b/test/first_heading_good_setext.md @@ -0,0 +1,2 @@ +Heading +======= diff --git a/test/first_line_top_level_header_atx.json b/test/first_line_top_level_header_atx.json deleted file mode 100644 index d6fc777e..00000000 --- a/test/first_line_top_level_header_atx.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": false, - "MD041": true -} diff --git a/test/first_line_top_level_header_atx.md b/test/first_line_top_level_header_atx.md deleted file mode 100644 index 7845ec58..00000000 --- a/test/first_line_top_level_header_atx.md +++ /dev/null @@ -1,3 +0,0 @@ -# First line is a top level header - -This shouldn't trigger MD041 diff --git a/test/first_line_top_level_header_setext.json b/test/first_line_top_level_header_setext.json deleted file mode 100644 index d6fc777e..00000000 --- a/test/first_line_top_level_header_setext.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": false, - "MD041": true -} diff --git a/test/first_line_top_level_header_setext.md b/test/first_line_top_level_header_setext.md deleted file mode 100644 index f783421d..00000000 --- a/test/first_line_top_level_header_setext.md +++ /dev/null @@ -1,4 +0,0 @@ -First line top level header -=========================== - -This shouldn't trigger MD041 diff --git a/test/first_line_top_level_heading_atx.md b/test/first_line_top_level_heading_atx.md new file mode 100644 index 00000000..1b9ada0b --- /dev/null +++ b/test/first_line_top_level_heading_atx.md @@ -0,0 +1,3 @@ +# First line is a top level heading + +This shouldn't trigger MD041 diff --git a/test/first_line_top_level_heading_setext.md b/test/first_line_top_level_heading_setext.md new file mode 100644 index 00000000..ac81046d --- /dev/null +++ b/test/first_line_top_level_heading_setext.md @@ -0,0 +1,4 @@ +First line top level heading +============================ + +This shouldn't trigger MD041 diff --git a/test/fix_102_extra_nodes_in_link_text.md b/test/fix_102_extra_nodes_in_link_text.md new file mode 100644 index 00000000..133386d8 --- /dev/null +++ b/test/fix_102_extra_nodes_in_link_text.md @@ -0,0 +1,12 @@ +# fix_102_extra_nodes_in_link_text + +[test _test_ test](www.test.com) +[test `test` test](www.test.com) +[test *test* test](www.test.com) +[test *test* *test* test](www.test.com) +[test *test* *test* *test* test](www.test.com) +[test **test** test](www.test.com) +[test __test__ test](www.test.com) +[this should not raise](www.shouldnotraise.com) + + diff --git a/test/fixing-with-front-matter.md b/test/fixing-with-front-matter.md new file mode 100644 index 00000000..25e43972 --- /dev/null +++ b/test/fixing-with-front-matter.md @@ -0,0 +1,11 @@ +--- +front: matter +ignore: this +--- +# Fixing with Front Matter {MD022} +Text text text {MD009} + +Text [ link ](url) text {MD039} {MD059} +## Nested Heading {MD022} + +Text {MD047} \ No newline at end of file diff --git a/test/front-matter-alt-title-h1.md b/test/front-matter-alt-title-h1.md new file mode 100644 index 00000000..6cf4231f --- /dev/null +++ b/test/front-matter-alt-title-h1.md @@ -0,0 +1,13 @@ +--- +alternate="Welcome to Jekyll!" +--- +# Top level heading {MD025} + +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). + + diff --git a/test/front-matter-alt-title-json.md b/test/front-matter-alt-title-json.md new file mode 100644 index 00000000..1cc1a867 --- /dev/null +++ b/test/front-matter-alt-title-json.md @@ -0,0 +1,12 @@ +{ +"date": "2017-01-26T22:17:00+02:00", +"alternate": "My document title and heading" +} + +Some plain text here. + + diff --git a/test/front-matter-alt-title-no-h1.md b/test/front-matter-alt-title-no-h1.md new file mode 100644 index 00000000..41cd6555 --- /dev/null +++ b/test/front-matter-alt-title-no-h1.md @@ -0,0 +1,11 @@ +--- +alternate="Welcome to Jekyll!" +--- +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). + + diff --git a/test/front-matter-alt-title-toml.md b/test/front-matter-alt-title-toml.md new file mode 100644 index 00000000..328fc495 --- /dev/null +++ b/test/front-matter-alt-title-toml.md @@ -0,0 +1,12 @@ ++++ +date = "2017-01-26T22:17:00+02:00" +alternate = "My document title and heading" ++++ + +Some plain text here. + + diff --git a/test/front-matter-alternate.md b/test/front-matter-alternate.md new file mode 100644 index 00000000..5a48bc67 --- /dev/null +++ b/test/front-matter-alternate.md @@ -0,0 +1,12 @@ +--- +front: matter +--- +Text {MD041} + +Text {MD009} + + diff --git a/test/front-matter-embedded.md b/test/front-matter-embedded.md index 5a5cc90a..d94952e0 100644 --- a/test/front-matter-embedded.md +++ b/test/front-matter-embedded.md @@ -1,9 +1,13 @@ Text text text --- -layout: post +layout: post {MD022} hard: tab {MD010} title: embedded --- Text text text + + diff --git a/test/front-matter-empty-title-no-h1.md b/test/front-matter-empty-title-no-h1.md new file mode 100644 index 00000000..a3af862a --- /dev/null +++ b/test/front-matter-empty-title-no-h1.md @@ -0,0 +1,14 @@ +--- +layout: post +title: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). {MD041} + + diff --git a/test/front-matter-empty.md b/test/front-matter-empty.md index 2dad3852..be240267 100644 --- a/test/front-matter-empty.md +++ b/test/front-matter-empty.md @@ -1,5 +1,5 @@ --- --- -# Header +# Heading # Another {MD025} diff --git a/test/front-matter-no-crlf.md b/test/front-matter-no-crlf.md new file mode 100644 index 00000000..84613604 --- /dev/null +++ b/test/front-matter-no-crlf.md @@ -0,0 +1,3 @@ +--- +front: matter +--- \ No newline at end of file diff --git a/test/front-matter-no-title-h1.md b/test/front-matter-no-title-h1.md new file mode 100644 index 00000000..c12e36e7 --- /dev/null +++ b/test/front-matter-no-title-h1.md @@ -0,0 +1,13 @@ +--- +layout: post +notitle: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +# Top level heading + +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). + + diff --git a/test/front-matter-no-title-no-h1.md b/test/front-matter-no-title-no-h1.md new file mode 100644 index 00000000..6784dba0 --- /dev/null +++ b/test/front-matter-no-title-no-h1.md @@ -0,0 +1,11 @@ +--- +layout: post +notitle: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). {MD041} + + diff --git a/test/front-matter-title-h1.md b/test/front-matter-title-h1.md new file mode 100644 index 00000000..bbffd638 --- /dev/null +++ b/test/front-matter-title-h1.md @@ -0,0 +1,13 @@ +--- +layout: post +title: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +# Top level heading {MD025} + +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). + + diff --git a/test/front-matter-title-h2.md b/test/front-matter-title-h2.md new file mode 100644 index 00000000..77342498 --- /dev/null +++ b/test/front-matter-title-h2.md @@ -0,0 +1,13 @@ +--- +layout: post +title: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +## Secondary heading + +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). + + diff --git a/test/front-matter-title-json-spaces.md b/test/front-matter-title-json-spaces.md new file mode 100644 index 00000000..44be0339 --- /dev/null +++ b/test/front-matter-title-json-spaces.md @@ -0,0 +1,6 @@ +{ +"date": "2017-01-26T22:17:00+02:00", +"title": "My document title and heading" +} + +Some plain text here. diff --git a/test/front-matter-title-json.md b/test/front-matter-title-json.md new file mode 100644 index 00000000..a7b171c3 --- /dev/null +++ b/test/front-matter-title-json.md @@ -0,0 +1,6 @@ +{ +"date": "2017-01-26T22:17:00+02:00", +"title": "My document title and heading" +} + +Some plain text here. diff --git a/test/front-matter-title-no-h1.md b/test/front-matter-title-no-h1.md new file mode 100644 index 00000000..b0457129 --- /dev/null +++ b/test/front-matter-title-no-h1.md @@ -0,0 +1,11 @@ +--- +layout: post +title: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). + + diff --git a/test/front-matter-title-pandoc-spaces.md b/test/front-matter-title-pandoc-spaces.md new file mode 100644 index 00000000..29dc4345 --- /dev/null +++ b/test/front-matter-title-pandoc-spaces.md @@ -0,0 +1,6 @@ ++++ +title: "Welcome to pandoc!" +date: 2015-11-17 16:16:01 -0600 +... + +Some plain text here. diff --git a/test/front-matter-title-pandoc.md b/test/front-matter-title-pandoc.md new file mode 100644 index 00000000..469c602b --- /dev/null +++ b/test/front-matter-title-pandoc.md @@ -0,0 +1,6 @@ ++++ +title: "Welcome to pandoc!" +date: 2015-11-17 16:16:01 -0600 +... + +Some plain text here. diff --git a/test/front-matter-title-spaces.md b/test/front-matter-title-spaces.md new file mode 100644 index 00000000..c1f608dd --- /dev/null +++ b/test/front-matter-title-spaces.md @@ -0,0 +1,12 @@ +--- +layout: post +title: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- + +Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). + + diff --git a/test/front-matter-title-toml-spaces.md b/test/front-matter-title-toml-spaces.md new file mode 100644 index 00000000..46dd03b3 --- /dev/null +++ b/test/front-matter-title-toml-spaces.md @@ -0,0 +1,6 @@ ++++ +date = "2017-01-26T22:17:00+02:00" +title = "My document title and heading" ++++ + +Some plain text here. diff --git a/test/front-matter-title-toml.md b/test/front-matter-title-toml.md new file mode 100644 index 00000000..fbb4993f --- /dev/null +++ b/test/front-matter-title-toml.md @@ -0,0 +1,6 @@ ++++ +date = "2017-01-26T22:17:00+02:00" +title = "My document title and heading" ++++ + +Some plain text here. diff --git a/test/front-matter-with-dashes.md b/test/front-matter-with-dashes.md index 26895e7a..3ab79fa5 100644 --- a/test/front-matter-with-dashes.md +++ b/test/front-matter-with-dashes.md @@ -3,7 +3,7 @@ layout: post title: Title with --- tags: front matter --- -## Header {MD002} +## Heading --- diff --git a/test/front-matter-with-disable-next-line.md b/test/front-matter-with-disable-next-line.md new file mode 100644 index 00000000..b6f74761 --- /dev/null +++ b/test/front-matter-with-disable-next-line.md @@ -0,0 +1,35 @@ +--- +front: matter +--- + +# Front Matter with Disable-Next-Line + + +
+ +
{MD033} + + +
+ +
{MD033} +
{MD033} + +
+
{MD033} +
{MD033} + +
{MD033} +
{MD033} +
+
{MD033} +
{MD033} +
+
{MD033} +
{MD033} +
+
{MD033} +
{MD033} +
+
{MD033} +
{MD033} diff --git a/test/front-matter-yaml-in-html-comment.md b/test/front-matter-yaml-in-html-comment.md new file mode 100644 index 00000000..b90019e5 --- /dev/null +++ b/test/front-matter-yaml-in-html-comment.md @@ -0,0 +1,14 @@ + + +# Front Matter YAML in HTML Comment + +Text text text diff --git a/test/front-matter.md b/test/front-matter.md index 16820c72..8e893ceb 100644 --- a/test/front-matter.md +++ b/test/front-matter.md @@ -1,7 +1,6 @@ --- front: matter --- +# Heading 1 -# Header 1 - -## Header 2 +## Heading 2 diff --git a/test/github-footnote-syntax.md b/test/github-footnote-syntax.md new file mode 100644 index 00000000..dc561676 --- /dev/null +++ b/test/github-footnote-syntax.md @@ -0,0 +1,20 @@ +# GitHub Footnote Syntax + +> Example from + +Here is a simple footnote[^1]. + +A footnote can also have multiple lines[^2]. + +You can also use words, to fit your writing style more closely[^note]. + +[^1]: My reference. +[^2]: Every new line should be prefixed with 2 spaces. + This allows you to have a footnote with multiple lines. +[^note]: + Named footnotes will still render with numbers instead of the text but allow easier identification and linking. + This footnote also has been made with a different syntax using 4 spaces for new lines. + + diff --git a/test/h1-as-top-level-heading.md b/test/h1-as-top-level-heading.md new file mode 100644 index 00000000..2f7b7b51 --- /dev/null +++ b/test/h1-as-top-level-heading.md @@ -0,0 +1,7 @@ +

H1 as Top-Level Heading

+ +Text + + diff --git a/test/h1-image-as-top-level-heading.md b/test/h1-image-as-top-level-heading.md new file mode 100644 index 00000000..c2ccbeae --- /dev/null +++ b/test/h1-image-as-top-level-heading.md @@ -0,0 +1,7 @@ +

A kitten

+ +Text + + diff --git a/test/h2-as-top-level-heading.md b/test/h2-as-top-level-heading.md new file mode 100644 index 00000000..3d9745f9 --- /dev/null +++ b/test/h2-as-top-level-heading.md @@ -0,0 +1,10 @@ +

H2 as Top-Level Heading

+ +Text + + diff --git a/test/h3-as-top-level-heading.md b/test/h3-as-top-level-heading.md new file mode 100644 index 00000000..f06e7e97 --- /dev/null +++ b/test/h3-as-top-level-heading.md @@ -0,0 +1,7 @@ +

H3 as Top-Level Heading {MD041}

+ +Text + + diff --git a/test/hard-line-breaks.md b/test/hard-line-breaks.md new file mode 100644 index 00000000..2aafda6f --- /dev/null +++ b/test/hard-line-breaks.md @@ -0,0 +1,94 @@ +# Hard Line Breaks + +hard +break + +hard\ +break + +hard +break + +hard + break + +hard\ + break + +*hard +break* + +*hard\ +break* + +`code +span` + +`code\ +span` + +not\ + +not + +## not\ + +### not + +- Item + +- Item + + - Item + + - Item + +Text text +text `code +span code +span` text +text + +Text text +text text +text + +Text text +text `code +span` text + +Text text +text `code +span code +span` text + +Text text + +Text `code span` text + +Text text +`code span` +text text + +{MD009:9} +{MD009:24} +{MD009:32} +{MD009:36} +{MD009:39} +{MD009:41} +{MD009:43} +{MD009:48} +{MD009:54} +{MD009:58} +{MD009:61} +{MD009:62} +{MD009:63} +{MD009:65} +{MD009:67} +{MD009:71} + + diff --git a/test/harness.mjs b/test/harness.mjs new file mode 100644 index 00000000..92ae7801 --- /dev/null +++ b/test/harness.mjs @@ -0,0 +1,55 @@ +import { readFile } from "node:fs/promises"; +import { lint } from "markdownlint/promise"; +import { parse } from "../lib/micromark-parse.mjs"; + +/* eslint-disable no-await-in-loop, no-console */ + +/** + * Log the structure of a Micromark token list. + * + * @param {Object[]} tokens Micromark tokens. + * @param {number} depth Tree depth. + * @returns {void} + */ +function consoleLogTokens(tokens, depth = 0) { + for (const token of tokens) { + const { children, text, type } = token; + console.log( + `${" ".repeat(depth * 2)}${type} ${text.replace(/\n/g, "\\n")}` + ); + if (children.length > 0) { + consoleLogTokens(children, depth + 1); + } + } +} + +let profile = false; +let count = 1; +const files = process.argv.slice(2).filter((arg) => { + if (arg === "--profile") { + profile = true; + count = 1000; + return false; + } + return true; +}); + +for (const file of files) { + if (!profile) { + const content = await readFile(file, "utf8"); + consoleLogTokens(parse(content)); + } + let results = null; + performance.mark("profile-start"); + for (let i = 0; i < count; i++) { + results = await lint({ + "files": [ file ] + }); + } + const measure = performance.measure("profile", "profile-start"); + if (profile) { + console.log(Math.round(measure.duration)); + } else { + console.dir(results, { "depth": null }); + } +} diff --git a/test/header_duplicate_content.md b/test/header_duplicate_content.md deleted file mode 100644 index 5ef79d93..00000000 --- a/test/header_duplicate_content.md +++ /dev/null @@ -1,11 +0,0 @@ -# Header 1 - -## Header 2 - -## Header 1 - -### Header 2 - -## Header 3 - -{MD024:5} {MD024:7} \ No newline at end of file diff --git a/test/header_multiple_toplevel.md b/test/header_multiple_toplevel.md deleted file mode 100644 index fa6467aa..00000000 --- a/test/header_multiple_toplevel.md +++ /dev/null @@ -1,3 +0,0 @@ -# Heading 1 - -# Heading 2 {MD025} \ No newline at end of file diff --git a/test/header_mutliple_h1_no_toplevel.md b/test/header_mutliple_h1_no_toplevel.md deleted file mode 100644 index a8453007..00000000 --- a/test/header_mutliple_h1_no_toplevel.md +++ /dev/null @@ -1,5 +0,0 @@ -Some introductory text - -# Heading 1 - -# Heading 2 \ No newline at end of file diff --git a/test/header_trailing_punctuation.md b/test/header_trailing_punctuation.md deleted file mode 100644 index 81d4fabf..00000000 --- a/test/header_trailing_punctuation.md +++ /dev/null @@ -1,11 +0,0 @@ -# Heading 1 {MD026}. - -## Heading 2 {MD026}, - -## Heading 3 {MD026}! - -## Heading 4 {MD026}: - -## Heading 5 {MD026}; - -## Heading 6 {MD026}? \ No newline at end of file diff --git a/test/header_trailing_punctuation_customized.json b/test/header_trailing_punctuation_customized.json deleted file mode 100644 index df827f91..00000000 --- a/test/header_trailing_punctuation_customized.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD026": { - "punctuation": ".,;:!" - } -} diff --git a/test/header_trailing_punctuation_customized.md b/test/header_trailing_punctuation_customized.md deleted file mode 100644 index e44f5482..00000000 --- a/test/header_trailing_punctuation_customized.md +++ /dev/null @@ -1,14 +0,0 @@ -# Heading 1 {MD026}. - -## Heading 2 {MD026}, - -## Heading 3 {MD026}! - -## Heading 4 {MD026}: - -## Heading 5 {MD026}; - -## Heading 6? - -The rule has been customized to allow question marks while disallowing -everything else. diff --git a/test/headers_bad.md b/test/headers_bad.md deleted file mode 100644 index 2bdce536..00000000 --- a/test/headers_bad.md +++ /dev/null @@ -1,7 +0,0 @@ -# Header - -### Header 3 {MD001} - -## Header 2 - -#### Header 4 {MD001} \ No newline at end of file diff --git a/test/headers_good_setext_with_atx.json b/test/headers_good_setext_with_atx.json deleted file mode 100644 index 8f73395a..00000000 --- a/test/headers_good_setext_with_atx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD003": { - "style": "setext_with_atx" - } -} diff --git a/test/headers_good_setext_with_atx.md b/test/headers_good_setext_with_atx.md deleted file mode 100644 index 726817f2..00000000 --- a/test/headers_good_setext_with_atx.md +++ /dev/null @@ -1,7 +0,0 @@ -Header 1 -======== - -Header 2 --------- - -### Header 3 diff --git a/test/headers_surrounding_space_atx.md b/test/headers_surrounding_space_atx.md deleted file mode 100644 index c811b190..00000000 --- a/test/headers_surrounding_space_atx.md +++ /dev/null @@ -1,9 +0,0 @@ -# Header 1 - -## Header 2 {MD022} -Some text -## Header 3 {MD022} -Some text -## Header 4 {MD022} - -## Header 5 \ No newline at end of file diff --git a/test/headers_surrounding_space_setext.md b/test/headers_surrounding_space_setext.md deleted file mode 100644 index 1a741c40..00000000 --- a/test/headers_surrounding_space_setext.md +++ /dev/null @@ -1,15 +0,0 @@ -Header 1 -======== - -Header 2 {MD022} ----------------- -Some text -Header 3 {MD022} -================ -Some text -Header 4 {MD022} -================ -Some text - -Header 5 --------- \ No newline at end of file diff --git a/test/headers_with_spaces_at_the_beginning.json b/test/headers_with_spaces_at_the_beginning.json deleted file mode 100644 index 8ad79fd3..00000000 --- a/test/headers_with_spaces_at_the_beginning.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "MD003": false -} diff --git a/test/headers_with_spaces_at_the_beginning.md b/test/headers_with_spaces_at_the_beginning.md deleted file mode 100644 index 81c280ae..00000000 --- a/test/headers_with_spaces_at_the_beginning.md +++ /dev/null @@ -1,9 +0,0 @@ -Some text - - # Header 1 {MD023} - - Setext style fully indented {MD023} - =================================== - - Setext style title only indented {MD023} -========================================= \ No newline at end of file diff --git a/test/heading-duplicate-content-siblings-only.md b/test/heading-duplicate-content-siblings-only.md new file mode 100644 index 00000000..8add9fe7 --- /dev/null +++ b/test/heading-duplicate-content-siblings-only.md @@ -0,0 +1,109 @@ +# Heading duplicate content siblings only + +# A + +{MD025:3} + +## B + +### C + +## B + +{MD024:11} + +### C + +## D + +### C + +### E + +### C + +{MD024:23} + +##### F + +{MD001:27} + +#### G + +##### F + +#### G + +{MD024:35} + +### E + +{MD024:39} + +# A + +{MD024:43} {MD025:43} + +## B + +### C + +## B + +{MD024:51} + +# Heading duplicate content siblings only + +{MD024:55} {MD025:55} + +AA +== + +{MD025:59} + +AA +-- + +BB +-- + +CC +-- + +BB +-- + +{MD024:73} + +BB +== + +{MD025:78} + +BB +-- + +## AAA ## + +### BBB ### + +## BBB ## + +### BBB ### + +## BBB ## + +{MD024:94} + +## Headings + +## Headings + +{MD024:-2} + + diff --git a/test/heading-multiple-top-level-preceding-blank-and-comment.md b/test/heading-multiple-top-level-preceding-blank-and-comment.md new file mode 100644 index 00000000..3e6e23a4 --- /dev/null +++ b/test/heading-multiple-top-level-preceding-blank-and-comment.md @@ -0,0 +1,6 @@ + + + +# Heading 1 + +# Heading 2 {MD025} diff --git a/test/heading-multiple-top-level-preceding-blank.md b/test/heading-multiple-top-level-preceding-blank.md new file mode 100644 index 00000000..3170bcfc --- /dev/null +++ b/test/heading-multiple-top-level-preceding-blank.md @@ -0,0 +1,4 @@ + +# Heading 1 + +# Heading 2 {MD025} diff --git a/test/heading-multiple-top-level-preceding-comment.md b/test/heading-multiple-top-level-preceding-comment.md new file mode 100644 index 00000000..9bf24d7b --- /dev/null +++ b/test/heading-multiple-top-level-preceding-comment.md @@ -0,0 +1,4 @@ + +# Heading 1 + +# Heading 2 {MD025} diff --git a/test/heading_duplicate_content.md b/test/heading_duplicate_content.md new file mode 100644 index 00000000..eeb83bde --- /dev/null +++ b/test/heading_duplicate_content.md @@ -0,0 +1,11 @@ +# Heading 1 + +## Heading 2 + +## Heading 1 + +### Heading 2 + +## Heading 3 + +{MD024:5} {MD024:7} diff --git a/test/heading_duplicate_content_different_nesting.md b/test/heading_duplicate_content_different_nesting.md new file mode 100644 index 00000000..23dd72f5 --- /dev/null +++ b/test/heading_duplicate_content_different_nesting.md @@ -0,0 +1,17 @@ +# Change log + +## 2.0.0 + +### Bug fixes + +### Features + +## 1.0.0 + +### Bug fixes + + diff --git a/test/heading_duplicate_content_no_different_nesting.md b/test/heading_duplicate_content_no_different_nesting.md new file mode 100644 index 00000000..f947ed88 --- /dev/null +++ b/test/heading_duplicate_content_no_different_nesting.md @@ -0,0 +1,13 @@ +# Change log + +## 2.0.0 + +### Bug fixes + +### Features + +## 1.0.0 + +### Bug fixes + +{MD024:11} diff --git a/test/heading_increment-alt_title_level3_bad.md b/test/heading_increment-alt_title_level3_bad.md new file mode 100644 index 00000000..84f1dfbd --- /dev/null +++ b/test/heading_increment-alt_title_level3_bad.md @@ -0,0 +1,14 @@ +--- +alternate = heading_increment-alt_title_level3_bad +--- + +### level 3 {MD001} + + diff --git a/test/heading_increment-title_level2_good.md b/test/heading_increment-title_level2_good.md new file mode 100644 index 00000000..8bd288ef --- /dev/null +++ b/test/heading_increment-title_level2_good.md @@ -0,0 +1,7 @@ +--- +title: heading_increment-title_level2_good +--- + +## level 2 + +### level 3 diff --git a/test/heading_increment-title_level3_bad.md b/test/heading_increment-title_level3_bad.md new file mode 100644 index 00000000..d15c7a04 --- /dev/null +++ b/test/heading_increment-title_level3_bad.md @@ -0,0 +1,5 @@ +--- +title: heading_increment-title_level3_bad +--- + +### level 3 {MD001} diff --git a/test/heading_multiple_toplevel.md b/test/heading_multiple_toplevel.md new file mode 100644 index 00000000..9f74aad5 --- /dev/null +++ b/test/heading_multiple_toplevel.md @@ -0,0 +1,9 @@ +# Heading 1 + +# Heading 2 {MD025} + +

+# Not heading +

+ + diff --git a/test/heading_mutliple_h1_no_toplevel.md b/test/heading_mutliple_h1_no_toplevel.md new file mode 100644 index 00000000..05ffb730 --- /dev/null +++ b/test/heading_mutliple_h1_no_toplevel.md @@ -0,0 +1,9 @@ +Some introductory text + +# Heading 1 + +# Heading 2 + + diff --git a/test/heading_trailing_punctuation.md b/test/heading_trailing_punctuation.md new file mode 100644 index 00000000..71d4cbc0 --- /dev/null +++ b/test/heading_trailing_punctuation.md @@ -0,0 +1,32 @@ +# Heading Trailing Punctuation + +## Heading {MD026} . + +## Heading {MD026} , + +## Heading {MD026} ; + +## Heading {MD026} : + +## Heading {MD026} ! + +## Heading? + +## Heading/Full-Width {MD026} 。 + +## Heading/Full-Width {MD026} , + +## Heading/Full-Width {MD026} ; + +## Heading/Full-Width {MD026} : + +## Heading/Full-Width {MD026} ! + +## Heading/Full-Width? + + + +## Heading {MD026} alternate ! ## + +Heading {MD026} alternate too ! +------------------------------- diff --git a/test/heading_trailing_punctuation_customized.md b/test/heading_trailing_punctuation_customized.md new file mode 100644 index 00000000..193df106 --- /dev/null +++ b/test/heading_trailing_punctuation_customized.md @@ -0,0 +1,22 @@ +# Heading 1 {MD026}. + +## Heading 2 {MD026}, + +## Heading 3! + +## Heading 4 {MD026}: + +## Heading 5 {MD026}; + +## Heading 6 {MD026}? + +## Heading 7 {MD026}] + +The rule has been customized to allow exclamation point while disallowing +everything else. + + diff --git a/test/heading_trailing_punctuation_empty.md b/test/heading_trailing_punctuation_empty.md new file mode 100644 index 00000000..55cac150 --- /dev/null +++ b/test/heading_trailing_punctuation_empty.md @@ -0,0 +1,19 @@ +# Heading Trailing Punctuation + +## Heading . + +## Heading , + +## Heading ; + +## Heading : + +## Heading ! + +## Heading ? + + diff --git a/test/headings-with-emoji.md b/test/headings-with-emoji.md new file mode 100644 index 00000000..95696a63 --- /dev/null +++ b/test/headings-with-emoji.md @@ -0,0 +1,25 @@ +# headings-with-emoji + +## Known Issues :bug: + +## Love :heartpulse: + +## :tada: + +## :checkered_flag: + +## :clock930: + +## :t-rex: + +## Boba:bubble_tea: + + + +## Fix the :bug: ## + +Another :heartpulse: +-------------------- + +:eyes: +------ diff --git a/test/headings-with-html-entities.md b/test/headings-with-html-entities.md new file mode 100644 index 00000000..052d5a3e --- /dev/null +++ b/test/headings-with-html-entities.md @@ -0,0 +1,28 @@ +# headings-with-html-entities + + + +## Copyright © 2000 + +## Copyright 2001 © + +## Copyright 2002© + +## Copyright 2003 © + +## Copyright 2004 © + +## Copyright 2004 © + +## Copyright 2005 © + +## Copyright 2006 © ## + +Copyright 2007 © +--------------------- + +## Copyright 2008 {MD026} copy; + +## Copyright 2009 {MD026} #x000A9; + +## Copyright 2010 {MD026} #169; diff --git a/test/headings-with-invalid-spaces.md b/test/headings-with-invalid-spaces.md new file mode 100644 index 00000000..4a5c908b --- /dev/null +++ b/test/headings-with-invalid-spaces.md @@ -0,0 +1,42 @@ +# Headings with invalid spaces + +## Normal space + +##  Normal outer non-breaking inner space + +## Non-breaking space {MD018} + +## Tab + +## Normal space (both) ## + +##  Normal outer non-breaking inner space (both)  ## + +## Non-breaking space (left) {MD020} ## + +## Tab (left) ## + +## Non-breaking space (right) {MD020} ## + +## Tab (right) ## + +## Extra normal space {MD019} + +##  Extra non-breaking space {MD018} + +## Extra Tab {MD019} + +## Extra Normal space (both) {MD021} ## + +##  Extra non-breaking space (left) {MD020} ## + +## Extra tab (left) {MD021} ## + +## Extra non-breaking space (right) {MD020}  ## + +## Extra tab (right) {MD021} ## + + diff --git a/test/headings-without-content.md b/test/headings-without-content.md new file mode 100644 index 00000000..e9d3eaa5 --- /dev/null +++ b/test/headings-without-content.md @@ -0,0 +1,22 @@ +# Headings Without Content + + + + +# + +# + +# + +# + +## + +## + +## + +## + +{MD019:10} {MD019:12} {MD019:18} {MD019:20} diff --git a/test/headings_bad.md b/test/headings_bad.md new file mode 100644 index 00000000..8647629d --- /dev/null +++ b/test/headings_bad.md @@ -0,0 +1,13 @@ +# Heading + +### Heading 3 {MD001} + +## Heading 2 + +#### Heading 4 {MD001} + +

+###### Not heading +

+ + diff --git a/test/headers_good.md b/test/headings_good.md similarity index 67% rename from test/headers_good.md rename to test/headings_good.md index f2576043..c9aaa2be 100644 --- a/test/headers_good.md +++ b/test/headings_good.md @@ -2,4 +2,4 @@ ## Heading 2 -## Heading 3 \ No newline at end of file +## Heading 3 diff --git a/test/headings_good_setext_with_atx.md b/test/headings_good_setext_with_atx.md new file mode 100644 index 00000000..92e1380f --- /dev/null +++ b/test/headings_good_setext_with_atx.md @@ -0,0 +1,17 @@ +Heading 1 +========= + +Heading 2 +--------- + +## Heading 2 {MD003} + +### Heading 3 + +#### Heading 4 {MD003} #### + + diff --git a/test/headings_good_setext_with_atx_closed.md b/test/headings_good_setext_with_atx_closed.md new file mode 100644 index 00000000..2595b730 --- /dev/null +++ b/test/headings_good_setext_with_atx_closed.md @@ -0,0 +1,17 @@ +Heading 1 +========= + +Heading 2 +--------- + +## Heading 2 {MD003} ## + +### Heading 3 ### + +#### Heading 4 {MD003} + + diff --git a/test/headings_good_with_issue_numbers.md b/test/headings_good_with_issue_numbers.md new file mode 100644 index 00000000..c0bda10b --- /dev/null +++ b/test/headings_good_with_issue_numbers.md @@ -0,0 +1,12 @@ +# Heading 1 + +## Heading 2 + +See the following issues: + +* #1234 +* #5678 (and related) + * #5678 + * #9101 + +## Heading 3 diff --git a/test/headings_surrounding_space_atx.md b/test/headings_surrounding_space_atx.md new file mode 100644 index 00000000..5279c51b --- /dev/null +++ b/test/headings_surrounding_space_atx.md @@ -0,0 +1,12 @@ +# Heading 1 + +## Heading 2 {MD022} +Some text +## Heading 3 {MD022} +Some text +## Heading 4 {MD022} + +## Heading 5 + +* This shouldn't trigger MD022, but did because of some bug where we tried to + #catch headings that kramdown didn't parse correctly. diff --git a/test/headings_surrounding_space_setext.md b/test/headings_surrounding_space_setext.md new file mode 100644 index 00000000..b75cd0f9 --- /dev/null +++ b/test/headings_surrounding_space_setext.md @@ -0,0 +1,15 @@ +Heading 1 +========= + +Heading 2 {MD022} +----------------- +Some text {MD022} {MD025} +Heading 3 +================= +Some text {MD022} {MD025} +Heading 4 +================= +Some text + +Heading 5 +--------- diff --git a/test/headings_with_spaces_at_the_beginning.md b/test/headings_with_spaces_at_the_beginning.md new file mode 100644 index 00000000..0c677f7f --- /dev/null +++ b/test/headings_with_spaces_at_the_beginning.md @@ -0,0 +1,25 @@ +Some text + + # Heading 1 {MD023} + + Setext style fully indented {MD023} + =================================== + + Setext style title only indented {MD023} +========================================= + +* Test situations in which MD023 shouldn't be triggered. + + ```rb + # This shouldn't trigger MD023 as it is a code comment. + foo = "And here is some code" + ``` + +* This is another case where MD023 shouldn't be triggered + # Test {MD022} Valid heading for CommonMark (see section 5.2) + # Test {MD022} {MD023} Also valid heading for CommonMark + + diff --git a/test/hr-in-blockquote-dash.md b/test/hr-in-blockquote-dash.md new file mode 100644 index 00000000..4da50c38 --- /dev/null +++ b/test/hr-in-blockquote-dash.md @@ -0,0 +1,39 @@ +# HR in Blockquote, Dash + +--- + +*** + +___ + +{MD035:5} {MD035:7} + +> Text +> +> --- +> +> *** +> +> ___ +> +> Text + +{MD035:15} {MD035:17} + +- - - + +> Text +> +> > Text +> > +> > --- +> > +> > *** +> > +> > ___ +> > +> > Text +> +> Text + +{MD035:23} {MD035:31} {MD035:33} diff --git a/test/hr-in-blockquote-star.md b/test/hr-in-blockquote-star.md new file mode 100644 index 00000000..298cb138 --- /dev/null +++ b/test/hr-in-blockquote-star.md @@ -0,0 +1,39 @@ +# HR in Blockquote, Star + +*** + +___ + +--- + +{MD035:5} {MD035:7} + +> Text +> +> --- +> +> *** +> +> ___ +> +> Text + +{MD035:13} {MD035:17} + +* * * + +> Text +> +> > Text +> > +> > --- +> > +> > *** +> > +> > ___ +> > +> > Text +> +> Text + +{MD035:23} {MD035:29} {MD035:33} diff --git a/test/hr-in-blockquote-under.md b/test/hr-in-blockquote-under.md new file mode 100644 index 00000000..2e2dccf1 --- /dev/null +++ b/test/hr-in-blockquote-under.md @@ -0,0 +1,39 @@ +# HR in Blockquote, Under + +___ + +--- + +*** + +{MD035:5} {MD035:7} + +> Text +> +> --- +> +> *** +> +> ___ +> +> Text + +{MD035:13} {MD035:15} + +_ _ _ + +> Text +> +> > Text +> > +> > --- +> > +> > *** +> > +> > ___ +> > +> > Text +> +> Text + +{MD035:23} {MD035:29} {MD035:31} diff --git a/test/hr-in-list-dash.md b/test/hr-in-list-dash.md new file mode 100644 index 00000000..cdca0b4a --- /dev/null +++ b/test/hr-in-list-dash.md @@ -0,0 +1,31 @@ +# HR in List, Dash + +--- + +*** + +___ + +{MD035:5} {MD035:7} + + + +- list +- --- +- list +- *** +- list +- ___ +- list + +{MD035:14} {MD035:16} {MD035:18} + +* list +* --- +* list +* *** +* list +* ___ +* list + +{MD035:26} {MD035:28} diff --git a/test/hr-in-list-star.md b/test/hr-in-list-star.md new file mode 100644 index 00000000..a962aa17 --- /dev/null +++ b/test/hr-in-list-star.md @@ -0,0 +1,31 @@ +# HR in List, Star + +*** + +___ + +--- + +{MD035:5} {MD035:7} + + + +- list +- --- +- list +- *** +- list +- ___ +- list + +{MD035:14} {MD035:18} + +* list +* --- +* list +* *** +* list +* ___ +* list + +{MD035:24} {MD035:26} {MD035:28} diff --git a/test/hr-in-list-under.md b/test/hr-in-list-under.md new file mode 100644 index 00000000..c9306e53 --- /dev/null +++ b/test/hr-in-list-under.md @@ -0,0 +1,31 @@ +# HR in List, Under + +___ + +--- + +*** + +{MD035:5} {MD035:7} + + + +- list +- --- +- list +- *** +- list +- ___ +- list + +{MD035:14} {MD035:16} + +* list +* --- +* list +* *** +* list +* ___ +* list + +{MD035:24} {MD035:26} diff --git a/test/hr-style-custom.md b/test/hr-style-custom.md new file mode 100644 index 00000000..ab4c7b3a --- /dev/null +++ b/test/hr-style-custom.md @@ -0,0 +1,28 @@ +# HR Style Custom + +Text + +--- +{MD035:5} + +Text + +- - - +{MD035:10} + +Text + +- - - + +Text + +*** +{MD035:19} + +Text + + diff --git a/test/hr_style_dashes.json b/test/hr_style_dashes.json deleted file mode 100644 index 950405e6..00000000 --- a/test/hr_style_dashes.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD035": { - "style": "---" - } -} diff --git a/test/hr_style_dashes.md b/test/hr_style_dashes.md index 9a692250..69e92d10 100644 --- a/test/hr_style_dashes.md +++ b/test/hr_style_dashes.md @@ -1,3 +1,5 @@ +# hr_style_dashes + *** * * * @@ -18,5 +20,11 @@ _____ *** -{MD035:1} {MD035:3} {MD035:5} {MD035:9} {MD035:11} {MD035:13} {MD035:15} -{MD035:17} {MD035:19} +{MD035:3} {MD035:5} {MD035:7} {MD035:11} {MD035:13} +{MD035:15} {MD035:17} {MD035:19} {MD035:21} + + diff --git a/test/hr_style_inconsistent.md b/test/hr_style_inconsistent.md index df3cc726..02070572 100644 --- a/test/hr_style_inconsistent.md +++ b/test/hr_style_inconsistent.md @@ -1,3 +1,5 @@ +# hr_style_inconsistent + *** * * * @@ -18,5 +20,4 @@ _____ *** -{MD035:3} {MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15} -{MD035:17} +{MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15} {MD035:17} {MD035:19} diff --git a/test/hr_style_long.json b/test/hr_style_long.json deleted file mode 100644 index deb61b30..00000000 --- a/test/hr_style_long.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD035": { - "style": "_____" - } -} diff --git a/test/hr_style_long.md b/test/hr_style_long.md index 0e9b1db2..c0bf9ade 100644 --- a/test/hr_style_long.md +++ b/test/hr_style_long.md @@ -1,3 +1,5 @@ +# hr_style_long + *** * * * @@ -18,5 +20,11 @@ _____ *** -{MD035:1} {MD035:3} {MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} -{MD035:15} {MD035:19} +{MD035:3} {MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15} +{MD035:17} {MD035:21} + + diff --git a/test/hr_style_stars.json b/test/hr_style_stars.json deleted file mode 100644 index eed96d15..00000000 --- a/test/hr_style_stars.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD035": { - "style": "***" - } -} diff --git a/test/hr_style_stars.md b/test/hr_style_stars.md index df3cc726..1f0344c3 100644 --- a/test/hr_style_stars.md +++ b/test/hr_style_stars.md @@ -1,3 +1,5 @@ +# hr_style_stars + *** * * * @@ -18,5 +20,10 @@ _____ *** -{MD035:3} {MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15} -{MD035:17} +{MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15} {MD035:17} {MD035:19} + + diff --git a/test/html-comment-in-code-and-table.md b/test/html-comment-in-code-and-table.md new file mode 100644 index 00000000..a2d77fc1 --- /dev/null +++ b/test/html-comment-in-code-and-table.md @@ -0,0 +1,43 @@ +# HTML Comment in Code and Table + +`{MD038} ` + + + +```text + +``` + + + +| Table | +|------------| +| `{MD038} ` | + +* item + + `{MD038} ` + +* item + + + +* item + + ```text + + ``` + +* item + + + +* item + + | Table | + |------------| + | `{MD038} ` | + + diff --git a/test/html-comment-in-list-item.md b/test/html-comment-in-list-item.md new file mode 100644 index 00000000..994b5ab0 --- /dev/null +++ b/test/html-comment-in-list-item.md @@ -0,0 +1,53 @@ +# HTML Comment in List Item + +- item + + + +- item + + x + +- item + + x + +- item + + xx + +- item + + ```html + + ``` + +- item + + ```html + x + ``` + +- item + + ```html + x + ``` + +- item + + ```html + xx + ``` + +- item diff --git a/test/html-comment-in-markdown-table.md b/test/html-comment-in-markdown-table.md new file mode 100644 index 00000000..09be40bb --- /dev/null +++ b/test/html-comment-in-markdown-table.md @@ -0,0 +1,58 @@ +# HTML Comment in Markdown Table + +```xml + +``` + +| Table | +|-------| +| | + +| Table | +|------------| +| | + +| Table | +|----------------| +| | +| cell | + +| Table | +|----------------| +| | +| cell | + +| Table | Table | +|-------|-------| +| cell | | + +| Table | Table | +|-------|------------| +| cell | | + +| Table | Table | +|-------|----------------| +| cell | | +| cell | cell | + +| Table | Table | +|-------|----------------| +| cell | | +| cell | cell | + + diff --git a/test/html-comments.md b/test/html-comments.md new file mode 100644 index 00000000..b486967d --- /dev/null +++ b/test/html-comments.md @@ -0,0 +1,59 @@ +# HTML Comments + +## Block Comments + + + + + +text + + + + + + + + + + *text * --> + + *text * --> + + + + + + + +## Inline Comments + + + +t + +ttext + + t + + t + +t + +t + +t *{MD037} * --> + +t *{MD037} * --> + +t + +t + +t diff --git a/test/html-tags.md b/test/html-tags.md new file mode 100644 index 00000000..10277ec2 --- /dev/null +++ b/test/html-tags.md @@ -0,0 +1,135 @@ +# Detailed HTML Results + +Text + +Block block {MD033} + +Text inline inline {MD033} text + +Text + +Block block + +Text inline inline text + +Text + +

+Block {MD033:17} +block block {MD033} block +block +block block block +block +block block block block block {MD033} +block block block block block {MD033} +

+ +Text + +Block block {MD033} + +Text inline inline {MD033} text + +Text + +Block block {MD033} + +Text inline inline {MD033} text + +Text + +Text inline text inline text inline text {MD033} + +Text inline text inline text inline {MD033} + +Text + +\Block block\ + +\\Block block {MD033}\\ + +Block block + +Text \inline inline\ text + +Text \\inline inline {MD033}\\ text + +Text inline inline text + +Text + +> Text inline inline {MD033} text +> text inline inline text + +Text + + Text inline inline text + text inline inline text + +Text + +```html +Text inline inline text +text inline inline text +``` + +Text + +`` + +Text ```` text + +Text `` text ```` text `````` text + +Text `` text inline {MD033} text + +Text ``text text`` text + +Text + +Text inline {MD033} text +text Description text {MD033} + +Text + + is an email autolink. + +Another email autolink: . + +Text + + is an HTML element. {MD033} + +But is not an autolink or HTML element. +And neither is . +Nor <123abc>. + +Text + +
+ +{MD033:109} + +
+ +- Item +
+ +{MD033:116} + + + +{MD033:120} + +Text text. + + diff --git a/test/hugo-quickstart-example-blank.md b/test/hugo-quickstart-example-blank.md new file mode 100644 index 00000000..c0c3945e --- /dev/null +++ b/test/hugo-quickstart-example-blank.md @@ -0,0 +1,14 @@ ++++ +date = "2016-02-14T16:11:58+05:30" +draft = true +title = "Good to Great Book Review" + ++++ + +# Heading 1 + + diff --git a/test/hugo-quickstart-example-clean.md b/test/hugo-quickstart-example-clean.md new file mode 100644 index 00000000..d8104779 --- /dev/null +++ b/test/hugo-quickstart-example-clean.md @@ -0,0 +1,13 @@ ++++ +date = "2016-02-14T16:11:58+05:30" +draft = true +title = "Good to Great Book Review" + ++++ +# Heading 1 + + diff --git a/test/hugo-quickstart-example-json.md b/test/hugo-quickstart-example-json.md new file mode 100644 index 00000000..44a21b39 --- /dev/null +++ b/test/hugo-quickstart-example-json.md @@ -0,0 +1,13 @@ +{ + "title": "Another Hugo Post", + "description": "Nothing special, but one post is boring.", + "date": "2014-09-02", + "categories": [ "example", "configuration" ], + "tags": [ + "example", + "hugo", + "toml" + ], +} + +# Heading {MD025} diff --git a/test/ignore-comments.md b/test/ignore-comments.md new file mode 100644 index 00000000..fac33e00 --- /dev/null +++ b/test/ignore-comments.md @@ -0,0 +1,46 @@ +# ignore-comments.md + +Hard tab {MD010} + +Hard tabs hard tabs {MD010} + + + + + + + + + +Text comment +Hard tab {MD010} +--> text + +Text + +Text {MD009} + +Text + +Text + +Text {MD009} + +Text + + + +Hard tab diff --git a/test/ignore-html-block.md b/test/ignore-html-block.md new file mode 100644 index 00000000..4bf4f033 --- /dev/null +++ b/test/ignore-html-block.md @@ -0,0 +1,13 @@ +# ignore-html-block.md + + diff --git a/test/inconsistent_bullet_indent_same_level.md b/test/inconsistent_bullet_indent_same_level.md index 1167d8ff..022aa9f4 100644 --- a/test/inconsistent_bullet_indent_same_level.md +++ b/test/inconsistent_bullet_indent_same_level.md @@ -1,4 +1,6 @@ +# Inconsistent Bullet Indent Same Level + * Item * Item {MD007} * Item {MD005} - * Item \ No newline at end of file + * Item diff --git a/test/inconsistent_bullet_styles_asterisk.md b/test/inconsistent_bullet_styles_asterisk.md index 9825cacb..378c7f49 100644 --- a/test/inconsistent_bullet_styles_asterisk.md +++ b/test/inconsistent_bullet_styles_asterisk.md @@ -1,3 +1,11 @@ +# inconsistent_bullet_styles_asterisk + * Item + Item {MD004} - - Item {MD004} \ No newline at end of file + - Item {MD004} + * Item + +> * Item +> + Item {MD004} +> - Item {MD004} +> * Item diff --git a/test/inconsistent_bullet_styles_dash.md b/test/inconsistent_bullet_styles_dash.md index 4f3b756e..8d243e28 100644 --- a/test/inconsistent_bullet_styles_dash.md +++ b/test/inconsistent_bullet_styles_dash.md @@ -1,3 +1,11 @@ +# inconsistent_bullet_styles_dash + - Item * Item {MD004} - + Item {MD004} \ No newline at end of file + + Item {MD004} + - Item + +> - Item +> * Item {MD004} +> + Item {MD004} +> - Item diff --git a/test/inconsistent_bullet_styles_plus.md b/test/inconsistent_bullet_styles_plus.md index bd4799f8..9a737276 100644 --- a/test/inconsistent_bullet_styles_plus.md +++ b/test/inconsistent_bullet_styles_plus.md @@ -1,3 +1,11 @@ +# inconsistent_bullet_styles_plus + + Item * Item {MD004} - - Item {MD004} \ No newline at end of file + - Item {MD004} + + Item + +> + Item +> * Item {MD004} +> - Item {MD004} +> + Item diff --git a/test/incorrect_bullet_style_asterisk.json b/test/incorrect_bullet_style_asterisk.json deleted file mode 100644 index acd390bd..00000000 --- a/test/incorrect_bullet_style_asterisk.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD004": { - "style": "asterisk" - } -} diff --git a/test/incorrect_bullet_style_asterisk.md b/test/incorrect_bullet_style_asterisk.md index dd6b3f0a..89caf2b9 100644 --- a/test/incorrect_bullet_style_asterisk.md +++ b/test/incorrect_bullet_style_asterisk.md @@ -1,3 +1,11 @@ +# incorrect_bullet_style_asterisk + * Item - Item {MD004} + Item {MD004} + + diff --git a/test/incorrect_bullet_style_dash.json b/test/incorrect_bullet_style_dash.json deleted file mode 100644 index c77c94bf..00000000 --- a/test/incorrect_bullet_style_dash.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD004": { - "style": "dash" - } -} diff --git a/test/incorrect_bullet_style_dash.md b/test/incorrect_bullet_style_dash.md index bfbbf91a..684384d0 100644 --- a/test/incorrect_bullet_style_dash.md +++ b/test/incorrect_bullet_style_dash.md @@ -1,3 +1,11 @@ +# incorrect_bullet_style_dash + * Item {MD004} - Item + Item {MD004} + + diff --git a/test/incorrect_bullet_style_plus.json b/test/incorrect_bullet_style_plus.json deleted file mode 100644 index 435f296c..00000000 --- a/test/incorrect_bullet_style_plus.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD004": { - "style": "plus" - } -} diff --git a/test/incorrect_bullet_style_plus.md b/test/incorrect_bullet_style_plus.md index 460a299d..4556f48f 100644 --- a/test/incorrect_bullet_style_plus.md +++ b/test/incorrect_bullet_style_plus.md @@ -1,3 +1,11 @@ +# incorrect_bullet_style_plus + * Item {MD004} - Item {MD004} + Item + + diff --git a/test/incorrect_header_atx.json b/test/incorrect_header_atx.json deleted file mode 100644 index aa2692a1..00000000 --- a/test/incorrect_header_atx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD003": { - "style": "atx" - } -} diff --git a/test/incorrect_header_atx.md b/test/incorrect_header_atx.md deleted file mode 100644 index 024a90e0..00000000 --- a/test/incorrect_header_atx.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 {MD003} # - -## Header 2 - -Header 3 {MD003} ----------------- diff --git a/test/incorrect_header_atx_closed.json b/test/incorrect_header_atx_closed.json deleted file mode 100644 index a7764db7..00000000 --- a/test/incorrect_header_atx_closed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD003": { - "style": "atx_closed" - } -} diff --git a/test/incorrect_header_atx_closed.md b/test/incorrect_header_atx_closed.md deleted file mode 100644 index 154fd35e..00000000 --- a/test/incorrect_header_atx_closed.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 # - -## Header 2 {MD003} - -Header 3 {MD003} ----------------- diff --git a/test/incorrect_header_setext.json b/test/incorrect_header_setext.json deleted file mode 100644 index 0a9cf563..00000000 --- a/test/incorrect_header_setext.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD003": { - "style": "setext" - } -} diff --git a/test/incorrect_header_setext.md b/test/incorrect_header_setext.md deleted file mode 100644 index f34ef6c9..00000000 --- a/test/incorrect_header_setext.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 {MD003} # - -## Header 2 {MD003} - -Header 3 --------- diff --git a/test/incorrect_heading_atx.md b/test/incorrect_heading_atx.md new file mode 100644 index 00000000..9e386e8f --- /dev/null +++ b/test/incorrect_heading_atx.md @@ -0,0 +1,12 @@ +# Heading 1 {MD003} # + +## Heading 2 + +Heading 3 {MD003} +----------------- + + diff --git a/test/incorrect_heading_atx_closed.md b/test/incorrect_heading_atx_closed.md new file mode 100644 index 00000000..9d1f9399 --- /dev/null +++ b/test/incorrect_heading_atx_closed.md @@ -0,0 +1,12 @@ +# Heading 1 # + +## Heading 2 {MD003} + +Heading 3 {MD003} +----------------- + + diff --git a/test/incorrect_heading_setext.md b/test/incorrect_heading_setext.md new file mode 100644 index 00000000..fcc7b2a7 --- /dev/null +++ b/test/incorrect_heading_setext.md @@ -0,0 +1,12 @@ +# Heading 1 {MD003} # + +## Heading 2 {MD003} + +Heading 3 +--------- + + diff --git a/test/inline-capture-restore.md b/test/inline-capture-restore.md new file mode 100644 index 00000000..17ad3932 --- /dev/null +++ b/test/inline-capture-restore.md @@ -0,0 +1,122 @@ +# Inline Capture/Restore + +hard tab +space *in * emphasis {MD037} +space `in ` code {MD038} + + +hard tab +space *in * emphasis +space `in ` code + + +hard tab +space *in * emphasis {MD037} +space `in ` code {MD038} + + + +hard tab +space *in * emphasis +space `in ` code {MD038} + + +hard tab +space *in * emphasis +space `in ` code + + +hard tab +space *in * emphasis {MD037} +space `in ` code {MD038} + + + +hard tab +space *in * emphasis +space `in ` code {MD038} + + + +hard tab +space *in * emphasis +space `in ` code + + +hard tab +space *in * emphasis +space `in ` code {MD038} + + + +hard tab {MD010} +space *in * emphasis +space `in ` code {MD038} + + + +hard tab +space *in * emphasis +space `in ` code {MD038} + + + +hard tab {MD010} +space *in * emphasis +space `in ` code {MD038} + + + +hard tab {MD010} +space *in * emphasis +space `in ` code {MD038} + + + +hard tab {MD010} +space *in * emphasis +space `in ` code {MD038} + + + +hard tab {MD010} +space *in * emphasis {MD037} +space `in ` code {MD038} + + + +hard tab {MD010} +space *in * emphasis +space `in ` code {MD038} + + + +hard tab {MD010} +space *in * emphasis +space `in ` code + + +hard tab +space *in * emphasis +space `in ` code + + +hard tab {MD010} +space *in * emphasis +space `in ` code + + + +hard tab +space *in * emphasis +space `in ` code + + + +hard tab {MD010} +space *in * emphasis {MD037} +space `in ` code + + diff --git a/test/inline-configure-file-invalid.md b/test/inline-configure-file-invalid.md new file mode 100644 index 00000000..380e5fbc --- /dev/null +++ b/test/inline-configure-file-invalid.md @@ -0,0 +1,5 @@ +# Inline Configure File Invalid + +Not normally too long of a line, but it would have been from an inline config. + + diff --git a/test/inline-configure-file-multiple-instances.md b/test/inline-configure-file-multiple-instances.md new file mode 100644 index 00000000..5be93d36 --- /dev/null +++ b/test/inline-configure-file-multiple-instances.md @@ -0,0 +1,33 @@ +# Inline Configure File Multiple Instances + +*** +{MD035:3} + +Trailing spaces: + + + +*** +{MD035:17} + +Trailing spaces: + + + +*** +{MD035:30} + +Trailing spaces: diff --git a/test/inline-configure-file-multiple-lines.md b/test/inline-configure-file-multiple-lines.md new file mode 100644 index 00000000..c7abf263 --- /dev/null +++ b/test/inline-configure-file-multiple-lines.md @@ -0,0 +1,20 @@ +# Inline Configure File Multiple Lines + +*** +{MD035:3} + +Trailing spaces: + + + +*** +{MD035:17} + +Trailing spaces: diff --git a/test/inline-configure-file-single-line.md b/test/inline-configure-file-single-line.md new file mode 100644 index 00000000..87a4bf56 --- /dev/null +++ b/test/inline-configure-file-single-line.md @@ -0,0 +1,5 @@ +# Inline Configure File Single Line + +Not normally too long of a line, but it is here from an inline config. {MD013} + + {MD013} diff --git a/test/inline-configure-file-violations.md b/test/inline-configure-file-violations.md new file mode 100644 index 00000000..8fbfd820 --- /dev/null +++ b/test/inline-configure-file-violations.md @@ -0,0 +1,10 @@ +# Inline Configure File Violations + +Emphasis * with * spaces {MD037} + +Trailing spaces: + + diff --git a/test/inline-disable-enable-file.md b/test/inline-disable-enable-file.md new file mode 100644 index 00000000..00e05a8f --- /dev/null +++ b/test/inline-disable-enable-file.md @@ -0,0 +1,36 @@ +# Heading + +hard tab {MD010} + +space *in * emphasis {MD037} + +space `in ` code + + + +hard tab + +space *in * emphasis {MD037} + +space `in ` code + + + +hard tab + +space *in * emphasis {MD037} + +space `in ` code {MD038} + + + + +hard tab + +space *in * emphasis {MD037} + +space `in ` code {MD038} + + diff --git a/test/inline-disable-enable.md b/test/inline-disable-enable.md new file mode 100644 index 00000000..739d5baa --- /dev/null +++ b/test/inline-disable-enable.md @@ -0,0 +1,107 @@ +# Heading + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + + + +hard tab / space *in * emphasis / space `in ` code + + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + + + +hard tab / space *in * emphasis {MD037} / space `in ` code {MD038} + + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + + + +hard tab / space *in * emphasis {MD037} / space `in ` code + + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +before after + +hard tab / space *in * emphasis {MD037} / space `in ` code + +beforeafter + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + + + +hard tab / space *in * emphasis {MD037} / space `in ` code + + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab {MD010} + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + + +hard tab / space *in * emphasis / space `in ` code + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +embedded {MD033} HTML + + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab / space *in * emphasis / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} +hard tab / space *in * emphasis / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab / space *in * emphasis {MD037} / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab / space *in * emphasis {MD037} / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab / space *in * emphasis {MD037} / space `in ` code +hard tab / space *in * emphasis {MD037} / space `in ` code {MD038} + + +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} +hard tab / space *in * emphasis / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} +hard tab / space *in * emphasis / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + hard tab / space *in * emphasis / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} +hard tab / space *in * emphasis {MD037} / space `in ` code +hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038} + +hard tab / space *in * emphasis {MD037} / space `in ` code {MD038} +hard tab / space *in * emphasis {MD037} / space `in ` code +hard tab / space *in * emphasis {MD037} / space `in ` code {MD038} + + \ No newline at end of file diff --git a/test/inline_html-allowed_elements.md b/test/inline_html-allowed_elements.md new file mode 100644 index 00000000..f1f5f782 --- /dev/null +++ b/test/inline_html-allowed_elements.md @@ -0,0 +1,71 @@ +# inline_html-allowed_elements + +

This is allowed.

+ +

This is not allowed. {MD033}

+ +

This is allowed.

+ +

This

is not

allowed. {MD033} + +

This

is not

allowed. {MD033} + +
+ +
+ +
{MD033} + +
{MD033} + +
{MD033} + +
{MD033} + +
{MD033} + +
{MD033} + +
{MD033} + +
{MD033} + +

+This is allowed. +

+ +
{MD033} +This is not allowed. +
+ +

+

{MD033} +This is not allowed. +
+
+
{MD033} +

+ +

+

{MD033} +This is not allowed. +
+
+
{MD033} +

+ +| Allowed | Not Allowed | +| ------- | ------------ | +|

| | +| |
{MD033} | + + diff --git a/test/inline_html-only_table_allowed_elements.md b/test/inline_html-only_table_allowed_elements.md new file mode 100644 index 00000000..a9594d82 --- /dev/null +++ b/test/inline_html-only_table_allowed_elements.md @@ -0,0 +1,27 @@ +# inline_html-only_table_allowed_elements.md + +

This is not allowed {MD033}

+ +
This is not allowed {MD033} + +
This is not allowed {MD033} + +| Allowed | Not Allowed | +| ------------------- | ------------------ | +|
| | +|
| | +|
| | +| |

{MD033}

| + + {MD033} +
{MD033} +
+ + diff --git a/test/inline_html-table_allowed_elements.md b/test/inline_html-table_allowed_elements.md new file mode 100644 index 00000000..45129674 --- /dev/null +++ b/test/inline_html-table_allowed_elements.md @@ -0,0 +1,33 @@ +# inline_html-table_allowed_elements.md + +

This is allowed

+ +

This is not allowed {MD033}

+ +
This is not allowed {MD033} + +
This is not allowed {MD033} + +| Allowed | Not Allowed | +| ------------------- | ------------------ | +|
| | +|
| | +|
| | +| |

{MD033}

| + + +
{MD033} +
+ + diff --git a/test/inline_html.md b/test/inline_html.md index 5759f00f..b63a35c2 100644 --- a/test/inline_html.md +++ b/test/inline_html.md @@ -1,6 +1,6 @@ -# Regular header +# Regular heading -

Inline HTML Header {MD033}

+

Inline HTML Heading {MD033}

More inline HTML {MD033} but this time on multiple lines @@ -9,5 +9,125 @@ but this time on multiple lines

This shouldn't trigger as it's inside a code block

```text -

Neither should this as it's also in a code block

+

Neither should this as it's also in a code block {MD046:11}

``` + +## Elements in code spans + +Text `` text \` text +Text \` text `` text +Text \` text \` text `` text +Text \` text `` text `` text +Text \` text `` text \` text `` text +Text \`\` text `` text +Text `` text \` text `` text + +## Elements in multiple line code spans + +Text `code +` + +`code +` + +`code +` text + +Text `code +code + +` + +``code ``` ```` ` +code +`` + +Text `code + +code` text + +Text `code code +code ` text + +Text `code +code code` text + +Text `code code +code code +code code` text + +Text ````code code +code code +code code```` text + +Text `code code +code ` text +text `code code +code code` text + +Text `code code +code code` text +text `code code +code ` text + +Text `code code +code ` text +text `code code +code ` text + +Text `code code +code` text text `code {MD033} +code code` text + +## Slash in element name + +Text **\\another\directory\\** text + +## Self-closing elements + +
{MD033} + +
{MD033} + +## Links + +Google {MD033} + +Google {MD033} + +Google {MD033} + +## Unterminated code span followed by element in code span + +Text text `text text + +Text `` text + +Text +text `text +text + +Text `code code` text + +Text `code code` text {MD038} + +```lang +code {MD046:114} + + +``` + +Text `code code` text + +Text text {MD033} + +A [][a-reference] is problematic. {MD033} + +A [link with][a-] is okay. + +A link with [a-][] is problematic. {MD033} + +A link with [a-] is problematic. {MD033} + +[a-reference]: https://example.com/ +[a-]: https://example.com/ diff --git a/test/invalid-ul-style-style.md b/test/invalid-ul-style-style.md new file mode 100644 index 00000000..031d6f91 --- /dev/null +++ b/test/invalid-ul-style-style.md @@ -0,0 +1,16 @@ +# Invalid ul-style style + +* Item {MD004} + * Item {MD004} + ++ Item {MD004} + + Item {MD004} + +- Item + - Item + + diff --git a/test/jekyll_post.md b/test/jekyll_post.md new file mode 100644 index 00000000..1988a40d --- /dev/null +++ b/test/jekyll_post.md @@ -0,0 +1,16 @@ +--- +layout: post +title: Hello World! +category: Meta +tags: +- tag +- another tag +- one more tag +url: https://example.com +excerpt: Hello World! Vestibulum imperdiet adipiscing arcu, quis aliquam dolor condimentum dapibus. Aliquam fermentum leo aliquet quam volutpat et molestie mauris mattis. Suspendisse semper consequat velit in suscipit. +--- +# heading1 {MD025} + +This is just a sample post. + +### offending heading3 {MD001} diff --git a/test/jekyll_post_2.md b/test/jekyll_post_2.md new file mode 100644 index 00000000..a735ade8 --- /dev/null +++ b/test/jekyll_post_2.md @@ -0,0 +1,17 @@ +--- +layout: post +title: Hello World! +category: Meta +tags: +- tag +- another tag +- one more tag +url: http://example.com +excerpt: Hello World! Vestibulum imperdiet adipiscing arcu, quis aliquam dolor condimentum dapibus. Aliquam fermentum leo aliquet quam volutpat et molestie mauris mattis. Suspendisse semper consequat velit in suscipit. +--- + +# header1 {MD025} + +This is just a sample post. + +### offending header3 {MD001} diff --git a/test/line-breaks-inside-code-spans.md b/test/line-breaks-inside-code-spans.md new file mode 100644 index 00000000..eff1e069 --- /dev/null +++ b/test/line-breaks-inside-code-spans.md @@ -0,0 +1,73 @@ +# Line breaks inside code spans + +Text `code +span` text. + +Text `code +span` text `code +span` text. + +Text `code +span` text `code +span` text `code +span` text. + +Text `code +span +code +span` text. + +Text `code +span` text `code span` +text `code span` text. + +Text `code +span` text `code span` text +`code span` text. + +`code +span` `span` +`span` + +Text +text ` code {MD038} +span` text +text. + +Text +text `code +span ` text {MD038} +text. + +Text +text `code +span code +span` text +text. + +Text +text ` code {MD038} +span code +span` text +text. + +Text +text `code +span code +span ` text {MD038} +text. + +Text +text `code +span code +span ` text {MD038} +text +text ` code {MD038} +span code +span` text +text. + +" +Text `code +code code `text` {MD038} diff --git a/test/link-fragments-default-case.md b/test/link-fragments-default-case.md new file mode 100644 index 00000000..c8d4f509 --- /dev/null +++ b/test/link-fragments-default-case.md @@ -0,0 +1,23 @@ +# Link Fragments Default Case + +## Heading Name + +[Valid](#heading-name) + +[Invalid](#Heading-Name) {MD051} + +## Valid *Heading* With _Emphasis_ + +[Valid](#valid-heading-with-emphasis) + +[Invalid](#Valid-Heading-With-Emphasis) {MD051} + +## 🚀 Valid Heading With Emoji + +[Valid](#-valid-heading-with-emoji) + +[Invalid](#-Valid-Heading-With-Emoji) {MD051} + + diff --git a/test/link-fragments-ignore-case.md b/test/link-fragments-ignore-case.md new file mode 100644 index 00000000..9be8298f --- /dev/null +++ b/test/link-fragments-ignore-case.md @@ -0,0 +1,26 @@ +# Link Fragments Ignore Case + +## Heading Name + +[Valid](#heading-name) + +[Valid](#Heading-Name) + +## Valid *Heading* With _Emphasis_ + +[Valid](#valid-heading-with-emphasis) + +[Valid](#Valid-Heading-With-Emphasis) + +## 🚀 Valid Heading With Emoji + +[Valid](#-valid-heading-with-emoji) + +[Valid](#-Valid-Heading-With-Emoji) + + diff --git a/test/link-fragments-ignored-pattern-default.md b/test/link-fragments-ignored-pattern-default.md new file mode 100644 index 00000000..e7cd0fae --- /dev/null +++ b/test/link-fragments-ignored-pattern-default.md @@ -0,0 +1,9 @@ +# Link Fragments Ignored Pattern Default + +## Heading + +[Present](#heading) + +[Ignored](#ignored) {MD051} + +[Missing](#missing) {MD051} diff --git a/test/link-fragments-ignored-pattern-empty.md b/test/link-fragments-ignored-pattern-empty.md new file mode 100644 index 00000000..93d668cd --- /dev/null +++ b/test/link-fragments-ignored-pattern-empty.md @@ -0,0 +1,15 @@ +# Link Fragments Ignored Pattern Empty + +## Heading + +[Present](#heading) + +[Ignored](#ignored) {MD051} + +[Missing](#missing) {MD051} + + diff --git a/test/link-fragments-ignored-pattern-multiple.md b/test/link-fragments-ignored-pattern-multiple.md new file mode 100644 index 00000000..169914b5 --- /dev/null +++ b/test/link-fragments-ignored-pattern-multiple.md @@ -0,0 +1,15 @@ +# Link Fragments Ignored Pattern Multiple + +## Heading + +[Present](#heading) + +[Ignored](#ignored) + +[Missing](#missing) + + diff --git a/test/link-fragments-ignored-pattern-present.md b/test/link-fragments-ignored-pattern-present.md new file mode 100644 index 00000000..5449c759 --- /dev/null +++ b/test/link-fragments-ignored-pattern-present.md @@ -0,0 +1,15 @@ +# Link Fragments Ignored Pattern Present + +## Heading + +[Present](#heading) + +[Ignored](#ignored) + +[Missing](#missing) {MD051} + + diff --git a/test/link-fragments.md b/test/link-fragments.md new file mode 100644 index 00000000..7d5a356e --- /dev/null +++ b/test/link-fragments.md @@ -0,0 +1,346 @@ +# Valid/Invalid Link Fragments + +## Valid Fragments + +[Valid](#validinvalid-link-fragments) + +[Valid](#valid-fragments) + +[Valid](#valid-h3-heading) + +[Valid](#valid-heading-with-underscores-_) + +[Valid](#valid-heading-with-emphasis) + +[Valid](#valid-heading-with-code) + +[Valid](#valid-heading-with-quotes--and-double-quotes-) + +[Valid](#-valid-heading-with-emoji) + +[Valid](#valid-heading--with-emoji-2) + +[Valid](#valid-heading-2010-) + +[Valid](#valid-heading-2004-%EF%B8%8F) + +[Valid](#valid-closed-atx-heading) + +[Valid](#valid-setext-heading) + +[Valid](#valid-repeated-heading) + +[Valid](#valid-repeated-heading-1) + +[Valid](#valid-repeated-heading-2) + +[Valid](#valid-heading-with-trailing-space-) + +[Valid](#valid-heading-with-two-trailing-spaces--) + +[Valid](#valid-heading-with-embedded--comment) + +[Valid](#the-best-headin-for-testin-quotes) + +[Valid](#valid-heading-about-lh%C3%B4pitals-rule) + +[Valid](#valid-heading-about-lhôpitals-rule) + +[Valid](#en-t%C3%AAte-valide-dans-fran%C3%A7ais-pour-v%C3%A9rification) + +[Valid](#en-tête-valide-dans-français-pour-vérification) + +[Valid](#%E6%A0%87%E9%A2%98) + +[Valid](#标题) + +[Valid](#valid-heading-is-a-link) + +[Valid](#valid-heading-has-a-link) + +[Valid](#valid-heading-is-a-reference-link) + +[Valid](#valid-heading-has-a-reference-link) + +[Valid](#valid-heading-has-) + +[Valid](#valid_heading-escaped_underscores) + +[Valid](#valid\_heading\-escaped\_underscores) + +[Valid](#valid-heading-with_embedded_escaping) + +[Valid](#namedlink) + +[Valid](#idlink) + +[Valid](#myident) + +[Valid](#HREFandID) + +[Valid](#id-for-other-element) + +[Valid](#id-after-name) + +[Valid][goodref] + +[Valid][escapedref] + +[Valid](#l12-not-a-line-link) + +[Valid](#latex-style) + +[Valid](#area-pi--r2) + +[Valid](#L7) + +[Valid](#L30-L31) + +[Valid](#L3C24-L88) + +[Valid](#L304-L314C98) + +[Valid](#L200C4-L3244C2) + +### Valid H3 Heading + +Text + +### Valid Heading With Underscores _ + +Text + +### Valid *Heading* With _Emphasis_ + +Text + +### Valid Heading With `Code` + +Text + +### Valid Heading With Quotes ' And Double Quotes " + +Text + +### 🚀 Valid Heading With Emoji + +Text + +### Valid Heading 👀 With Emoji 2 + +Text + +### Valid Heading 20.10 ❌ + +Text + +### Valid Heading 20.04 ✔️ + +Text + +### Valid Closed ATX Heading ### + +Text + +Valid Setext Heading +-------------------- + +Text + +### Valid Repeated Heading + +Text + +### Valid Repeated Heading + +Text + +### Valid Repeated Heading + +### Valid Heading With Trailing Space + +### Valid Heading With Two Trailing Spaces + +### Valid Heading With Embedded Comment + +### The "Best" Headin' for Testin' Quotes + +### Valid Heading About L'Hôpital's Rule + +### En-tête Valide Dans Français Pour Vérification + +### 标题 + +### [Valid Heading Is a Link](https://example.com) + +### Valid Heading [Has a Link](https://example.com) + +### [Valid Heading Is a Reference Link][goodref] + +### Valid Heading [Has a Reference Link][goodref] + +### ![Valid Heading Is an Image](https://example.com) + +### Valid Heading Has ![an Image](https://example.com) + +### Valid_Heading Escaped_Underscores + +### Valid Heading\-With\_Embedded\_Escaping + +### L12 Not A Line Link + +## $\LaTeX$ Style + +## Area: $\pi * r^2$ + + + + + + + +Text + +

+ +

+ + + + + +[goodref]: #namedlink + +[escapedref]: #valid\_heading\-escaped\_underscores + +## Invalid Fragments + +[Invalid](#valid-heading-is-an-image) {MD051} + +[Invalid](#valid-heading-2004-) {MD051} + +[Invalid](#valid-repeated-heading-3) {MD051} + +[Invalid](#invalid-fragment) {MD051} + +[Invalid](#myname) {MD051} + +[Invalid](#hrefandid) {MD051} + +[Invalid](#name-for-other-element) {MD051} + +[Invalid](#name-should-be-ignored) {MD051} + +[Invalid](#not-an-id-should-be-ignored) {MD051} + +[Invalid {MD051}](#multi-line +"Title") + +[Invalid][badref] + +[badref]: #missing "{MD051}" + +## Inconsistent Case Fragments + +[Title](#Valid-Fragments) {MD051} + +[ALL CAPS](#NAMEDLINK) {MD051} + +[Multi-line {MD051}](#NAMEDLINK +"Title") + +[MiXeD][mixedref] + +[mixedref]: #idLINK "{MD051}" + +## Valid Named Fragments + +[Valid](#named-fragment) + +[Valid](#valid-heading-with-named-fragment-named-fragment) + +[Valid](#another_fragment_123) + +[Valid](#valid-heading-with-another-named-fragment-another_fragment_123) + +[Valid](#closed-atx) + +[Valid](#setext) + +### Valid Heading with Named Fragment {#named-fragment} + +### Valid Heading with Another Named Fragment {#another_fragment_123} + +### Valid Closed ATX Heading with Named Fragment {#closed-atx} ### + +Valid Setext Heading with Named Fragment {#setext} +-------------------------------------------------- + +## Invalid Named Fragments + +### Invalid Heading with Named Fragment {#embedded space} + +### Invalid Heading with Named Fragment {#hyphen--run} + +### Invalid Heading with Named Fragment {#UpperCase} + +{#named-fragment-outside-heading} + +[Invalid](#embedded-space) {MD051} + +[Invalid](#embedded_space) {MD051} + +[Invalid](#embedded) {MD051} + +[Invalid](#hyphen--run) {MD051} + +[Invalid](#hyphen-run) {MD051} + +[Invalid](#named-fragment-outside-heading) {MD051} + +[Invalid](#UpperCase) {MD051} + +[Invalid](#uppercase) {MD051} + +[Invalid](#L12-not-a-line-link) {MD051} + +[Invalid](#l7) {MD051} + +[Invalid](#L) {MD051} + +[Invalid](#L7extra) {MD051} + +[Invalid](#L30C) {MD051} + +[Invalid](#L30Cextra) {MD051} + +[Invalid](#L30L12) {MD051} + +[Invalid](#L30C12) {MD051} + +[Invalid](#L30C11-) {MD051} + +[Invalid](#L30C11-L) {MD051} + +[Invalid](#L30C11-L31C) {MD051} + +[Invalid](#L30C11-C31) {MD051} + +[Invalid](#C30) {MD051} + +[Invalid](#C11-C31) {MD051} + +[Invalid](#C11-L4C31) {MD051} + +## Implicit Fragments + +[Valid](#top) + +[Invalid](#ToP) {MD051} + + diff --git a/test/link-style-autolink-only.md b/test/link-style-autolink-only.md new file mode 100644 index 00000000..f8568d55 --- /dev/null +++ b/test/link-style-autolink-only.md @@ -0,0 +1,92 @@ +# Link Style Autolink Only + +Text [url](https://example.com) text {MD054} + +Text ![url](https://example.com) text {MD054} + +Text [url]() text {MD054} + +Text ![url]() text {MD054} + +Text [url](https://example.com "title") text {MD054} + +Text ![url](https://example.com "title") text {MD054} + +Text {MD054} [url](https://example.com +"title") text + +Text {MD054} ![url](https://example.com +"title") text + +Text [text][url] text {MD054} + +Text ![text][url] text {MD054} + +Text [url][] text {MD054} + +Text ![url][] text {MD054} + +Text [url] text {MD054} + +Text ![url] text {MD054} + +Text text + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text {MD054} + +Text [url](https://example.com/backslash\[escape) text {MD054} + +Text [embedded-backslash] text {MD054} + +Text [backslash-escape] text {MD054} + +Text text + +Text text + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text {MD054} + +Text [url]() text {MD054} + +Text [url](https://example.com/\(parens\)) text {MD054} + +Text [url](https://example.com/pa(re(ns))) text {MD054} + +Text [url](relative/path) text {MD054} + +Text [url](#fragment) text {MD054} + +Text text + +Text [url](https://example.com/an>g) text {MD054} + +Text text + +Text [user@example.com](user@example.com) text {MD054} + +Text [user@example.com][email] text {MD054} + +Text [email][] text {MD054} + +Text [email] text {MD054} + +[email]: user@example.com + + diff --git a/test/link-style-autolink-or-inline.md b/test/link-style-autolink-or-inline.md new file mode 100644 index 00000000..cd26d30f --- /dev/null +++ b/test/link-style-autolink-or-inline.md @@ -0,0 +1,91 @@ +# Link Style Autolink or Inline + +Text [url](https://example.com) text + +Text ![url](https://example.com) text + +Text [url]() text + +Text ![url]() text + +Text [url](https://example.com "title") text + +Text ![url](https://example.com "title") text + +Text [url](https://example.com +"title") text + +Text ![url](https://example.com +"title") text + +Text [text][url] text {MD054} + +Text ![text][url] text {MD054} + +Text [url][] text {MD054} + +Text ![url][] text {MD054} + +Text [url] text {MD054} + +Text ![url] text {MD054} + +Text text + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text + +Text [url](https://example.com/backslash\[escape) text + +Text [embedded-backslash] text {MD054} + +Text [backslash-escape] text {MD054} + +Text text + +Text text + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text + +Text [url]() text + +Text [url](https://example.com/\(parens\)) text + +Text [url](https://example.com/pa(re(ns))) text + +Text [url](relative/path) text + +Text [url](#fragment) text + +Text text + +Text [url](https://example.com/an>g) text + +Text text + +Text [user@example.com](user@example.com) text + +Text [user@example.com][email] text {MD054} + +Text [email][] text {MD054} + +Text [email] text {MD054} + +[email]: user@example.com + + diff --git a/test/link-style-autolink-or-reference.md b/test/link-style-autolink-or-reference.md new file mode 100644 index 00000000..28beb9b4 --- /dev/null +++ b/test/link-style-autolink-or-reference.md @@ -0,0 +1,88 @@ +# Link Style Autolink or Reference + +Text [url](https://example.com) text {MD054} + +Text ![url](https://example.com) text {MD054} + +Text [url]() text {MD054} + +Text ![url]() text {MD054} + +Text [url](https://example.com "title") text {MD054} + +Text ![url](https://example.com "title") text {MD054} + +Text {MD054} [url](https://example.com +"title") text + +Text {MD054} ![url](https://example.com +"title") text + +Text [text][url] text + +Text ![text][url] text + +Text [url][] text + +Text ![url][] text + +Text [url] text + +Text ![url] text + +Text text + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text {MD054} + +Text [url](https://example.com/backslash\[escape) text {MD054} + +Text [embedded-backslash] text + +Text [backslash-escape] text + +Text text + +Text text + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text {MD054} + +Text [url]() text {MD054} + +Text [url](https://example.com/\(parens\)) text {MD054} + +Text [url](https://example.com/pa(re(ns))) text {MD054} + +Text [url](relative/path) text {MD054} + +Text [url](#fragment) text {MD054} + +Text text + +Text [url](https://example.com/an>g) text {MD054} + +Text text + +Text [user@example.com](user@example.com) text {MD054} + +Text [user@example.com][email] text + +Text [email][] text + +Text [email] text + +[email]: user@example.com + + diff --git a/test/link-style-collapsed-only.md b/test/link-style-collapsed-only.md new file mode 100644 index 00000000..e25f7e8d --- /dev/null +++ b/test/link-style-collapsed-only.md @@ -0,0 +1,91 @@ +# Link Style Collapsed Only + +Text [url](https://example.com) text {MD054} + +Text ![url](https://example.com) text {MD054} + +Text [url]() text {MD054} + +Text ![url]() text {MD054} + +Text [url](https://example.com "title") text {MD054} + +Text ![url](https://example.com "title") text {MD054} + +Text {MD054} [url](https://example.com +"title") text + +Text {MD054} ![url](https://example.com +"title") text + +Text [text][url] text {MD054} + +Text ![text][url] text {MD054} + +Text [url][] text + +Text ![url][] text + +Text [url] text {MD054} + +Text ![url] text {MD054} + +Text text {MD054} + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text {MD054} + +Text [url](https://example.com/backslash\[escape) text {MD054} + +Text [embedded-backslash] text {MD054} + +Text [backslash-escape] text {MD054} + +Text text {MD054} + +Text text {MD054} + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text {MD054} + +Text [url]() text {MD054} + +Text [url](https://example.com/\(parens\)) text {MD054} + +Text [url](https://example.com/pa(re(ns))) text {MD054} + +Text [url](relative/path) text {MD054} + +Text [url](#fragment) text {MD054} + +Text text {MD054} + +Text [url](https://example.com/an>g) text {MD054} + +Text text {MD054} + +Text [user@example.com](user@example.com) text {MD054} + +Text [user@example.com][email] text {MD054} + +Text [email][] text + +Text [email] text {MD054} + +[email]: user@example.com + + diff --git a/test/link-style-full-only.md b/test/link-style-full-only.md new file mode 100644 index 00000000..8a741d56 --- /dev/null +++ b/test/link-style-full-only.md @@ -0,0 +1,91 @@ +# Link Style Full Only + +Text [url](https://example.com) text {MD054} + +Text ![url](https://example.com) text {MD054} + +Text [url]() text {MD054} + +Text ![url]() text {MD054} + +Text [url](https://example.com "title") text {MD054} + +Text ![url](https://example.com "title") text {MD054} + +Text {MD054} [url](https://example.com +"title") text + +Text {MD054} ![url](https://example.com +"title") text + +Text [text][url] text + +Text ![text][url] text + +Text [url][] text {MD054} + +Text ![url][] text {MD054} + +Text [url] text {MD054} + +Text ![url] text {MD054} + +Text text {MD054} + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text {MD054} + +Text [url](https://example.com/backslash\[escape) text {MD054} + +Text [embedded-backslash] text {MD054} + +Text [backslash-escape] text {MD054} + +Text text {MD054} + +Text text {MD054} + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text {MD054} + +Text [url]() text {MD054} + +Text [url](https://example.com/\(parens\)) text {MD054} + +Text [url](https://example.com/pa(re(ns))) text {MD054} + +Text [url](relative/path) text {MD054} + +Text [url](#fragment) text {MD054} + +Text text {MD054} + +Text [url](https://example.com/an>g) text {MD054} + +Text text {MD054} + +Text [user@example.com](user@example.com) text {MD054} + +Text [user@example.com][email] text + +Text [email][] text {MD054} + +Text [email] text {MD054} + +[email]: user@example.com + + diff --git a/test/link-style-inline-only.md b/test/link-style-inline-only.md new file mode 100644 index 00000000..11123d91 --- /dev/null +++ b/test/link-style-inline-only.md @@ -0,0 +1,92 @@ +# Link Style Inline Only + +Text [url](https://example.com) text + +Text ![url](https://example.com) text + +Text [url]() text + +Text ![url]() text + +Text [url](https://example.com "title") text + +Text ![url](https://example.com "title") text + +Text [url](https://example.com +"title") text + +Text ![url](https://example.com +"title") text + +Text [text][url] text {MD054} + +Text ![text][url] text {MD054} + +Text [url][] text {MD054} + +Text ![url][] text {MD054} + +Text [url] text {MD054} + +Text ![url] text {MD054} + +Text text {MD054} + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text + +Text [url](https://example.com/backslash\[escape) text + +Text [embedded-backslash] text {MD054} + +Text [backslash-escape] text {MD054} + +Text text {MD054} + +Text text {MD054} + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text + +Text [url]() text + +Text [url](https://example.com/\(parens\)) text + +Text [url](https://example.com/pa(re(ns))) text + +Text [url](relative/path) text + +Text [url](#fragment) text + +Text text {MD054} + +Text [url](https://example.com/an>g) text + +Text text {MD054} + +Text [user@example.com](user@example.com) + +Text [user@example.com][email] text {MD054} + +Text [email][] text {MD054} + +Text [email] text {MD054} + +[email]: user@example.com + + diff --git a/test/link-style-inline-or-reference.md b/test/link-style-inline-or-reference.md new file mode 100644 index 00000000..a957bd15 --- /dev/null +++ b/test/link-style-inline-or-reference.md @@ -0,0 +1,88 @@ +# Link Style Inline or Reference + +Text [url](https://example.com) text + +Text ![url](https://example.com) text + +Text [url]() text + +Text ![url]() text + +Text [url](https://example.com "title") text + +Text ![url](https://example.com "title") text + +Text [url](https://example.com +"title") text + +Text ![url](https://example.com +"title") text + +Text [text][url] text + +Text ![text][url] text + +Text [url][] text + +Text ![url][] text + +Text [url] text + +Text ![url] text + +Text text {MD054} + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text + +Text [url](https://example.com/backslash\[escape) text + +Text [embedded-backslash] text + +Text [backslash-escape] text + +Text text {MD054} + +Text text {MD054} + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text + +Text [url]() text + +Text [url](https://example.com/\(parens\)) text + +Text [url](https://example.com/pa(re(ns))) text + +Text [url](relative/path) text + +Text [url](#fragment) text + +Text text {MD054} + +Text [url](https://example.com/an>g) text + +Text text {MD054} + +Text [user@example.com](user@example.com) text + +Text [user@example.com][email] text + +Text [email][] text + +Text [email] text + +[email]: user@example.com + + diff --git a/test/link-style-no-url-inline-not-possible.md b/test/link-style-no-url-inline-not-possible.md new file mode 100644 index 00000000..75d771f5 --- /dev/null +++ b/test/link-style-no-url-inline-not-possible.md @@ -0,0 +1,68 @@ +# Link Style No URL Inline Not Possible + +Text [https://example.com](https://example.com) text + +Text ![https://example.com](https://example.com) text + +Text [https://example.com]() text + +Text ![https://example.com]() text + +Text [https://example.com](https://example.com/page "title") text + +Text ![https://example.com](https://example.com/page "title") text + +Text [https://example.com](https://example.com "title") text + +Text ![https://example.com](https://example.com "title") text + +Text [https://example.com][url] text + +Text ![https://example.com][url] text + +Text [https://example.com][url-title] text + +Text ![https://example.com][url-title] text + +Text text {MD054} + +[url]: https://example.com +[url-title]: https://example.com "title" + +Text [link](https://example.com) text + +Text ![link](https://example.com) text + +Text [link][url] text + +Text ![link][url] text + +Text [url][] text + +Text ![url][] text + +Text [url] text + +Text ![url] text + +Text [file.md](file.md) text + +Text text {MD054} + +Text [user@example.com](user@example.com) text + +Text [user@example.com][email] text + +Text [email][] text + +Text [email] text + +[email]: user@example.com + + diff --git a/test/link-style-no-url-inline-possible.md b/test/link-style-no-url-inline-possible.md new file mode 100644 index 00000000..5902d8b3 --- /dev/null +++ b/test/link-style-no-url-inline-possible.md @@ -0,0 +1,68 @@ +# Link Style No URL Inline Possible + +Text [https://example.com](https://example.com) text {MD054} + +Text ![https://example.com](https://example.com) text + +Text [https://example.com]() text {MD054} + +Text ![https://example.com]() text + +Text [https://example.com](https://example.com/page "title") text + +Text ![https://example.com](https://example.com/page "title") text + +Text [https://example.com](https://example.com "title") text + +Text ![https://example.com](https://example.com "title") text + +Text [https://example.com][url] text + +Text ![https://example.com][url] text + +Text [https://example.com][url-title] text + +Text ![https://example.com][url-title] text + +Text text + +[url]: https://example.com +[url-title]: https://example.com "title" + +Text [link](https://example.com) text + +Text ![link](https://example.com) text + +Text [link][url] text + +Text ![link][url] text + +Text [url][] text + +Text ![url][] text + +Text [url] text + +Text ![url] text + +Text [file.md](file.md) text + +Text text + +Text [user@example.com](user@example.com) text +(allowed by !url_inline because email address is not an absolute URL) + +Text [user@example.com][email] text + +Text [email][] text + +Text [email] text + +[email]: user@example.com + + diff --git a/test/link-style-none.md b/test/link-style-none.md new file mode 100644 index 00000000..cfd0b416 --- /dev/null +++ b/test/link-style-none.md @@ -0,0 +1,93 @@ +# Link Style None + +Text [url](https://example.com) text {MD054} + +Text ![url](https://example.com) text {MD054} + +Text [url]() text {MD054} + +Text ![url]() text {MD054} + +Text [url](https://example.com "title") text {MD054} + +Text ![url](https://example.com "title") text {MD054} + +Text {MD054} [url](https://example.com +"title") text + +Text {MD054} ![url](https://example.com +"title") text + +Text [text][url] text {MD054} + +Text ![text][url] text {MD054} + +Text [url][] text {MD054} + +Text ![url][] text {MD054} + +Text [url] text {MD054} + +Text ![url] text {MD054} + +Text text {MD054} + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text {MD054} + +Text [url](https://example.com/backslash\[escape) text {MD054} + +Text [embedded-backslash] text {MD054} + +Text [backslash-escape] text {MD054} + +Text text {MD054} + +Text text {MD054} + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text {MD054} + +Text [url]() text {MD054} + +Text [url](https://example.com/\(parens\)) text {MD054} + +Text [url](https://example.com/pa(re(ns))) text {MD054} + +Text [url](relative/path) text {MD054} + +Text [url](#fragment) text {MD054} + +Text text {MD054} + +Text [url](https://example.com/an>g) text {MD054} + +Text text {MD054} + +Text [user@example.com](user@example.com) text {MD054} + +Text [user@example.com][email] text {MD054} + +Text [email][] text {MD054} + +Text [email] text {MD054} + +[email]: user@example.com + + diff --git a/test/link-style-reference-only.md b/test/link-style-reference-only.md new file mode 100644 index 00000000..20037f21 --- /dev/null +++ b/test/link-style-reference-only.md @@ -0,0 +1,89 @@ +# Link Style Reference Only + +Text [url](https://example.com) text {MD054} + +Text ![url](https://example.com) text {MD054} + +Text [url]() text {MD054} + +Text ![url]() text {MD054} + +Text [url](https://example.com "title") text {MD054} + +Text ![url](https://example.com "title") text {MD054} + +Text {MD054} [url](https://example.com +"title") text + +Text {MD054} ![url](https://example.com +"title") text + +Text [text][url] text + +Text ![text][url] text + +Text [url][] text + +Text ![url][] text + +Text [url] text + +Text ![url] text + +Text text {MD054} + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text {MD054} + +Text [url](https://example.com/backslash\[escape) text {MD054} + +Text [embedded-backslash] text + +Text [backslash-escape] text + +Text text {MD054} + +Text text {MD054} + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text {MD054} + +Text [url]() text {MD054} + +Text [url](https://example.com/\(parens\)) text {MD054} + +Text [url](https://example.com/pa(re(ns))) text {MD054} + +Text [url](relative/path) text {MD054} + +Text [url](#fragment) text {MD054} + +Text text {MD054} + +Text [url](https://example.com/an>g) text {MD054} + +Text text {MD054} + +Text [user@example.com](user@example.com) text {MD054} + +Text [user@example.com][email] text + +Text [email][] text + +Text [email] text + +[email]: user@example.com + + diff --git a/test/link-style-shortcut-only.md b/test/link-style-shortcut-only.md new file mode 100644 index 00000000..13674412 --- /dev/null +++ b/test/link-style-shortcut-only.md @@ -0,0 +1,91 @@ +# Link Style Shortcut Only + +Text [url](https://example.com) text {MD054} + +Text ![url](https://example.com) text {MD054} + +Text [url]() text {MD054} + +Text ![url]() text {MD054} + +Text [url](https://example.com "title") text {MD054} + +Text ![url](https://example.com "title") text {MD054} + +Text {MD054} [url](https://example.com +"title") text + +Text {MD054} ![url](https://example.com +"title") text + +Text [text][url] text {MD054} + +Text ![text][url] text {MD054} + +Text [url][] text {MD054} + +Text ![url][] text {MD054} + +Text [url] text + +Text ![url] text + +Text text {MD054} + +[url]: https://example.com "title" + +[undefined] + +Text [url](https://example.com/embedded\3backslash) text {MD054} + +Text [url](https://example.com/backslash\[escape) text {MD054} + +Text [embedded-backslash] text + +Text [backslash-escape] text + +Text text {MD054} + +Text text {MD054} + +[embedded-backslash]: https://example.com/embedded\3backslash + +[backslash-escape]: https://example.com/backslash\[escape + +Text [url]() text {MD054} + +Text [url]() text {MD054} + +Text [url](https://example.com/\(parens\)) text {MD054} + +Text [url](https://example.com/pa(re(ns))) text {MD054} + +Text [url](relative/path) text {MD054} + +Text [url](#fragment) text {MD054} + +Text text {MD054} + +Text [url](https://example.com/an>g) text {MD054} + +Text text {MD054} + +Text [user@example.com](user@example.com) text {MD054} + +Text [user@example.com][email] text {MD054} + +Text [email][] text {MD054} + +Text [email] text + +[email]: user@example.com + + diff --git a/test/links-alternate.md b/test/links-alternate.md new file mode 100644 index 00000000..5e0058d4 --- /dev/null +++ b/test/links-alternate.md @@ -0,0 +1,50 @@ +# Detailed Link Results + +Text https://example.com/ text {MD034} + +Text text https://example.com/bare text {MD034} + +Text https://example.com/bare text text {MD034} + +Text `code https://example.com/code code` text https://example.com/ text {MD034} + +> Text text https://example.com/bare text {MD034} + +Text https://example.com/dir {MD034} +text https://example.com/file.txt {MD034} +text +text https://example.com/dir/dir/file?query=param {MD034} + +```text +Code https://example.com/code?type=fence code +``` + + Code https://example.com/code?type=indent code + +Text more text https://example.com/same still more text done {MD034} + +Text more \* text https://example.com/same more \[ text done {MD034} + +Text https://example.com/first more text https://example.com/second still more text https://example.com/third done {MD034} + +(Incorrect link syntax)[https://www.example.com/] {MD011} + +Text [link ](https://example.com/) text. {MD039} + +Text [ link](https://example.com/) text. {MD039} + +Text [ link ](https://example.com/) text. {MD039} + +Text [link ][reference] text. {MD039} + +Text [ link][reference] text. {MD039} + +Text [ link ][reference] text. {MD039} + +[reference]: https://example.com/ + + diff --git a/test/links-with-markup.md b/test/links-with-markup.md index 8585ec7a..9934bda2 100644 --- a/test/links-with-markup.md +++ b/test/links-with-markup.md @@ -1,3 +1,5 @@ +# links-with-markup + [This link is plain](link) [This link has `code`](link) @@ -8,7 +10,7 @@ [This link has `code` and right space ](link) {MD039} -[ This link has _emphasis_ and left space](link) {MD039} +[ This link has *emphasis* and left space](link) {MD039} [This](link) line has [multiple](link) links. diff --git a/test/links.md b/test/links.md index 371c5f05..6a4014f2 100644 --- a/test/links.md +++ b/test/links.md @@ -1,9 +1,32 @@ # Link test For more information, please see the -following page: http://www.example.com/ {MD034} +following page: https://www.example.com/ {MD034} which will tell you all you want to know. -http://www.google.com/ {MD034} +https://www.google.com/ {MD034} -This link should be fine: +hTtPs://gOoGlE.cOm/ {MD034} + +This link should be fine: + +The following are allowed to avoid conflicts with MD011/no-reversed-links: + +[https://example.com] +[https://example.com/search?query=text] + +Other enclosures are not allowed: + +(https://example.com) {MD034} +{https://example.com} {MD034} + +Duplicate links in tables should be handled: + +| Link | Same Link | Violation | +|----------------------|----------------------|-----------| +| https://example.com/ | https://example.com/ | {MD034} | + +This is not a bare URL: [text [undefined] text](https://example.com). +This is a bare URL: [text [defined] text](https://example.com). {MD034} + +[defined]: https://example.com diff --git a/test/lint-javascript.md b/test/lint-javascript.md new file mode 100644 index 00000000..39c5f1bf --- /dev/null +++ b/test/lint-javascript.md @@ -0,0 +1,23 @@ +# Lint JavaScript + + + +Text + +```js +"use strict"; + +var x = 0; + +console.log(x); +``` + +Text + + var y = 0; + +Text + +Text `undefined` text + +Text diff --git a/test/list-indentation-start-indent-indent.md b/test/list-indentation-start-indent-indent.md new file mode 100644 index 00000000..727cc951 --- /dev/null +++ b/test/list-indentation-start-indent-indent.md @@ -0,0 +1,35 @@ +# List Indentation start_indent/indent + + * item 1 + * item 2 + * item 2.1 + * item 2.2 + * item 2.2.1 + * item 2.3 + * item 2.3.1 {MD007} + * item 3 + * item 4 {MD005} {MD007} + +Text + + * item 1 {MD007} + * item 2 {MD007} + * item 2.1 + * item 2.2 + * item 2.2.1 + +Text + + * item 1 + * item 2 + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + + diff --git a/test/list-indentation-start-indent-no-indent.md b/test/list-indentation-start-indent-no-indent.md new file mode 100644 index 00000000..27ec4acd --- /dev/null +++ b/test/list-indentation-start-indent-no-indent.md @@ -0,0 +1,34 @@ +# List Indentation start_indent/no indent + + * item 1 + * item 2 + * item 2.1 + * item 2.2 + * item 2.2.1 + * item 2.3 + * item 2.3.1 {MD007} + * item 3 + * item 4 {MD005} {MD007} + +Text + + * item 1 {MD007} + * item 2 {MD007} + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + +Text + + * item 1 + * item 2 + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + + diff --git a/test/list-indentation-start-indented-indent.md b/test/list-indentation-start-indented-indent.md new file mode 100644 index 00000000..17e5c6cd --- /dev/null +++ b/test/list-indentation-start-indented-indent.md @@ -0,0 +1,46 @@ +# List Indentation - Start Indented + + * item 1 + * item 2 + * item 2.1 + * item 2.2 + * item 2.2.1 + * item 2.3 + * item 3 + +## Disallowed List Indentation - Starts at Zero + +* item 1 {MD007} +* item 2 {MD007} + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + * item 2.3 {MD007} +* item 3 {MD007} + +## Disallowed List Indentation - Starts at One + + * item 1 {MD007} + * item 2 {MD007} + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + * item 2.3 {MD007} + * item 3 {MD007} + +## Disallowed List Indentation - Starts at Two + + * item 1 {MD007} + * item 2 {MD007} + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + * item 2.3 {MD007} + * item 3 {MD007} + + diff --git a/test/list-indentation-start-indented-no-indent.md b/test/list-indentation-start-indented-no-indent.md new file mode 100644 index 00000000..b30e1b6a --- /dev/null +++ b/test/list-indentation-start-indented-no-indent.md @@ -0,0 +1,46 @@ +# List Indentation - Start Indented/No Indent + + * item 1 + * item 2 + * item 2.1 + * item 2.2 + * item 2.2.1 + * item 2.3 + * item 3 + +## Disallowed List Indentation - Starts at Zero + +* item 1 {MD007} +* item 2 {MD007} + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + * item 2.3 {MD007} +* item 3 {MD007} + +## Disallowed List Indentation - Starts at One + + * item 1 {MD007} + * item 2 {MD007} + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + * item 2.3 {MD007} + * item 2.3.1 + * item 3 {MD007} + +## Disallowed List Indentation - Starts at Three + + * item 1 {MD007} + * item 2 {MD007} + * item 2.1 {MD007} + * item 2.2 {MD007} + * item 2.2.1 {MD007} + * item 2.3 {MD007} + * item 3 {MD007} + + diff --git a/test/list-indentation.md b/test/list-indentation.md new file mode 100644 index 00000000..1af9fbff --- /dev/null +++ b/test/list-indentation.md @@ -0,0 +1,56 @@ +# List Indentation + +Text + +- Item + - Item {MD007} +- Item + - Item {MD007} + +Text + +- Item + - Item +- Item + - Item {MD007} + +Text + +- Item + - Item {MD007} +- Item + - Item + +Text + +- Item + - Item + - Item {MD005} {MD007} + - Item + - Item {MD005} {MD007} + - Item {MD005} {MD007} + - Item +- Item + - Item + - Item {MD005} {MD007} + - Item +- Item + - Item {MD007} + - Item {MD007} + - Item {MD007} +- Item + - Item {MD007} + - Item {MD007} + - Item {MD005} + +Text + +## Invalid Indentation - Should Start at Zero + + - item 1 {MD007} + - item 2 {MD007} + - item 2.1 {MD007} + - item 2.2 {MD007} + - item 2.2.1 {MD007} + - item 2.3 {MD007} + - item 3 {MD007} diff --git a/test/list-item-prefix-alignment.md b/test/list-item-prefix-alignment.md new file mode 100644 index 00000000..ab33d4bd --- /dev/null +++ b/test/list-item-prefix-alignment.md @@ -0,0 +1,129 @@ +# List Alignment + +## Leading Spaces + + 1. One + 2. Two + 3. Three + 4. Four + 5. Five + 6. Six + 7. Seven + 8. Eight + 9. Nine +10. Ten +11. Eleven +12. Twelve + +## Leading Zeroes + +01. One +02. Two +03. Three +04. Four +05. Five +06. Six +07. Seven +08. Eight +09. Nine +10. Ten +11. Eleven +12. Twelve + +## Double Leading Zeroes + +001. One +002. Two +003. Three + +## Nested Lists + +- Item +- Item + 01. One + 02. Two + 03. Three + 04. Four + 05. Five + 06. Six + 07. Seven + 08. Eight + 09. Nine + 10. Ten + 11. Eleven + 12. Twelve +- Item +- Item + 1. One + 2. Two + 3. Three + 4. Four + 5. Five + 6. Six + 7. Seven + 8. Eight + 9. Nine + 10. Ten + 11. Eleven + 12. Twelve +- Item +- Item + +## Another Nested List + +01. One +02. Two + 01. One + 02. Two +03. Three +04. Four + +## Leading Spaces Errors + + 1. One + 2. Two + 3. Three + 4. Four + 5. Five {MD005} + 6. Six + 7. Seven + 8. Eight + 9. Nine + 10. Ten + 11. Eleven {MD005} + 12. Twelve +13. Thirteen {MD005} + 14. Fourteen + +## Leading Spaces Errors with Nesting + + 1. One + 2. Two {MD005} + 3. Three + 1. One + 2. Two + 3. Three + 4. Four + 5. Five {MD005} + 6. Six + 7. Seven + 8. Eight {MD005} + 9. Nine + 10. Ten + 4. Four + 5. Five {MD005} + 6. Six + 1. One + 2. Two + 3. Three {MD005} + 4. Four + 5. Five + 6. Six + 7. Seven {MD005} + 8. Eight + 9. Nine + 10. Ten + 7. Seven + 8. Eight {MD005} + 9. Nine + 10. Ten diff --git a/test/list-syntax-in-paragraph-text.md b/test/list-syntax-in-paragraph-text.md new file mode 100644 index 00000000..2a4a08c2 --- /dev/null +++ b/test/list-syntax-in-paragraph-text.md @@ -0,0 +1,37 @@ +# Heading + +This paragraph has the number +5. More text. + +This paragraph has the number +11. More text. + +This non-paragraph has the number +1. This is a list. {MD032} + +This non-paragraph has the number +1. This is a list. It also has the number {MD032} +5. This is a list. {MD029} + +This non-paragraph has spaces and the number +1. This is a list. {MD030} {MD032} + +This non-paragraph has a dash +- in its list. {MD032} + +This non-paragraph has a dash +- in its list. It also has a plus {MD032} ++ in its list. {MD004} {MD032} + +This non-paragraph has spaces and a dash +- This is a list. {MD030} {MD032} + +This is a mixed paragraph that has +2. followed by text followed by +1. which creates a list {MD032} +1. with a couple of items + +Another mixed paragraph +2. with more text +in the middle of things +1. before the list {MD032} diff --git a/test/lists-and-headers.json b/test/lists-and-headers.json deleted file mode 100644 index 8ad79fd3..00000000 --- a/test/lists-and-headers.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "MD003": false -} diff --git a/test/lists-and-headers.md b/test/lists-and-headers.md deleted file mode 100644 index d0c8dce8..00000000 --- a/test/lists-and-headers.md +++ /dev/null @@ -1,18 +0,0 @@ -* list -* list - -# Header 1 - -* list -* list - -# Header 2 # - -* list -* list - -Header 3 -======== - -* list -* list diff --git a/test/lists-and-headings.md b/test/lists-and-headings.md new file mode 100644 index 00000000..bf60e79c --- /dev/null +++ b/test/lists-and-headings.md @@ -0,0 +1,24 @@ + + +* list +* list + +# Heading 1 + +* list +* list + +# Heading 2 # + +* list +* list + +Heading 3 +========= + +* list +* list + + diff --git a/test/lists-in-blockquote-normal-indent.md b/test/lists-in-blockquote-normal-indent.md new file mode 100644 index 00000000..d9622b03 --- /dev/null +++ b/test/lists-in-blockquote-normal-indent.md @@ -0,0 +1,91 @@ +# Lists in Blockquote Normal Indent + +Text + ++ Item ++ Item + more + item ++ Item + + Item + + Item + more + item + + Item + + Item + + Item + + Item ++ Item + +Text + + Code + +Text + +> Text +> +> + Item +> + Item +> more +> item +> + Item +> + Item +> + Item +> more +> item +> + Item +> + Item +> + Item +> + Item +> + Item +> +> Text +> +> Code + +Text + +1. Item +1. Item + more + item +1. Item + 1. Item + 1. Item + more + item + 1. Item + 1. Item + 1. Item + 1. Item +1. Item + +Text + + Code + +Text + +> Text +> +> 1. Item +> 1. Item +> more +> item +> 1. Item +> 1. Item +> 1. Item +> more +> item +> 1. Item +> 1. Item +> 1. Item +> 1. Item +> 1. Item +> +> Text +> +> Code + +Text diff --git a/test/lists-in-blockquote-start-indented-no-list-items.md b/test/lists-in-blockquote-start-indented-no-list-items.md new file mode 100644 index 00000000..962e4c76 --- /dev/null +++ b/test/lists-in-blockquote-start-indented-no-list-items.md @@ -0,0 +1,104 @@ +# Lists in Blockquote Start Indented + +Text + + + Item + + Item + more + item + + Item + + Item + + Item + more + item + + Item + + Item + + Item + + Item + + Item + +Text + + Code + +Text + + + +> Text +> +> + Item +> + Item +> more +> item +> + Item +> + Item +> + Item +> more +> item +> + Item +> + Item +> + Item +> + Item +> + Item +> +> Text +> +> Code + + + +Text + + 1. Item + 1. Item + more + item + 1. Item + 1. Item + 1. Item + more + item + 1. Item + 1. Item + 1. Item + 1. Item + 1. Item + +Text + + Code + +Text + +> Text +> +> 1. Item +> 1. Item +> more +> item +> 1. Item +> 1. Item +> 1. Item +> more +> item +> 1. Item +> 1. Item +> 1. Item +> 1. Item +> 1. Item +> +> Text +> +> Code + +Text + + diff --git a/test/lists-in-blockquote-start-indented.md b/test/lists-in-blockquote-start-indented.md new file mode 100644 index 00000000..6f293e5f --- /dev/null +++ b/test/lists-in-blockquote-start-indented.md @@ -0,0 +1,101 @@ +# Lists in Blockquote Start Indented + +Text + + + Item + + Item + more + item + + Item + + Item + + Item + more + item + + Item + + Item + + Item + + Item + + Item + +Text + + Code + +Text + + + +> Text +> +> + Item {MD027} +> + Item {MD027} +> more +> item +> + Item {MD027} +> + Item +> + Item +> more +> item +> + Item +> + Item +> + Item +> + Item +> + Item {MD027} +> +> Text +> +> Code + + + +Text + + 1. Item + 1. Item + more + item + 1. Item + 1. Item + 1. Item + more + item + 1. Item + 1. Item + 1. Item + 1. Item + 1. Item + +Text + + Code + +Text + +> Text +> +> 1. Item {MD027} +> 1. Item {MD027} +> more +> item +> 1. Item {MD027} +> 1. Item +> 1. Item +> more +> item +> 1. Item +> 1. Item +> 1. Item +> 1. Item +> 1. Item {MD027} +> +> Text +> +> Code + +Text + + diff --git a/test/lists-in-blockquote.md b/test/lists-in-blockquote.md new file mode 100644 index 00000000..b9ffc2c1 --- /dev/null +++ b/test/lists-in-blockquote.md @@ -0,0 +1,188 @@ +# Lists in Blockquote + +> 1. The simplest ordered list in blockquote + +Text + +> + The simplest unordered list in blockquote + +Text + +>1. Item + +Text + +>+ Item + +Text + +>1. Item {MD030} + +Text + +>+ Item {MD030} + +Text + +> 1. Item +> 1. Item + +Text + +> - Item {MD004} +> - Item {MD004} + +Text + +> Text +> +> + Item +> + Item +> +> Text + +Text + +> Text +> + Item {MD032} +> + Item + +Text + +> + Item +> + Item {MD032} +> --- + +Text + + > 1. Item + > 1. Item + > 1. Item {MD030} + +Text + + > * Item {MD004} + > * Item {MD004} + > * Item {MD004} {MD030} + > * Item {MD004} {MD005} {MD007} + > * Item {MD004} {MD005} {MD007} {MD027} + > * Item {MD004} + > * Item {MD004} + > * Item {MD004} + > * Item {MD004} {MD005} {MD007} + +Text + + > > * Item {MD004} + > > * Item {MD004} + > > * Item {MD004} {MD030} + > > * Item {MD004} {MD005} {MD007} + +Text + + > Text + > + > > - Item {MD004} + > > - Item {MD004} {MD005} {MD027} + > > - Item {MD004} {MD005} + > > + > > > - Item {MD004} + > > > - Item {MD004} {MD005} {MD027} + > > > - Item {MD004} {MD005} {MD027} + +Text + + > Text + > > - Item {MD004} {MD032} + > > - Item {MD004} {MD005} {MD027} + > > - Item {MD004} {MD005} {MD032} + > > > - Item {MD004} {MD032} + > > > - Item {MD004} {MD005} {MD027} + > > > - Item {MD004} {MD005} {MD027} + +Text + +>+ Item +> + Item {MD005} +>> +>>+ Item +>> + Item {MD005} + +Text + +>+ Item +> + Item {MD005} {MD032} +>>+ Item {MD032} +>> + Item {MD005} + +Text + +> Quoted text +> +> * A list {MD004} +> * of items {MD004} +> +> More quoted text + +Text + +> Quoted text +> +> > + A list +> > + of items +> +> More quoted text + +Text + +> Quoted text +> +> > - A list {MD004} +> > - of items {MD004} +> > +> > More quoted text + +Text + ++ List + > blockquote in list + > + > + list in blockquote in list + +Text + ++ List + Text + + > + list in blockquote + > + list in blockquote + + Text + + > + list in blockquote + + Text ++ List + + Text + + > + list in blockquote + + Text ++ List + + > + list in blockquote + > + sublist in blockquote + > + list in blockquote + > + sublist in blockquote + +Text + ++ List + Text + + > + list in blockquote + > + list in blockquote {MD005} {MD007} {MD027} + > + list in blockquote + > + sublist in blockquote + > + sublist in blockquote {MD005} {MD007} diff --git a/test/lists-incomplete.md b/test/lists-incomplete.md new file mode 100644 index 00000000..2b024b05 --- /dev/null +++ b/test/lists-incomplete.md @@ -0,0 +1,49 @@ +# Lists Incomplete + +Text + +- Item +- + +Text + +- +- Item + +Text + +- Item +- +- Item + +Text + +- Item +- +- + +Text + +1. Item +1. + +Text + +1. +1. Item + +Text + +1. Item +1. +1. Item + +Text + +1. Item +1. +1. + +Text + +{MD047} \ No newline at end of file diff --git a/test/lists-inside-footnote.md b/test/lists-inside-footnote.md new file mode 100644 index 00000000..1f94e02b --- /dev/null +++ b/test/lists-inside-footnote.md @@ -0,0 +1,22 @@ +# Lists Inside Footnote + +Text.[^ref] + +[^ref]: Note and list: + + * Item + * Item + * Item + + 1. Item + 1. Item + 1. Item + + Text + + * Item + * Item {MD005} {MD007} + * Item + * Item + * Item {MD005} {MD007} + * Item diff --git a/test/lists-on-a-line.md b/test/lists-on-a-line.md new file mode 100644 index 00000000..bbf7eb5a --- /dev/null +++ b/test/lists-on-a-line.md @@ -0,0 +1,63 @@ +# Lists on a Line + +## Correct + +Text + +* * Item + +Text + +* * * Item + +Text + +- + * Item + +Text + +- 1. Item + +Text + +- 1. + Item + +Text + +* * * Item + * Item + * Item +* Item + +## Incorrect + +Text + + * * Item {MD007} + +Text + + * * * Item {MD007} + +Text + + - + * Item {MD007} + +Text + + - 1. Item {MD007} + +Text + + - 1. + Item {MD007} + +Text + + * * * Item {MD007} + * Item {MD005} {MD007} + * Item {MD005} {MD007} + * Item {MD005} {MD007} + + diff --git a/test/lists-with-commented-items.md b/test/lists-with-commented-items.md new file mode 100644 index 00000000..6fa15c3b --- /dev/null +++ b/test/lists-with-commented-items.md @@ -0,0 +1,38 @@ +# Lists with Commented Items + +Text + +- item +- item + +- item +- item + +Text + +- item +- item + +- item +- item + +Text + +- item + +- item + +Text + +- item +- item + + +- item +- item + +Text diff --git a/test/lists-with-fenced-code-tight.md b/test/lists-with-fenced-code-tight.md new file mode 100644 index 00000000..80e3535f --- /dev/null +++ b/test/lists-with-fenced-code-tight.md @@ -0,0 +1,65 @@ +# Lists with Fenced Code, Tight + +- Item + + ```text + fence + ``` + +- Item + - Item + + ```text + fence + ``` + +- Item + +Text + +- Item + ```text + fence + ``` +- Item + - Item + ```text + fence + ``` +- Item + +Text + +1. Item + + ```text + fence + ``` + +1. Item + 1. Item + + ```text + fence + ``` + +1. Item + +Text + +1. Item + ```text + fence + ``` +1. Item + 1. Item + ```text + fence + ``` +1. Item + + diff --git a/test/lists-with-fenced-code.md b/test/lists-with-fenced-code.md new file mode 100644 index 00000000..f94c6a02 --- /dev/null +++ b/test/lists-with-fenced-code.md @@ -0,0 +1,73 @@ +# Lists with Fenced Code + +- Item + + ```text + fence + ``` + +- Item + - Item + + ```text + fence + ``` + +- Item + +Text + +- Item + ```text + fence {MD031:-1} {MD031:+1} + ``` +- Item + - Item + ```text + fence {MD031:-1} {MD031:+1} + ``` +- Item + +Text + +1. Item + + ```text + fence + ``` + +1. Item + 1. Item + + ```text + fence + ``` + +1. Item + +Text + +1. Item + ```text + fence {MD031:-1} {MD031:+1} + ``` +1. Item + 1. Item + ```text + fence {MD031:-1} {MD031:+1} + ``` +1. Item + +Text + +1. Text + + ```text + code + +Text + +1. Text + ```shell + fence {MD031:-1} {MD031} {MD031:+1} {MD032} {MD040:+1} + ``` diff --git a/test/lists-with-nesting.md b/test/lists-with-nesting.md new file mode 100644 index 00000000..d8e4c825 --- /dev/null +++ b/test/lists-with-nesting.md @@ -0,0 +1,99 @@ +# Lists with Nesting + +## Excessive nesting + +- one + 1. two + 1. three +- four + +1. one + - two + - three +1. four + +## Insufficient nesting + +- one {MD032} + 1. two {MD032} +- three {MD032} + +1. one {MD032} + - two {MD007} {MD032} +1. three {MD032} + +## Correct nesting, same type + +- one + - two + - three +- four + - five + - six + - seven + +1. one + 1. two + 1. three +1. four + 1. five + 1. six + 1. seven + +## Correct nesting, different types + +- one + 1. two + 1. three +- four + +1. one + - two + - three +1. four + +1. one + - two + - three + +- one + 1. two + - three + +- one + - two + 1. three + +1. one + 1. two + - three + +1. one + - two + 1. three + +- one + 1. two + 1. three + +- one + 1. two + - three + 1. four + - five + 1. six + - seven + 1. eight + +1. one + - two + 1. three + - four + 1. five + - six + 1. seven + - eight + + * 1. Item {MD004} {MD007} + * 2. Item {MD004} {MD007} {MD029} + * 3. Item {MD004} {MD007} {MD029} diff --git a/test/lists_without_blank_lines.json b/test/lists_without_blank_lines.json deleted file mode 100644 index 4a02d769..00000000 --- a/test/lists_without_blank_lines.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD004": false, - "MD029": false, - "MD040": false -} diff --git a/test/lists_without_blank_lines.md b/test/lists_without_blank_lines.md index b1571966..4f7d6446 100644 --- a/test/lists_without_blank_lines.md +++ b/test/lists_without_blank_lines.md @@ -1,26 +1,28 @@ +# lists_without_blank_lines + * list (on first line) text * list -text +--- * list {MD032} -text +--- + list {MD032} -text +--- - list {MD032} -text +--- 1. list {MD032} -text +--- * list * list {MD032} -text +--- text -10. list {MD032} -20. list +1. list {MD032} +2. list text @@ -58,8 +60,8 @@ text text -* list {MD032} -``` {MD031} +* list {MD032} {MD031:64} +``` code ``` @@ -67,9 +69,35 @@ text ``` code -``` {MD031} -* list {MD032} +``` +* list {MD032} {MD031:72} text -* list (on last line without newline) \ No newline at end of file +

+1. Not a +2. list +

+ +

1. Not a list

+ +

+* Not a +* list +

+ +

* Not a list

+ +1. Undefined reference token +
+   [()]
+   
+ + + +* list (on last line without newline) {MD047} \ No newline at end of file diff --git a/test/long-heading-exceptions.md b/test/long-heading-exceptions.md new file mode 100644 index 00000000..aa7452f0 --- /dev/null +++ b/test/long-heading-exceptions.md @@ -0,0 +1,27 @@ +# Heading + +Text + +## Heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading + +Text + +Text text text text text text text text text text text text text text text text text text text text text text text text {MD013} + +## Heading heading + +Text + +Text text text text text text text text text text text text text text text text text text text text text text text text {MD013} + +### Heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading + +Text + +Text text text text text text text text text text text text text text text text text text text text text text text text {MD013} + + diff --git a/test/long-lines-long-reference-definitions-stern.md b/test/long-lines-long-reference-definitions-stern.md new file mode 100644 index 00000000..c12843d7 --- /dev/null +++ b/test/long-lines-long-reference-definitions-stern.md @@ -0,0 +1,24 @@ +# Long Lines Long Reference Definitions Stern + +[Link][short-reference-definition] + +[Link][long-reference-definition] + +[Link][long-reference-definition-split] + +![Image][long-reference-definition-image] + +[short-reference-definition]: https://example.com/short +[long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long +[long-reference-definition-split]: + https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/long +[long-reference-definition-image]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/image + +[long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long + + diff --git a/test/long-lines-long-reference-definitions-strict.md b/test/long-lines-long-reference-definitions-strict.md new file mode 100644 index 00000000..cfe97361 --- /dev/null +++ b/test/long-lines-long-reference-definitions-strict.md @@ -0,0 +1,24 @@ +# Long Lines Long Reference Definitions Strict + +[Link][short-reference-definition] + +[Link][long-reference-definition] + +[Link][long-reference-definition-split] + +![Image][long-reference-definition-image] + +[short-reference-definition]: https://example.com/short +[long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long +[long-reference-definition-split]: + https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/long +[long-reference-definition-image]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/image + +[long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long + + diff --git a/test/long-lines-long-reference-definitions.md b/test/long-lines-long-reference-definitions.md new file mode 100644 index 00000000..d0d99988 --- /dev/null +++ b/test/long-lines-long-reference-definitions.md @@ -0,0 +1,19 @@ +# Long Lines Long Reference Definitions + +[Link][short-reference-definition] + +[Link][long-reference-definition] + +[Link][long-reference-definition-split] + +![Image][long-reference-definition-image] + +[short-reference-definition]: https://example.com/short +[long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long +[long-reference-definition-split]: + https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/long +[long-reference-definition-image]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/image + +[long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long + + \ No newline at end of file diff --git a/test/long-lines-negative-line-length.md b/test/long-lines-negative-line-length.md new file mode 100644 index 00000000..14f2e335 --- /dev/null +++ b/test/long-lines-negative-line-length.md @@ -0,0 +1,12 @@ +# Long Lines Negative Line Length + +Text text text text text text text text text text text text text text text text text text text text. + +This is an invalid configuration, but present in the wild and (for backward compatibility) disables the rule: + + + diff --git a/test/long-lines-short-code.md b/test/long-lines-short-code.md new file mode 100644 index 00000000..6fde7599 --- /dev/null +++ b/test/long-lines-short-code.md @@ -0,0 +1,32 @@ +# Long Lines, Short Code + +Text text text text text text text text text text text text text text text + +Text text text text text text text text text text text text text text text text text {MD013} + +Text + + Code code code code + +Text + + Code code code code code code code {MD013} + +Text + +```text +Code code code code code +``` + +Text + +```text +Code code code code code code code code {MD013} +``` + + diff --git a/test/long-lines-short-headings.md b/test/long-lines-short-headings.md new file mode 100644 index 00000000..d84469ca --- /dev/null +++ b/test/long-lines-short-headings.md @@ -0,0 +1,27 @@ +# Long Lines, Short Headings + +Text text text text text text text text text text text text text text text text text {MD013} + +## Short heading text text text + +Text + +## Long heading text text text {MD013} + +Text + +## Long heading text text {MD013} ## + +Text + +Long heading of text text text text text text {MD013} +----------------------------------------------------- + +Text + + diff --git a/test/long-lines-stern.md b/test/long-lines-stern.md new file mode 100644 index 00000000..c489ff84 --- /dev/null +++ b/test/long-lines-stern.md @@ -0,0 +1,64 @@ +# Long Lines Stern + +12345678901234567890123456789012345678901234567890123456789012345678901234567890 + +This line is too long. text text text text text text text text text text text text + +This line is barely too long. text text text text text text text text text text t + +This line is just okay. text text text text text text text text text text text t + +This line is not a problem. text text text text text text text text text text t + +This line is too long. texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext + +ThisLineIsOkaytexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext + +## This heading is way too long + +## This heading is long but ok + +## This heading is short + ok + +## ThisTooLongHeadingIsOkaytext + +```text +This code is too long +This code is a-okay. +This code is short. +ThisTooLongCodeIsOkay. +``` + +* This list item line is too long. text text text text text text text text text text +* This list item line is okay. text text text text text text text text text + This list item line is okay. text text text text text text text text text + This list item line is too long. text text text text text text text text text text + ThisTooLongListItemLineIsOkaytexttexttexttexttexttexttexttexttexttexttexttexttext + +> This blockquote line is too long. text text text text text text text text text text +> This blockquote line is okay. text text text text text text text text text +> ThisTooLongBlockquoteLineIsOkaytexttexttexttexttexttexttexttexttexttexttexttexttext +> +> > This double blockquote line is too long. text text text text text text text text +> > This double blockquote line is okay. text text text text text text text +> > ThisTooLongDoubleBlockquoteLineIsOkaytexttexttexttexttexttexttexttexttexttexttext + + ThisLineIsTooLongButIsNotReportedBecauseItLooksLikePartOfAListItemtexttexttexttext + +{MD013:5} +{MD013:7} +{MD013:13} +{MD013:17} +{MD013:26} +{MD013:32} +{MD013:35} +{MD013:38} +{MD013:42} + + diff --git a/test/long-lines-strict.md b/test/long-lines-strict.md new file mode 100644 index 00000000..43e42454 --- /dev/null +++ b/test/long-lines-strict.md @@ -0,0 +1,39 @@ +# Long Lines Strict + +12345678901234567890123456789012345678901234567890123456789012345678901234567890 + +This line is too long. text text text text text text text text text text text text + +This line is way too long. text text text text text text text text text text text text + +This line is barely too long. text text text text text text text text text text t + +This line is just okay. text text text text text text text text text text text t + +This line is not a problem. text text text text text text text text text text t + +## This heading is way too long + +## This heading is long but ok + +## This heading is short + ok + +```text +This code is too long +This code is a-okay. +This code is short. +``` + +{MD013:5} +{MD013:7} +{MD013:9} +{MD013:15} +{MD013:22} + + diff --git a/test/long-lines-thresholds.md b/test/long-lines-thresholds.md new file mode 100644 index 00000000..39403f52 --- /dev/null +++ b/test/long-lines-thresholds.md @@ -0,0 +1,55 @@ +# Long Lines Thresholds + +00000000011111111112222222222333333333344444444445 +12345678901234567890123456789012345678901234567890 + +Text text text text text text text te text + +Text text text text text text text tex text + +Text text text text text text text text text + +Text text text text text text text textx text + +Text text text text text text text textxe text + +{MD013:-2} {MD013:-4} {MD013:-6} + +## Text text text text text te text + +## Text text text text text tex text + +## Text text text text text text text + +## Text text text text text textx text + +## Text text text text text textxe text + +{MD013:-2} {MD013:-4} {MD013:-6} + +```text +Text text text te text +Text text text tex text +Text text text text text +Text text text textx text +Text text text textxe text +``` + +{MD013:-3} {MD013:-4} {MD013:-5} + + Text text tex text + Text text text text + Text text textx text + Text text textxe text + Text text textxet text + +{MD013:-2} {MD013:-3} {MD013:-4} + + diff --git a/test/long_lines.md b/test/long_lines.md index 875c8c69..c03dc248 100644 --- a/test/long_lines.md +++ b/test/long_lines.md @@ -1,3 +1,86 @@ +# Long Lines + This is a very very very very very very very very very very very very very very long line {MD013} -This line however, while very long, doesn't have whitespace after the 80th columnwhichallowsforURLsandotherlongthings. \ No newline at end of file +This line however, while very long, doesn't have whitespace after the 80th columnwhichallowsforURLsandotherlongthings. + +[This long line is comprised entirely of a link](https://example.com "This is the long link's title") + +> [This long line is comprised entirely of a link](https://example.com "This is the long link's title") + + [This long line is comprised entirely of a link](https://example.com "But is inside a code block") {MD013} + +```markdown +[This long line is comprised entirely of a link](https://example.com "But is inside a code block") {MD013} {MD046:13} +``` + +This [long line is comprised mostly of a link](https://example.com "This is the long link's title") {MD013} + +[This long line is comprised mostly of a link](https://example.com "This is the long link's title") text {MD013} + +This long line includes a simple [reference][label] link and is long enough to violate the rule. {MD013} + +[This long line is comprised entirely of a reference link and is long enough to violate the rule][label] + +[label]: https://example.org "Title for a link reference that is itself long enough to violate the rule" + +[Link to broken label][notlabel] {MD052} + +[notlabel\]: notlink "Invalid syntax for a link label because the right bracket is backslash-escaped {MD013}" + +[](https://example.com "This long line is comprised entirely of a link with empty text and a non-empty title") + +*[This long line is comprised of an emphasized link](https://example.com "This is the long link's title")* + +_[This long line is comprised of an emphasized link {MD049}](https://example.com "This is the long link's title")_ + +**[This long line is comprised of a bolded link](https://example.com "This is the long link's title")** + +__[This long line is comprised of a bolded link {MD050}](https://example.com "This is the long link's title")__ + +_**[This long line is comprised of an emphasized and bolded link {MD049}](https://example.com "This is the long link's title")**_ + +**_[This long line is comprised of an emphasized and bolded link {MD049}](https://example.com "This is the long link's title")_** + +*[](https://example.com "This long line is comprised of an emphasized link with empty text and a non-empty title")* + +**[](https://example.com "This long line is comprised of a bolded link with empty text and a non-empty title")** + +![Alternate text for long line image example](https://example.com "Title text for long line image example") + +*![Alternate text for long line image example](https://example.com "Title text for long line image example")* + +**![Alternate text for long line image example](https://example.com "Title text for long line image example")** + +![Reference style for long line image which is itself an example of a long line with content][image] + +*![Reference style for long line image which is itself an example of a long line with content][image]* + +**![Reference style for long line image which is itself an example of a long line with content][image]** + +[image]: https://example.com "Title text for long line image example using reference style for image details" + + + + + + + +Long lines inside HTML comments should also + + + +https://example.com/long-line-comprised-entirely-of-a-bare-link-long-line-comprised-entirely-of-a-bare-link + +Long {MD013} + +Long https://example.com/long-line-comprised-mostly-of-a-bare-link-long-line-comprised-mostly-of-a-bare-link {MD013} + + diff --git a/test/long_lines_100.json b/test/long_lines_100.json deleted file mode 100644 index 221fa414..00000000 --- a/test/long_lines_100.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD013": { - "line_length": 100 - } -} diff --git a/test/long_lines_100.md b/test/long_lines_100.md index 18df4b8c..e797a28d 100644 --- a/test/long_lines_100.md +++ b/test/long_lines_100.md @@ -1,3 +1,5 @@ +# long_lines_100 + This is a very very very very very very very very long line over 80 chars but less than 100 This is a very very very very very very very very very very long line over 80 chars, and also over 100. {MD013} @@ -5,3 +7,9 @@ This is a very very very very very very very very very very long line over 80 ch This is a very very very very very very very very very long line that is exactly 100 characters long This line however, while very long, doesn't have whitespace after the 100th columnwhichallowsforURLsandotherlongthings. + + diff --git a/test/long_lines_code-default.md b/test/long_lines_code-default.md new file mode 100644 index 00000000..05b25fc6 --- /dev/null +++ b/test/long_lines_code-default.md @@ -0,0 +1,30 @@ +# long_lines_code-default + +This is a short line. + +This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013} + +This is a short line. + +```text +Here is a short line in a code block. +Here is a very very very very very very very very very very very very very very very very very very very long line in a code block. {MD013} +``` + +This is a short line. + +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | {MD013} +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | {MD013} +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013} +| ============== | ============== | ============== | ============== | ============== | ============== | {MD013} +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013} + +This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013} + +Another line. + +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | {MD013} +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | {MD013} +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013} +| ============== | ============== | ============== | ============== | ============== | ============== | {MD013} +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013} diff --git a/test/long_lines_code.md b/test/long_lines_code.md new file mode 100644 index 00000000..8d366550 --- /dev/null +++ b/test/long_lines_code.md @@ -0,0 +1,52 @@ +# long_lines_code + +This is a short line. + +This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013} + +This is a short line. + +```text +Here is a short line in a code block. +Here is a very very very very very very very very very very very very very very very very very very very long line in a code block. +``` + +```text +test +test + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut +``` + +This is a short line. + +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| ============== | ============== | ============== | ============== | ============== | ============== | +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | + +This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013} + +Another line. + +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| ============== | ============== | ============== | ============== | ============== | ============== | +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | + + diff --git a/test/markdown-extra-footnote.md b/test/markdown-extra-footnote.md new file mode 100644 index 00000000..101b9964 --- /dev/null +++ b/test/markdown-extra-footnote.md @@ -0,0 +1,12 @@ +# Heading + +Text with Markdown Extra footnote[^1] + +Text with (parenthesized footnote)[^2] + +This is not a (parenthesized footnote)[x^y] {MD011} + +Nor (is this)[z] {MD011} + +[^1]: Footnote +[^2]: Another footnote diff --git a/test/markdown-in-html.md b/test/markdown-in-html.md new file mode 100644 index 00000000..ad8f9ad0 --- /dev/null +++ b/test/markdown-in-html.md @@ -0,0 +1,37 @@ +# Markdown in HTML + +Text + ++ Item + +Text + +

+## Heading 2a + - Text *text* text * text * text ** text ** text `text` text ` text ` text +- Text https://example.com/ [ link ](https://example.com/) +

+ +

+### Heading 3a ### +Text +

+ +Text + +

+ +## Heading 2b {MD019} {MD022} + - Text *text* text * text * text ** text ** text `text` text ` text ` text {MD004} {MD007} {MD032} {MD037} {MD038} +- Text https://example.com/ [ link ](https://example.com/) {MD004} {MD005} {MD034} {MD039} + +

+ +

+ +### Heading 3b {MD003} {MD021} {MD022} ### +Text + +

+ + diff --git a/test/markdownlint-test-config.mjs b/test/markdownlint-test-config.mjs new file mode 100644 index 00000000..524e095f --- /dev/null +++ b/test/markdownlint-test-config.mjs @@ -0,0 +1,593 @@ +// @ts-check + +import fs from "node:fs"; +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +import os from "node:os"; +import path from "node:path"; +import test from "ava"; +import { readConfig as readConfigAsync } from "markdownlint/async"; +import { extendConfig, readConfig as readConfigPromise } from "markdownlint/promise"; +import { readConfig as readConfigSync } from "markdownlint/sync"; +import { __dirname } from "./esm-helpers.mjs"; + +const sameFileSystem = (path.relative(os.homedir(), __dirname(import.meta)) !== __dirname(import.meta)); + +test("configSingle", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync("./test/config/config-child.json", + function callback(err, actual) { + t.falsy(err); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configAbsolute", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync(path.join(__dirname(import.meta), "config", "config-child.json"), + function callback(err, actual) { + t.falsy(err); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +if (sameFileSystem) { + test("configTilde", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync( + `~/${path.relative(os.homedir(), "./test/config/config-child.json")}`, + function callback(err, actual) { + t.falsy(err); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); + })); +} + +test("configMultiple", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync("./test/config/config-grandparent.json", + function callback(err, actual) { + t.falsy(err); + const expected = { + ...require("./config/config-child.json"), + ...require("./config/config-parent.json"), + ...require("./config/config-grandparent.json") + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configMultipleWithRequireResolve", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync("./test/config/config-packageparent.json", + function callback(err, actual) { + t.falsy(err); + const expected = { + ...require("./node_modules/pseudo-package/config-frompackage.json"), + ...require("./config/config-packageparent.json") + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configCustomFileSystem", (t) => new Promise((resolve) => { + t.plan(3); + const file = "/dir/file.json"; + const extended = "~/dir/extended.json"; + const expanded = path.join(os.homedir(), extended.slice(1)); + const fileContent = { + "extends": extended, + "default": true, + "MD001": false + }; + const extendedContent = { + "MD001": true, + "MD041": true + }; + const fsApi = { + "access": (p, m, cb) => { + t.is(p, expanded); + return (cb || m)(); + }, + "readFile": (p, o, cb) => { + if (p === file) { + return cb(null, JSON.stringify(fileContent)); + } else if (p === expanded) { + return cb(null, JSON.stringify(extendedContent)); + } + return t.fail(p); + } + }; + readConfigAsync( + file, + // @ts-ignore + null, + fsApi, + function callback(err, actual) { + t.falsy(err); + const expected = { + ...extendedContent, + ...fileContent + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configBadFile", (t) => new Promise((resolve) => { + t.plan(4); + readConfigAsync("./test/config/config-badfile.json", + function callback(err, result) { + t.truthy(err, "Did not get an error for bad file."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.code, "ENOENT", "Error code for bad file not ENOENT."); + t.true(!result, "Got result for bad file."); + resolve(); + }); +})); + +test("configBadChildFile", (t) => new Promise((resolve) => { + t.plan(4); + readConfigAsync("./test/config/config-badchildfile.json", + function callback(err, result) { + t.truthy(err, "Did not get an error for bad child file."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.code, "ENOENT", + "Error code for bad child file not ENOENT."); + t.true(!result, "Got result for bad child file."); + resolve(); + }); +})); + +test("configBadChildPackage", (t) => new Promise((resolve) => { + t.plan(4); + readConfigAsync("./test/config/config-badchildpackage.json", + function callback(err, result) { + t.truthy(err, "Did not get an error for bad child package."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.code, "ENOENT", + "Error code for bad child package not ENOENT."); + t.true(!result, "Got result for bad child package."); + resolve(); + }); +})); + +test("configBadJson", (t) => new Promise((resolve) => { + t.plan(3); + readConfigAsync("./test/config/config-badjson.json", + function callback(err, result) { + t.truthy(err, "Did not get an error for bad JSON."); + t.true(err instanceof Error, "Error not instance of Error."); + t.true(!result, "Got result for bad JSON."); + resolve(); + }); +})); + +test("configBadChildJson", (t) => new Promise((resolve) => { + t.plan(3); + readConfigAsync("./test/config/config-badchildjson.json", + function callback(err, result) { + t.truthy(err, "Did not get an error for bad child JSON."); + t.true(err instanceof Error, "Error not instance of Error."); + t.true(!result, "Got result for bad child JSON."); + resolve(); + }); +})); + +test("configSingleYaml", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync( + "./test/config/config-child.yaml", + // @ts-ignore + [ require("js-yaml").load ], + function callback(err, actual) { + t.falsy(err); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configMultipleYaml", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync( + "./test/config/config-grandparent.yaml", + // @ts-ignore + [ require("js-yaml").load ], + function callback(err, actual) { + t.falsy(err); + const expected = { + ...require("./config/config-child.json"), + ...require("./config/config-parent.json"), + ...require("./config/config-grandparent.json") + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configMultipleHybrid", (t) => new Promise((resolve) => { + t.plan(2); + readConfigAsync( + "./test/config/config-grandparent-hybrid.yaml", + // @ts-ignore + [ JSON.parse, require("toml").parse, require("js-yaml").load ], + function callback(err, actual) { + t.falsy(err); + const expected = { + ...require("./config/config-child.json"), + ...require("./config/config-parent.json"), + ...require("./config/config-grandparent.json") + }; + // @ts-ignore + delete expected.extends; + t.like(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configBadHybrid", (t) => new Promise((resolve) => { + t.plan(4); + readConfigAsync( + "./test/config/config-badcontent.txt", + // @ts-ignore + [ JSON.parse, require("toml").parse, require("js-yaml").load ], + function callback(err, result) { + t.truthy(err, "Did not get an error for bad child JSON."); + t.true(err instanceof Error, "Error not instance of Error."); + t.truthy(err.message.match( + /^Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/ + ), "Error message unexpected."); + t.true(!result, "Got result for bad child JSON."); + resolve(); + }); +})); + +test("configSingleSync", (t) => { + t.plan(1); + const actual = readConfigSync("./test/config/config-child.json"); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); +}); + +test("configAbsoluteSync", (t) => { + t.plan(1); + const actual = readConfigSync( + path.join(__dirname(import.meta), "config", "config-child.json")); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); +}); + +if (sameFileSystem) { + test("configTildeSync", (t) => { + t.plan(1); + const actual = readConfigSync( + `~/${path.relative(os.homedir(), "./test/config/config-child.json")}`); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); + }); +} + +test("configMultipleSync", (t) => { + t.plan(1); + const actual = + readConfigSync("./test/config/config-grandparent.json"); + const expected = { + ...require("./config/config-child.json"), + ...require("./config/config-parent.json"), + ...require("./config/config-grandparent.json") + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); +}); + +test("configBadFileSync", (t) => { + t.plan(1); + t.throws( + function badFileCall() { + readConfigSync("./test/config/config-badfile.json"); + }, + { + "message": /ENOENT/ + }, + "Did not get correct exception for bad file." + ); +}); + +test("configBadChildFileSync", (t) => { + t.plan(1); + t.throws( + function badChildFileCall() { + readConfigSync("./test/config/config-badchildfile.json"); + }, + { + "message": /ENOENT/ + }, + "Did not get correct exception for bad child file." + ); +}); + +test("configBadJsonSync", (t) => { + t.plan(1); + t.throws( + function badJsonCall() { + readConfigSync("./test/config/config-badjson.json"); + }, + { + "message": + /Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/ + }, + "Did not get correct exception for bad JSON." + ); +}); + +test("configBadChildJsonSync", (t) => { + t.plan(1); + t.throws( + function badChildJsonCall() { + readConfigSync("./test/config/config-badchildjson.json"); + }, + { + "message": + /Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/ + }, + "Did not get correct exception for bad child JSON." + ); +}); + +test("configSingleYamlSync", (t) => { + t.plan(1); + const actual = readConfigSync( + // @ts-ignore + "./test/config/config-child.yaml", [ require("js-yaml").load ]); + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); +}); + +test("configMultipleYamlSync", (t) => { + t.plan(1); + const actual = readConfigSync( + // @ts-ignore + "./test/config/config-grandparent.yaml", [ require("js-yaml").load ]); + const expected = { + ...require("./config/config-child.json"), + ...require("./config/config-parent.json"), + ...require("./config/config-grandparent.json") + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); +}); + +test("configMultipleHybridSync", (t) => { + t.plan(1); + const actual = readConfigSync( + "./test/config/config-grandparent-hybrid.yaml", + // @ts-ignore + [ JSON.parse, require("toml").parse, require("js-yaml").load ]); + const expected = { + ...require("./config/config-child.json"), + ...require("./config/config-parent.json"), + ...require("./config/config-grandparent.json") + }; + // @ts-ignore + delete expected.extends; + t.like(actual, expected, "Config object not correct."); +}); + +test("configCustomFileSystemSync", (t) => { + t.plan(2); + const file = "/dir/file.json"; + const extended = "~/dir/extended.json"; + const expanded = path.join(os.homedir(), extended.slice(1)); + const fileContent = { + "extends": extended, + "default": true, + "MD001": false + }; + const extendedContent = { + "MD001": true, + "MD041": true + }; + const fsApi = { + "accessSync": (p) => { + t.is(p, expanded); + }, + "readFileSync": (p) => { + if (p === file) { + return JSON.stringify(fileContent); + } else if (p === expanded) { + return JSON.stringify(extendedContent); + } + return t.fail(p); + } + }; + const actual = readConfigSync(file, undefined, fsApi); + const expected = { + ...extendedContent, + ...fileContent + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); +}); + +test("configBadHybridSync", (t) => { + t.plan(1); + t.throws( + function badHybridCall() { + readConfigSync( + "./test/config/config-badcontent.txt", + // @ts-ignore + [ JSON.parse, require("toml").parse, require("js-yaml").load ]); + }, + { + "message": /^Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/ + }, + "Did not get correct exception for bad content." + ); +}); + +test("configSinglePromise", (t) => new Promise((resolve) => { + t.plan(1); + readConfigPromise("./test/config/config-child.json") + .then((actual) => { + const expected = require("./config/config-child.json"); + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configCustomFileSystemPromise", (t) => new Promise((resolve) => { + t.plan(4); + const file = path.resolve("/dir/file.json"); + const extended = path.resolve("/dir/extended.json"); + const fileContent = { + "extends": extended, + "default": true, + "MD001": false + }; + const extendedContent = { + "MD001": true, + "MD041": true + }; + const fsApi = { + "access": (p, m, cb) => { + t.is(p, extended); + return (cb || m)(); + }, + "readFile": (p, o, cb) => { + switch (p) { + case file: + t.is(p, file); + return cb(null, JSON.stringify(fileContent)); + case extended: + t.is(p, extended); + return cb(null, JSON.stringify(extendedContent)); + default: + return t.fail(); + } + } + }; + readConfigPromise(file, undefined, fsApi) + .then((actual) => { + const expected = { + ...extendedContent, + ...fileContent + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("configBadFilePromise", (t) => new Promise((resolve) => { + t.plan(2); + readConfigPromise("./test/config/config-badfile.json") + .then( + null, + (error) => { + t.truthy(error, "Did not get an error for bad JSON."); + t.true(error instanceof Error, "Error not instance of Error."); + resolve(); + } + ); +})); + +test("extendSinglePromise", (t) => new Promise((resolve) => { + t.plan(1); + const expected = require("./config/config-child.json"); + extendConfig( + expected, + "./test/config/config-child.json", + undefined, + fs + ) + .then((actual) => { + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); + +test("extendBadPromise", (t) => new Promise((resolve) => { + t.plan(2); + extendConfig( + { + "extends": "missing.json" + }, + "./test/config/missing.json", + undefined, + fs + ) + .then( + null, + (error) => { + t.truthy(error, "Did not get an error for bad input."); + t.true(error instanceof Error, "Error not instance of Error."); + resolve(); + } + ); +})); + +test("extendCustomFileSystemPromise", (t) => new Promise((resolve) => { + t.plan(4); + const file = path.resolve("/dir/file.json"); + const extended = path.resolve("/dir/extended.json"); + const fileContent = { + "extends": extended, + "default": true, + "MD001": false + }; + const extendedContent = { + "MD001": true, + "MD041": true + }; + const fsApi = { + "access": (p, m, cb) => { + t.is(p, extended); + return (cb || m)(); + }, + "readFile": (p, o, cb) => { + switch (p) { + case extended: + t.is(p, extended); + return cb(null, JSON.stringify(extendedContent)); + default: + return t.fail(); + } + } + }; + extendConfig(fileContent, file, undefined, fsApi) + .then((actual) => { + t.truthy(fileContent.extends); + const expected = { + ...extendedContent, + ...fileContent + }; + // @ts-ignore + delete expected.extends; + t.deepEqual(actual, expected, "Config object not correct."); + resolve(); + }); +})); diff --git a/test/markdownlint-test-custom-rules.mjs b/test/markdownlint-test-custom-rules.mjs new file mode 100644 index 00000000..132da729 --- /dev/null +++ b/test/markdownlint-test-custom-rules.mjs @@ -0,0 +1,2579 @@ +// @ts-check + +import fs from "node:fs/promises"; +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +import test from "ava"; +import markdownIt from "markdown-it"; +import { lint as lintAsync } from "markdownlint/async"; +import { lint as lintPromise } from "markdownlint/promise"; +import { lint as lintSync } from "markdownlint/sync"; +import customRules from "./rules/rules.cjs"; +import { newLineRe } from "../helpers/helpers.cjs"; +import { __filename, importWithTypeJson } from "./esm-helpers.mjs"; +const packageJson = await importWithTypeJson(import.meta, "../package.json"); +const { homepage, version } = packageJson; + +const markdownItFactory = () => markdownIt({ "html": true }); + +test("customRulesV0", (t) => new Promise((resolve) => { + t.plan(4); + const customRulesMd = "./test/custom-rules.md"; + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": customRules.all, + "files": [ customRulesMd ], + markdownItFactory, + // @ts-ignore + "resultVersion": 0 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + [customRulesMd]: { + "any-blockquote-markdown-it": [ 12 ], + "any-blockquote-micromark": [ 12 ], + "every-n-lines": [ 2, 4, 6, 10, 12 ], + "first-line": [ 1 ], + "letters-E-X": [ 3, 7 ] + } + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore + let actualMessage = actualResult.toString(); + let expectedMessage = + "./test/custom-rules.md: 12: any-blockquote-markdown-it" + + " Rule that reports an error for any blockquote\n" + + "./test/custom-rules.md: 12: any-blockquote-micromark" + + " Rule that reports an error for any blockquote\n" + + "./test/custom-rules.md: 2: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 4: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 6: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 10: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 12: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 1: first-line" + + " Rule that reports an error for the first line\n" + + "./test/custom-rules.md: 3: letters-E-X" + + " Rule that reports an error for lines with the letters 'EX'\n" + + "./test/custom-rules.md: 7: letters-E-X" + + " Rule that reports an error for lines with the letters 'EX'"; + t.is(actualMessage, expectedMessage, "Incorrect message (name)."); + // @ts-ignore + actualMessage = actualResult.toString(true); + expectedMessage = + "./test/custom-rules.md: 12: any-blockquote-markdown-it" + + " Rule that reports an error for any blockquote\n" + + "./test/custom-rules.md: 12: any-blockquote-micromark" + + " Rule that reports an error for any blockquote\n" + + "./test/custom-rules.md: 2: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 4: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 6: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 10: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 12: every-n-lines" + + " Rule that reports an error every N lines\n" + + "./test/custom-rules.md: 1: first-line" + + " Rule that reports an error for the first line\n" + + "./test/custom-rules.md: 3: letter-E-letter-X" + + " Rule that reports an error for lines with the letters 'EX'\n" + + "./test/custom-rules.md: 7: letter-E-letter-X" + + " Rule that reports an error for lines with the letters 'EX'"; + t.is(actualMessage, expectedMessage, "Incorrect message (alias)."); + resolve(); + }); +})); + +test("customRulesV1", (t) => new Promise((resolve) => { + t.plan(3); + const customRulesMd = "./test/custom-rules.md"; + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": customRules.all, + "files": [ customRulesMd ], + markdownItFactory, + // @ts-ignore + "resultVersion": 1 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + [customRulesMd]: [ + { "lineNumber": 12, + "ruleName": "any-blockquote-markdown-it", + "ruleAlias": "any-blockquote-markdown-it", + "ruleDescription": "Rule that reports an error for any blockquote", + "ruleInformation": + `${homepage}/blob/main/test/rules/any-blockquote.js`, + "errorDetail": "Blockquote spans 1 line(s).", + "errorContext": "> Blockquote", + "errorRange": null }, + { "lineNumber": 12, + "ruleName": "any-blockquote-micromark", + "ruleAlias": "any-blockquote-micromark", + "ruleDescription": "Rule that reports an error for any blockquote", + "ruleInformation": + `${homepage}/blob/main/test/rules/any-blockquote.js`, + "errorDetail": "Blockquote spans 1 line(s).", + "errorContext": "> Blockquote", + "errorRange": null }, + { "lineNumber": 2, + "ruleName": "every-n-lines", + "ruleAlias": "every-n-lines", + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 2", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 4, + "ruleName": "every-n-lines", + "ruleAlias": "every-n-lines", + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 4", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 6, + "ruleName": "every-n-lines", + "ruleAlias": "every-n-lines", + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 6", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 10, + "ruleName": "every-n-lines", + "ruleAlias": "every-n-lines", + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 10", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 12, + "ruleName": "every-n-lines", + "ruleAlias": "every-n-lines", + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 12", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 1, + "ruleName": "first-line", + "ruleAlias": "first-line", + "ruleDescription": "Rule that reports an error for the first line", + "ruleInformation": null, + "errorDetail": null, + "errorContext": null, + "errorRange": null }, + { "lineNumber": 3, + "ruleName": "letters-E-X", + "ruleAlias": "letter-E-letter-X", + "ruleDescription": + "Rule that reports an error for lines with the letters 'EX'", + "ruleInformation": `${homepage}/blob/main/test/rules/letters-E-X.js`, + "errorDetail": null, + "errorContext": "text", + "errorRange": null }, + { "lineNumber": 7, + "ruleName": "letters-E-X", + "ruleAlias": "letter-E-letter-X", + "ruleDescription": + "Rule that reports an error for lines with the letters 'EX'", + "ruleInformation": `${homepage}/blob/main/test/rules/letters-E-X.js`, + "errorDetail": null, + "errorContext": "text", + "errorRange": null } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore + const actualMessage = actualResult.toString(); + const expectedMessage = + "./test/custom-rules.md: 12: any-blockquote-markdown-it/any-blockquote-markdown-it" + + " Rule that reports an error for any blockquote" + + " [Blockquote spans 1 line(s).] [Context: \"> Blockquote\"]\n" + + "./test/custom-rules.md: 12: any-blockquote-micromark/any-blockquote-micromark" + + " Rule that reports an error for any blockquote" + + " [Blockquote spans 1 line(s).] [Context: \"> Blockquote\"]\n" + + "./test/custom-rules.md: 2: every-n-lines/every-n-lines" + + " Rule that reports an error every N lines [Line number 2]\n" + + "./test/custom-rules.md: 4: every-n-lines/every-n-lines" + + " Rule that reports an error every N lines [Line number 4]\n" + + "./test/custom-rules.md: 6: every-n-lines/every-n-lines" + + " Rule that reports an error every N lines [Line number 6]\n" + + "./test/custom-rules.md: 10: every-n-lines/every-n-lines" + + " Rule that reports an error every N lines [Line number 10]\n" + + "./test/custom-rules.md: 12: every-n-lines/every-n-lines" + + " Rule that reports an error every N lines [Line number 12]\n" + + "./test/custom-rules.md: 1: first-line/first-line" + + " Rule that reports an error for the first line\n" + + "./test/custom-rules.md: 3: letters-E-X/letter-E-letter-X" + + " Rule that reports an error for lines with the letters 'EX'" + + " [Context: \"text\"]\n" + + "./test/custom-rules.md: 7: letters-E-X/letter-E-letter-X" + + " Rule that reports an error for lines with the letters 'EX'" + + " [Context: \"text\"]"; + t.is(actualMessage, expectedMessage, "Incorrect message."); + resolve(); + }); +})); + +test("customRulesV2", (t) => new Promise((resolve) => { + t.plan(3); + const customRulesMd = "./test/custom-rules.md"; + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": customRules.all, + "files": [ customRulesMd ], + markdownItFactory, + // @ts-ignore + "resultVersion": 2 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + [customRulesMd]: [ + { "lineNumber": 12, + "ruleNames": [ "any-blockquote-markdown-it" ], + "ruleDescription": "Rule that reports an error for any blockquote", + "ruleInformation": + `${homepage}/blob/main/test/rules/any-blockquote.js`, + "errorDetail": "Blockquote spans 1 line(s).", + "errorContext": "> Blockquote", + "errorRange": null }, + { "lineNumber": 12, + "ruleNames": [ "any-blockquote-micromark" ], + "ruleDescription": "Rule that reports an error for any blockquote", + "ruleInformation": + `${homepage}/blob/main/test/rules/any-blockquote.js`, + "errorDetail": "Blockquote spans 1 line(s).", + "errorContext": "> Blockquote", + "errorRange": null }, + { "lineNumber": 2, + "ruleNames": [ "every-n-lines" ], + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 2", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 4, + "ruleNames": [ "every-n-lines" ], + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 4", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 6, + "ruleNames": [ "every-n-lines" ], + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 6", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 10, + "ruleNames": [ "every-n-lines" ], + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 10", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 12, + "ruleNames": [ "every-n-lines" ], + "ruleDescription": "Rule that reports an error every N lines", + "ruleInformation": null, + "errorDetail": "Line number 12", + "errorContext": null, + "errorRange": null }, + { "lineNumber": 1, + "ruleNames": [ "first-line" ], + "ruleDescription": "Rule that reports an error for the first line", + "ruleInformation": null, + "errorDetail": null, + "errorContext": null, + "errorRange": null }, + { "lineNumber": 3, + "ruleNames": [ "letters-E-X", "letter-E-letter-X", "contains-ex" ], + "ruleDescription": + "Rule that reports an error for lines with the letters 'EX'", + "ruleInformation": `${homepage}/blob/main/test/rules/letters-E-X.js`, + "errorDetail": null, + "errorContext": "text", + "errorRange": null }, + { "lineNumber": 7, + "ruleNames": [ "letters-E-X", "letter-E-letter-X", "contains-ex" ], + "ruleDescription": + "Rule that reports an error for lines with the letters 'EX'", + "ruleInformation": `${homepage}/blob/main/test/rules/letters-E-X.js`, + "errorDetail": null, + "errorContext": "text", + "errorRange": null } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore + const actualMessage = actualResult.toString(); + const expectedMessage = + "./test/custom-rules.md: 12: any-blockquote-markdown-it" + + " Rule that reports an error for any blockquote" + + " [Blockquote spans 1 line(s).] [Context: \"> Blockquote\"]\n" + + "./test/custom-rules.md: 12: any-blockquote-micromark" + + " Rule that reports an error for any blockquote" + + " [Blockquote spans 1 line(s).] [Context: \"> Blockquote\"]\n" + + "./test/custom-rules.md: 2: every-n-lines" + + " Rule that reports an error every N lines [Line number 2]\n" + + "./test/custom-rules.md: 4: every-n-lines" + + " Rule that reports an error every N lines [Line number 4]\n" + + "./test/custom-rules.md: 6: every-n-lines" + + " Rule that reports an error every N lines [Line number 6]\n" + + "./test/custom-rules.md: 10: every-n-lines" + + " Rule that reports an error every N lines [Line number 10]\n" + + "./test/custom-rules.md: 12: every-n-lines" + + " Rule that reports an error every N lines [Line number 12]\n" + + "./test/custom-rules.md: 1: first-line" + + " Rule that reports an error for the first line\n" + + "./test/custom-rules.md: 3: letters-E-X/letter-E-letter-X/contains-ex" + + " Rule that reports an error for lines with the letters 'EX'" + + " [Context: \"text\"]\n" + + "./test/custom-rules.md: 7: letters-E-X/letter-E-letter-X/contains-ex" + + " Rule that reports an error for lines with the letters 'EX'" + + " [Context: \"text\"]"; + t.is(actualMessage, expectedMessage, "Incorrect message."); + resolve(); + }); +})); + +test("customRulesConfig", (t) => new Promise((resolve) => { + t.plan(2); + const customRulesMd = "./test/custom-rules.md"; + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": customRules.all, + "files": [ customRulesMd ], + "config": { + "blockquote": true, + "every-n-lines": { + "n": 3 + }, + "letters-e-x": false + }, + markdownItFactory, + // @ts-ignore + "resultVersion": 0 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + [customRulesMd]: { + "any-blockquote-markdown-it": [ 12 ], + "any-blockquote-micromark": [ 12 ], + "every-n-lines": [ 3, 6, 12 ], + "first-line": [ 1 ], + "letters-E-X": [ 7 ] + } + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("customRulesNpmPackage", (t) => new Promise((resolve) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + require("./rules/npm"), + require("markdownlint-rule-extended-ascii") + ], + markdownItFactory, + "strings": { + "string": "# Text\n\n---\n\nText ✅\n" + }, + // @ts-ignore + "resultVersion": 0 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "string": { + "extended-ascii": [ 5 ], + "sample-rule": [ 3 ] + } + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("customRulesBadProperty", (t) => { + t.plan(30); + for (const testCase of [ + { + "propertyName": "names", + "propertyValues": + [ null, "string", [], [ null ], [ "" ], [ "string", 10 ] ] + }, + { + "propertyName": "description", + "propertyValues": [ null, 10, "", [] ] + }, + { + "propertyName": "information", + "propertyValues": [ 10, [], "string", "https://example.com" ] + }, + { + "propertyName": "asynchronous", + "propertyValues": [ null, 10, "", [] ] + }, + { + "propertyName": "tags", + "propertyValues": + [ null, "string", [], [ null ], [ "" ], [ "string", 10 ] ] + }, + { + "propertyName": "parser", + "propertyValues": + [ 10, "string", [] ] + }, + { + "propertyName": "function", + "propertyValues": [ null, "string", [] ] + } + ]) { + const { propertyName, propertyValues } = testCase; + for (const propertyValue of propertyValues) { + const badRule = { + ...customRules.firstLine, + [propertyName]: propertyValue + }; + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ badRule ] + }; + t.throws( + function badRuleCall() { + lintSync(options); + }, + { + "message": + `Property '${propertyName}' of custom rule at index 0 is incorrect: '${propertyValue}'.` + }, + `Did not get correct exception for property '${propertyName}' value '${propertyValue}'.` + ); + } + } +}); + +test("customRulesUsedNameName", (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name", "NO-missing-SPACE-atx" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function noop() {} + } + ] + }, function callback(err, result) { + t.truthy(err, "Did not get an error for duplicate name."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.message, + "Name 'NO-missing-SPACE-atx' of custom rule at index 0 is " + + "already used as a name or tag.", + "Incorrect message for duplicate name."); + t.true(!result, "Got result for duplicate name."); + resolve(); + }); +})); + +test("customRulesUsedNameTag", (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name", "HtMl" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function noop() {} + } + ] + }, function callback(err, result) { + t.truthy(err, "Did not get an error for duplicate name."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.message, + "Name 'HtMl' of custom rule at index 0 is already used as a name or tag.", + "Incorrect message for duplicate name."); + t.true(!result, "Got result for duplicate name."); + resolve(); + }); +})); + +test("customRulesUsedTagName", (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "filler" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function noop() {} + }, + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag", "NO-missing-SPACE-atx" ], + "parser": "none", + "function": function noop() {} + } + ] + }, function callback(err, result) { + t.truthy(err, "Did not get an error for duplicate tag."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.message, + "Tag 'NO-missing-SPACE-atx' of custom rule at index 1 is " + + "already used as a name.", + "Incorrect message for duplicate name."); + t.true(!result, "Got result for duplicate tag."); + resolve(); + }); +})); + +test("customRulesParserUndefined", (t) => { + t.plan(5); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + // @ts-ignore + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "function": + (params) => { + t.true(Object.keys(params).includes("tokens")); + t.is(Object.keys(params.parsers).length, 1); + t.truthy(params.parsers.markdownit); + t.is(Object.keys(params.parsers.markdownit).length, 1); + t.truthy(params.parsers.markdownit.tokens); + } + } + ], + markdownItFactory, + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesParserNone", (t) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": + (params) => { + t.false(Object.keys(params).includes("tokens")); + t.is(Object.keys(params.parsers).length, 0); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesParserMarkdownIt", (t) => { + t.plan(5); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": + (params) => { + t.false(Object.keys(params).includes("tokens")); + t.is(Object.keys(params.parsers).length, 1); + t.truthy(params.parsers.markdownit); + t.is(Object.keys(params.parsers.markdownit).length, 1); + t.truthy(params.parsers.markdownit.tokens); + } + } + ], + markdownItFactory, + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesParserMicromark", (t) => { + t.plan(5); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "micromark", + "function": + (params) => { + t.false(Object.keys(params).includes("tokens")); + t.is(Object.keys(params.parsers).length, 1); + t.truthy(params.parsers.micromark); + t.is(Object.keys(params.parsers.micromark).length, 1); + t.truthy(params.parsers.micromark.tokens); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesMarkdownItFactoryUndefined", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": () => {} + } + ], + "strings": { + "string": "# Heading\n" + } + }; + t.throws( + () => lintSync(options), + { + "message": "The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set." + }, + "No exception when markdownItFactory is undefined." + ); +}); + +test("customRulesMarkdownItFactoryNotNeededSync", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": () => {} + } + ], + "markdownItFactory": () => t.fail(), + "strings": { + "string": "# Heading\n" + } + }; + t.pass(); + return lintSync(options); +}); + +test("customRulesMarkdownItFactoryNeededSync", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": () => {} + } + ], + "markdownItFactory": () => t.pass() && markdownIt(), + "strings": { + "string": "# Heading\n" + } + }; + return lintSync(options); +}); + +test("customRulesMarkdownItFactoryNotNeededAsync", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": () => {} + } + ], + "markdownItFactory": () => t.fail(), + "strings": { + "string": "# Heading\n" + } + }; + t.pass(); + return lintPromise(options); +}); + +test("customRulesMarkdownItFactoryNeededAsyncRunsSync", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": () => {} + } + ], + "markdownItFactory": () => t.pass() && markdownIt(), + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesMarkdownItFactoryNeededAsyncRunsAsync", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": () => {} + } + ], + "markdownItFactory": () => t.pass() && Promise.resolve(markdownIt()), + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesMarkdownItFactoryNeededAsyncRunsAsyncWithImport", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": () => {} + } + ], + "markdownItFactory": () => import("markdown-it").then((module) => t.pass() && module.default()), + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesMarkdownItInstanceCanBeReusedSync", (t) => { + t.plan(1); + const markdownItInstance = markdownItFactory(); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": () => {} + } + ], + "markdownItFactory": () => markdownItInstance, + "strings": { + "string": "# Heading" + } + }; + t.deepEqual(lintSync(options), lintSync(options)); +}); + +test("customRulesMarkdownItInstanceCanBeReusedAsync", async(t) => { + t.plan(1); + const markdownItInstance = markdownItFactory(); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": () => {} + } + ], + "markdownItFactory": () => Promise.resolve(markdownItInstance), + "strings": { + "string": "# Heading" + } + }; + t.deepEqual(await lintPromise(options), await lintPromise(options)); +}); + +test("customRulesMarkdownItParamsTokensSameObject", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + // @ts-ignore + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "function": + (params) => { + // @ts-ignore + t.is(params.tokens, params.parsers.markdownit.tokens); + } + } + ], + markdownItFactory, + "strings": { + "string": "# Heading\n" + } + }; + return lintPromise(options); +}); + +test("customRulesMarkdownItTokensSnapshot", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": + (params) => { + t.snapshot(params.parsers.markdownit.tokens, "Unexpected tokens"); + } + } + ], + markdownItFactory, + "noInlineConfig": true + }; + return fs + .readFile("./test/every-markdown-syntax.md", "utf8") + .then((content) => { + options.strings = { "content": content.split(newLineRe).join("\n") }; + return lintPromise(options); + }); +}); + +test("customRulesMicromarkTokensSnapshot", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "micromark", + "function": + (params) => { + t.snapshot(params.parsers.micromark.tokens, "Unexpected tokens"); + } + } + ], + "noInlineConfig": true + }; + return fs + .readFile("./test/every-markdown-syntax.md", "utf8") + .then((content) => { + options.strings = { "content": content.split(newLineRe).join("\n") }; + return lintPromise(options); + }); +}); + +test("customRulesDefinitionStatic", (t) => new Promise((resolve) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "information": new URL("https://example.com/information"), + "tags": [ "tag" ], + "parser": "none", + "function": (params, onError) => { + // @ts-ignore + const definition = options.customRules[0]; + definition.names[0] = "changed"; + definition.description = "changed"; + definition.information.pathname = "changed"; + onError({ + "lineNumber": 1 + }); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }; + lintAsync(options, (err, actualResult) => { + t.falsy(err); + const expectedResult = { + "string": [ + { + "lineNumber": 1, + "ruleNames": [ "name" ], + "ruleDescription": "description", + "ruleInformation": "https://example.com/information", + "errorDetail": null, + "errorContext": null, + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("customRulesThrowForFile", (t) => new Promise((resolve) => { + t.plan(4); + const exceptionMessage = "Test exception message"; + lintAsync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function throws() { + throw new Error(exceptionMessage); + } + } + ], + "files": [ "./test/custom-rules.md" ] + }, function callback(err, result) { + t.truthy(err, "Did not get an error for function thrown."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.message, exceptionMessage, + "Incorrect message for function thrown."); + t.true(!result, "Got result for function thrown."); + resolve(); + }); +})); + +test("customRulesThrowForFileSync", (t) => { + t.plan(1); + const exceptionMessage = "Test exception message"; + t.throws( + function customRuleThrowsCall() { + lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function throws() { + throw new Error(exceptionMessage); + } + } + ], + "files": [ "./test/custom-rules.md" ] + }); + }, + { + "message": exceptionMessage + }, + "Did not get correct exception for function thrown." + ); +}); + +test("customRulesThrowForString", (t) => new Promise((resolve) => { + t.plan(4); + const exceptionMessage = "Test exception message"; + lintAsync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function throws() { + throw new Error(exceptionMessage); + } + } + ], + "strings": { + "string": "String" + } + }, function callback(err, result) { + t.truthy(err, "Did not get an error for function thrown."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.message, exceptionMessage, + "Incorrect message for function thrown."); + t.true(!result, "Got result for function thrown."); + resolve(); + }); +})); + +test("customRulesThrowForStringSync", (t) => { + t.plan(1); + const exceptionMessage = "Test exception message"; + t.throws( + function customRuleThrowsCall() { + lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function throws() { + throw new Error(exceptionMessage); + } + } + ], + "strings": { + "string": "String" + } + }); + }, + { + "message": exceptionMessage + }, + "Did not get correct exception for function thrown." + ); +}); + +test("customRulesOnErrorNull", (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorNull(params, onError) { + // @ts-ignore + onError(null); + } + } + ], + "strings": { + "string": "String" + } + }, + function callback(err, result) { + t.truthy(err, "Did not get an error for function thrown."); + t.true(err instanceof Error, "Error not instance of Error."); + t.is( + // @ts-ignore + err.message, + "Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.", + "Did not get correct exception for null object." + ); + t.true(!result, "Got result for function thrown."); + resolve(); + }); +})); + +test("customRulesOnErrorNullSync", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorNull(params, onError) { + // @ts-ignore + onError(null); + } + } + ], + "strings": { + "string": "String" + } + }; + t.throws( + function nullErrorCall() { + lintSync(options); + }, + { + "message": "Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'." + }, + "Did not get correct exception for null object." + ); +}); + +test("customRulesOnErrorBad", (t) => { + t.plan(25); + for (const testCase of [ + { + "propertyName": "lineNumber", + "propertyValues": [ null, "string" ] + }, + { + "propertyName": "detail", + "propertyValues": [ 10, [] ] + }, + { + "propertyName": "context", + "propertyValues": [ 10, [] ] + }, + { + "propertyName": "information", + "propertyValues": [ 10, [], "string", "https://example.com" ] + }, + { + "propertyName": "range", + "propertyValues": [ 10, [], [ 10 ], [ 10, null ], [ 10, 11, 12 ] ] + }, + { + "propertyName": "fixInfo", + "propertyValues": [ 10, "string" ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "lineNumber", + "propertyValues": [ null, "string" ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "editColumn", + "propertyValues": [ null, "string" ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "deleteCount", + "propertyValues": [ null, "string" ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "insertText", + "propertyValues": [ 10, [] ] + } + ]) { + const { propertyName, subPropertyName, propertyValues } = testCase; + for (const propertyValue of propertyValues) { + const badObject = { + "lineNumber": 1 + }; + let propertyNames = null; + if (subPropertyName) { + // @ts-ignore + badObject[propertyName] = {}; + // @ts-ignore + badObject[propertyName][subPropertyName] = propertyValue; + propertyNames = `${propertyName}.${subPropertyName}`; + } else { + // @ts-ignore + badObject[propertyName] = propertyValue; + propertyNames = propertyName; + } + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorBad(params, onError) { + // @ts-ignore + onError(badObject); + } + } + ], + "strings": { + "string": "String" + } + }; + t.throws( + function badErrorCall() { + lintSync(options); + }, + { + "message": + `Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.` + }, + "Did not get correct exception for bad object." + ); + } + } +}); + +test("customRulesOnErrorInvalid", (t) => { + t.plan(17); + for (const testCase of [ + { + "propertyName": "lineNumber", + "propertyValues": [ -1, 0, 3, 4 ] + }, + { + "propertyName": "range", + "propertyValues": [ [ 0, 1 ], [ 1, 0 ], [ 5, 1 ], [ 1, 5 ], [ 4, 2 ] ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "lineNumber", + "propertyValues": [ -1, 0, 3, 4 ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "editColumn", + "propertyValues": [ 0, 6 ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "deleteCount", + "propertyValues": [ -2, 5 ] + } + ]) { + const { propertyName, subPropertyName, propertyValues } = testCase; + for (const propertyValue of propertyValues) { + const badObject = { + "lineNumber": 1 + }; + let propertyNames = null; + if (subPropertyName) { + // @ts-ignore + badObject[propertyName] = {}; + // @ts-ignore + badObject[propertyName][subPropertyName] = propertyValue; + propertyNames = `${propertyName}.${subPropertyName}`; + } else { + // @ts-ignore + badObject[propertyName] = propertyValue; + propertyNames = propertyName; + } + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorInvalid(params, onError) { + // @ts-ignore + onError(badObject); + } + } + ], + "strings": { + "string": "Text\ntext" + } + }; + t.throws( + function invalidErrorCall() { + lintSync(options); + }, + { + "message": + `Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.` + }, + "Did not get correct exception for invalid object." + ); + } + } +}); + +test("customRulesOnErrorValid", (t) => { + t.plan(24); + for (const testCase of [ + { + "propertyName": "lineNumber", + "propertyValues": [ 1, 2 ] + }, + { + "propertyName": "range", + "propertyValues": [ [ 1, 1 ], [ 1, 4 ], [ 2, 2 ], [ 3, 2 ], [ 4, 1 ] ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "lineNumber", + "propertyValues": [ 1, 2 ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "editColumn", + "propertyValues": [ 1, 2, 4, 5 ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "deleteCount", + "propertyValues": [ -1, 0, 1, 4 ] + }, + { + "propertyName": "fixInfo", + "subPropertyName": "insertText", + "propertyValues": + [ "", "1", "123456", "\n", "\nText", "Text\n", "\nText\n" ] + } + ]) { + const { propertyName, subPropertyName, propertyValues } = testCase; + for (const propertyValue of propertyValues) { + const goodObject = { + "lineNumber": 1 + }; + if (subPropertyName) { + // @ts-ignore + goodObject[propertyName] = {}; + // @ts-ignore + goodObject[propertyName][subPropertyName] = propertyValue; + } else { + // @ts-ignore + goodObject[propertyName] = propertyValue; + } + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorValid(params, onError) { + // @ts-ignore + onError(goodObject); + } + } + ], + "strings": { + "string": "Text\ntext" + } + }; + lintSync(options); + t.truthy(true); + } + } +}); + +test("customRulesOnErrorLazy", (t) => new Promise((resolve) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorLazy(params, onError) { + onError({ + "lineNumber": 1, + "detail": "", + "context": "", + "range": [ 1, 1 ] + }); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "string": [ + { + "lineNumber": 1, + "ruleNames": [ "name" ], + "ruleDescription": "description", + "ruleInformation": null, + "errorDetail": null, + "errorContext": null, + "errorRange": [ 1, 1 ], + "fixInfo": null, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("customRulesOnErrorModified", (t) => new Promise((resolve) => { + t.plan(2); + const errorObject = { + "lineNumber": 1, + "detail": "detail", + "context": "context", + "information": new URL("https://example.com/information"), + "range": [ 1, 2 ], + "fixInfo": { + "editColumn": 1, + "deleteCount": 2, + "insertText": "text" + } + }; + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorModified(params, onError) { + onError(errorObject); + errorObject.lineNumber = 2; + errorObject.detail = "changed"; + errorObject.context = "changed"; + errorObject.information = new URL("https://example.com/changed"); + errorObject.range[1] = 3; + errorObject.fixInfo.editColumn = 2; + errorObject.fixInfo.deleteCount = 3; + errorObject.fixInfo.insertText = "changed"; + } + } + ], + "strings": { + "string": "# Heading\n" + } + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "string": [ + { + "lineNumber": 1, + "ruleNames": [ "name" ], + "ruleDescription": "description", + "ruleInformation": "https://example.com/information", + "errorDetail": "detail", + "errorContext": "context", + "errorRange": [ 1, 2 ], + "fixInfo": { + "editColumn": 1, + "deleteCount": 2, + "insertText": "text" + }, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("customRulesOnErrorInvalidHandled", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorInvalid(params, onError) { + onError({ + "lineNumber": 13 + }); + } + } + ], + "strings": { + "string": "# Heading\n" + }, + "handleRuleFailures": true + }, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "string": [ + { + "lineNumber": 1, + "ruleNames": [ "name" ], + "ruleDescription": "description", + "ruleInformation": null, + "errorDetail": "This rule threw an exception: " + + "Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.", + "errorContext": null, + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("customRulesOnErrorInvalidHandledSync", (t) => { + t.plan(1); + const actualResult = lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function onErrorInvalid(params, onError) { + onError({ + "lineNumber": 13, + "detail": "N/A" + }); + } + } + ], + "strings": { + "string": "# Heading\n" + }, + "handleRuleFailures": true + }); + const expectedResult = { + "string": [ + { + "lineNumber": 1, + "ruleNames": [ "name" ], + "ruleDescription": "description", + "ruleInformation": null, + "errorDetail": "This rule threw an exception: " + + "Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.", + "errorContext": null, + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); +}); + +test("customRulesVersion", (t) => new Promise((resolve) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function stringName(params) { + t.is(params.version, version, "Incorrect version"); + } + } + ], + "files": "doc/CustomRules.md" + }; + lintAsync(options, function callback(err) { + t.falsy(err); + resolve(); + }); +})); + +test("customRulesFileName", (t) => new Promise((resolve) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function stringName(params) { + t.is(params.name, "doc/CustomRules.md", "Incorrect file name"); + } + } + ], + "files": "doc/CustomRules.md" + }; + lintAsync(options, function callback(err) { + t.falsy(err); + resolve(); + }); +})); + +test("customRulesStringName", (t) => new Promise((resolve) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": function stringName(params) { + t.is(params.name, "string", "Incorrect string name"); + } + } + ], + "strings": { + "string": "# Heading" + } + }; + lintAsync(options, function callback(err) { + t.falsy(err); + resolve(); + }); +})); + +test("customRulesOnErrorInformationNotRuleNotError", (t) => { + t.plan(1); + const actualResult = lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": (params, onError) => { + onError({ + "lineNumber": 1 + }); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }); + t.true(actualResult.string[0].ruleInformation === null, "Unexpected URL."); +}); + +test("customRulesOnErrorInformationRuleNotError", (t) => { + t.plan(1); + const actualResult = lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "information": new URL("https://example.com/rule"), + "parser": "none", + "function": (params, onError) => { + onError({ + "lineNumber": 1 + }); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }); + t.is( + actualResult.string[0].ruleInformation, + "https://example.com/rule", + "Unexpected URL." + ); +}); + +test("customRulesOnErrorInformationNotRuleError", (t) => { + t.plan(1); + const actualResult = lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": (params, onError) => { + onError({ + "lineNumber": 1, + "information": new URL("https://example.com/error") + }); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }); + t.is( + actualResult.string[0].ruleInformation, + "https://example.com/error", + "Unexpected URL." + ); +}); + +test("customRulesOnErrorInformationRuleError", (t) => { + t.plan(1); + const actualResult = lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "information": new URL("https://example.com/rule"), + "parser": "none", + "function": (params, onError) => { + onError({ + "lineNumber": 1, + "information": new URL("https://example.com/error") + }); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }); + t.is( + actualResult.string[0].ruleInformation, + "https://example.com/error", + "Unexpected URL." + ); +}); + +test("customRulesOnErrorInformationRuleErrorUndefined", (t) => { + t.plan(1); + const actualResult = lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "information": new URL("https://example.com/rule"), + "parser": "none", + "function": (params, onError) => { + onError({ + "lineNumber": 1, + "information": undefined + }); + } + } + ], + "strings": { + "string": "# Heading\n" + } + }); + t.is( + actualResult.string[0].ruleInformation, + "https://example.com/rule", + "Unexpected URL." + ); +}); + +test("customRulesOnErrorInformationRuleErrorMultiple", (t) => { + t.plan(6); + const actualResult = lintSync({ + /** @type {import("markdownlint").Rule[]} */ + "customRules": [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "information": new URL("https://example.com/rule"), + "parser": "none", + "function": (params, onError) => { + onError({ + "lineNumber": 1, + "information": new URL("https://example.com/errorA") + }); + onError({ + "lineNumber": 3, + "information": new URL("https://example.com/errorB") + }); + onError({ + "lineNumber": 5 + }); + } + } + ], + "strings": { + "string": "# Heading\n\nText\n\nText\n" + } + }); + t.is( + actualResult.string[0].lineNumber, + 1, + "Unexpected line number." + ); + t.is( + actualResult.string[0].ruleInformation, + "https://example.com/errorA", + "Unexpected URL." + ); + t.is( + actualResult.string[1].lineNumber, + 3, + "Unexpected line number." + ); + t.is( + actualResult.string[1].ruleInformation, + "https://example.com/errorB", + "Unexpected URL." + ); + t.is( + actualResult.string[2].lineNumber, + 5, + "Unexpected line number." + ); + t.is( + actualResult.string[2].ruleInformation, + "https://example.com/rule", + "Unexpected URL." + ); +}); + +test("customRulesDoc", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "files": "./doc/CustomRules.md", + "config": { + "MD013": { "line_length": 200 } + } + }, function callback(err, actual) { + t.falsy(err); + const expected = { "./doc/CustomRules.md": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("customRulesLintJavaScript", (t) => new Promise((resolve) => { + t.plan(2); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": customRules.lintJavaScript, + "files": "test/lint-javascript.md", + markdownItFactory + }; + lintAsync(options, (err, actual) => { + t.falsy(err); + const expected = { + "test/lint-javascript.md": [ + { + "lineNumber": 12, + "ruleNames": [ "lint-javascript" ], + "ruleDescription": "Rule that lints JavaScript code", + "ruleInformation": null, + "errorDetail": "'console' is not defined.", + "errorContext": "console.log(x);", + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("customRulesValidateJson", (t) => new Promise((resolve) => { + t.plan(3); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": customRules.validateJson, + "files": "test/validate-json.md", + markdownItFactory + }; + lintAsync(options, (err, actual) => { + t.falsy(err); + const expected = { + "test/validate-json.md": [ + { + "lineNumber": 22, + "ruleNames": [ "validate-json" ], + "ruleDescription": "Rule that validates JSON code", + "ruleInformation": null, + "errorContext": null, + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + t.true( + actual && (actual["test/validate-json.md"][0].errorDetail?.length !== 0), + "Missing errorDetail" + ); + // @ts-ignore + delete actual["test/validate-json.md"][0].errorDetail; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("customRulesAsyncThrowsInSyncContext", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name1", "name2" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "asynchronous": true, + "function": () => {} + } + ], + "strings": { + "string": "Unused" + } + }; + t.throws( + () => lintSync(options), + { + "message": "Custom rule name1/name2 at index 0 is asynchronous and " + + "can not be used in a synchronous context." + }, + "Did not get correct exception for async rule in sync context." + ); +}); + +test("customRulesParamsConfigExcludesSeverity", (t) => { + t.plan(4); + /** @type {import("markdownlint").Rule} */ + const ruleBase = { + "names": [ "tbd" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "asynchronous": true, + "function": ({ config }) => { + t.is(typeof config, "object"); + t.is(typeof config.severity, "undefined"); + } + }; + /** @type {import("markdownlint").Options} */ + const options = { + "config": { + "name1": { + "severity": "error" + }, + "name2": { + "key": "value", + "severity": "error" + } + }, + "customRules": [ + { + ...ruleBase, + "names": [ "name1" ] + }, + { + ...ruleBase, + "names": [ "name2" ] + } + ], + "strings": { + "string": "Unused" + } + }; + return lintPromise(options); +}); + +test("customRulesParamsAreFrozen", (t) => { + /** + * Asserts that rule parameters are frozen. + * + * @param {import("markdownlint").RuleParams} params Rule parameters. + * @returns {void} + */ + const assertParamsFrozen = (params) => { + const pending = [ params ]; + let current = null; + while ((current = pending.shift())) { + t.true(Object.isFrozen(current)); + for (const name of Object.getOwnPropertyNames(current)) { + // @ts-ignore + const value = current[name]; + if ( + value && + (typeof value === "object") && + (name !== "parent") + ) { + pending.push(value); + } + } + } + }; + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "none" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": assertParamsFrozen + }, + { + "names": [ "markdownit" ], + "description": "description", + "tags": [ "tag" ], + "parser": "markdownit", + "function": assertParamsFrozen + }, + { + "names": [ "micromark" ], + "description": "description", + "tags": [ "tag" ], + "parser": "micromark", + "function": assertParamsFrozen + } + ], + "files": [ "README.md" ], + markdownItFactory + }; + return lintPromise(options); +}); + +test("customRulesParamsAreStable", (t) => { + t.plan(4); + const config1 = { "value1": 10 }; + const config2 = { "value2": 20 }; + /** @type {import("markdownlint").Options} */ + const options = { + "config": { + "MD010": true, + "name1": config1, + "MD013": { "line_length": 200 }, + "name2": config2, + "MD033": false + }, + "customRules": [ + { + "names": [ "name1" ], + "description": "description1", + "tags": [ "tag" ], + "asynchronous": true, + "parser": "none", + "function": + (params) => { + const { config } = params; + t.deepEqual(config, config1, `Unexpected config in sync path: ${config}.`); + return Promise.resolve().then(() => { + t.deepEqual(config, config1, `Unexpected config in async path: ${config}.`); + }); + } + }, + { + "names": [ "name2" ], + "description": "description2", + "tags": [ "tag" ], + "asynchronous": true, + "parser": "none", + "function": + (params) => { + const { config } = params; + t.deepEqual(config, config2, `Unexpected config in sync path: ${config}.`); + return Promise.resolve().then(() => { + t.deepEqual(config, config2, `Unexpected config in async path: ${config}.`); + }); + } + } + ], + "strings": { + "string": "# Heading" + } + }; + return lintPromise(options); +}); + +test("customRulesParamsAreExpected", (t) => { + t.plan(4); + /** @type {import("markdownlint").Options} */ + const options = { + "config": { + // "name1" default enabled + "name2": true, + "name3": {}, + "name4": { "value": 10 } + }, + "customRules": [ + { + "names": [ "name1" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": (params) => t.deepEqual(params.config, {}) + }, + { + "names": [ "name2" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": (params) => t.deepEqual(params.config, {}) + }, + { + "names": [ "name3" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": (params) => t.deepEqual(params.config, {}) + }, + { + "names": [ "name4" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "function": (params) => t.deepEqual(params.config, { "value": 10 }) + } + ], + "strings": { + "string": "# Heading" + } + }; + return lintPromise(options); +}); + +test("customRulesAsyncReadFiles", (t) => { + t.plan(3); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "name1" ], + "description": "description1", + "information": new URL("https://example.com/asyncRule1"), + "tags": [ "tag" ], + "asynchronous": true, + "parser": "none", + "function": + (params, onError) => fs.readFile(__filename(import.meta), "utf8").then( + (content) => { + t.true(content.length > 0); + onError({ + "lineNumber": 1, + "detail": "detail1", + "context": "context1", + "range": [ 2, 3 ] + }); + } + ) + }, + { + "names": [ "name2" ], + "description": "description2", + "tags": [ "tag" ], + "asynchronous": true, + "parser": "none", + "function": + async(params, onError) => { + const content = await fs.readFile(__filename(import.meta), "utf8"); + t.true(content.length > 0); + onError({ + "lineNumber": 1, + "detail": "detail2", + "context": "context2" + }); + } + } + ], + "strings": { + "string": "# Heading" + } + }; + const expected = { + "string": [ + { + "lineNumber": 1, + "ruleNames": [ "MD047", "single-trailing-newline" ], + "ruleDescription": "Files should end with a single newline character", + "ruleInformation": `${homepage}/blob/v${version}/doc/md047.md`, + "errorDetail": null, + "errorContext": null, + "errorRange": [ 9, 1 ], + "fixInfo": { + "editColumn": 10, + "insertText": "\n" + }, + "severity": "error" + }, + { + "lineNumber": 1, + "ruleNames": [ "name1" ], + "ruleDescription": "description1", + "ruleInformation": "https://example.com/asyncRule1", + "errorDetail": "detail1", + "errorContext": "context1", + "errorRange": [ 2, 3 ], + "fixInfo": null, + "severity": "error" + }, + { + "lineNumber": 1, + "ruleNames": [ "name2" ], + "ruleDescription": "description2", + "ruleInformation": null, + "errorDetail": "detail2", + "errorContext": "context2", + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + return lintPromise(options) + .then((actual) => t.deepEqual(actual, expected, "Unexpected issues.")); +}); + +test("customRulesAsyncIgnoresSyncReturn", (t) => { + t.plan(1); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "sync" ], + "description": "description", + "information": new URL("https://example.com/asyncRule"), + "tags": [ "tag" ], + "asynchronous": false, + "parser": "none", + "function": () => new Promise(() => { + // Never resolves + }) + }, + { + "names": [ "async" ], + "description": "description", + "information": new URL("https://example.com/asyncRule"), + "tags": [ "tag" ], + "asynchronous": true, + "parser": "none", + "function": (params, onError) => new Promise((resolve) => { + onError({ "lineNumber": 1 }); + resolve(null); + }) + } + ], + "strings": { + "string": "# Heading" + } + }; + const expected = { + "string": [ + { + "lineNumber": 1, + "ruleNames": [ "async" ], + "ruleDescription": "description", + "ruleInformation": "https://example.com/asyncRule", + "errorDetail": null, + "errorContext": null, + "errorRange": null, + "fixInfo": null, + "severity": "error" + }, + { + "lineNumber": 1, + "ruleNames": [ "MD047", "single-trailing-newline" ], + "ruleDescription": "Files should end with a single newline character", + "ruleInformation": `${homepage}/blob/v${version}/doc/md047.md`, + "errorDetail": null, + "errorContext": null, + "errorRange": [ 9, 1 ], + "fixInfo": { + "editColumn": 10, + "insertText": "\n" + }, + "severity": "error" + } + ] + }; + return lintPromise(options) + .then((actual) => t.deepEqual(actual, expected, "Unexpected issues.")); +}); + +const errorMessage = "Custom error message."; +const stringScenarios = [ + [ + "Files", + [ "./test/custom-rules.md" ], + null + ], + [ + "Strings", + null, + { "./test/custom-rules.md": "# Heading\n" } + ] +]; + +for (const flavor of [ + [ + "customRulesThrowString", + () => { + throw errorMessage; + } + ], + [ + "customRulesThrowError", + () => { + throw new Error(errorMessage); + } + ] +]) { + const [ name, func ] = flavor; + /** @type {import("markdownlint").Rule[]} */ + const customRule = [ + { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + // @ts-ignore + "function": func + } + ]; + const expectedResult = { + "./test/custom-rules.md": [ + { + "lineNumber": 1, + "ruleNames": [ "name" ], + "ruleDescription": "description", + "ruleInformation": null, + "errorDetail": `This rule threw an exception: ${errorMessage}`, + "errorContext": null, + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + for (const inputs of stringScenarios) { + const [ subname, files, strings ] = inputs; + + test(`${name}${subname}UnhandledAsync`, (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + // @ts-ignore + "customRules": customRule, + // @ts-ignore + files, + // @ts-ignore + strings + }, function callback(err, result) { + t.truthy(err, "Did not get an error for exception."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.message, errorMessage, "Incorrect message for exception."); + t.true(!result, "Got result for exception."); + resolve(); + }); + })); + + test(`${name}${subname}HandledAsync`, (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + // @ts-ignore + "customRules": customRule, + // @ts-ignore + files, + // @ts-ignore + strings, + "handleRuleFailures": true + }, function callback(err, actualResult) { + t.falsy(err); + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); + })); + + test(`${name}${subname}UnhandledSync`, (t) => { + t.plan(1); + t.throws( + () => lintSync({ + // @ts-ignore + "customRules": customRule, + // @ts-ignore + files, + // @ts-ignore + strings + }), + { + "message": errorMessage + }, + "Unexpected exception." + ); + }); + + test(`${name}${subname}HandledSync`, (t) => { + t.plan(1); + const actualResult = lintSync({ + // @ts-ignore + "customRules": customRule, + // @ts-ignore + files, + // @ts-ignore + strings, + "handleRuleFailures": true + }); + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + }); + } +} + +for (const flavor of [ + [ + "customRulesAsyncExceptionString", + () => { + throw errorMessage; + } + ], + [ + "customRulesAsyncExceptionError", + () => { + throw new Error(errorMessage); + } + ], + [ + "customRulesAsyncDeferredString", + () => fs.readFile(__filename(import.meta), "utf8").then( + () => { + throw errorMessage; + } + ) + ], + [ + "customRulesAsyncDeferredError", + () => fs.readFile(__filename(import.meta), "utf8").then( + () => { + throw new Error(errorMessage); + } + ) + ], + [ + "customRulesAsyncRejectString", + () => Promise.reject(errorMessage) + ], + [ + "customRulesAsyncRejectError", + () => Promise.reject(new Error(errorMessage)) + ] +]) { + const [ name, func ] = flavor; + /** @type {import("markdownlint").Rule} */ + const customRule = { + "names": [ "name" ], + "description": "description", + "tags": [ "tag" ], + "parser": "none", + "asynchronous": true, + // @ts-ignore + "function": func + }; + for (const inputs of stringScenarios) { + const [ subname, files, strings ] = inputs; + + test(`${name}${subname}Unhandled`, (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + // @ts-ignore + "customRules": [ customRule ], + // @ts-ignore + files, + // @ts-ignore + strings + }, function callback(err, result) { + t.truthy(err, "Did not get an error for rejection."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.message, errorMessage, "Incorrect message for rejection."); + t.true(!result, "Got result for rejection."); + resolve(); + }); + })); + + test(`${name}${subname}Handled`, (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + // @ts-ignore + "customRules": [ customRule ], + // @ts-ignore + files, + // @ts-ignore + strings, + "handleRuleFailures": true + }, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "./test/custom-rules.md": [ + { + "lineNumber": 1, + "ruleNames": [ "name" ], + "ruleDescription": "description", + "ruleInformation": null, + "errorDetail": `This rule threw an exception: ${errorMessage}`, + "errorContext": null, + "errorRange": null, + "fixInfo": null, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); + })); + } +} diff --git a/test/markdownlint-test-default-config.json b/test/markdownlint-test-default-config.json deleted file mode 100644 index 3eb7f83b..00000000 --- a/test/markdownlint-test-default-config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "MD041": false -} diff --git a/test/markdownlint-test-exports.mjs b/test/markdownlint-test-exports.mjs new file mode 100644 index 00000000..43cac60f --- /dev/null +++ b/test/markdownlint-test-exports.mjs @@ -0,0 +1,88 @@ +// @ts-check + +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +import test from "ava"; +import spawn from "nano-spawn"; +import { importWithTypeJson } from "./esm-helpers.mjs"; +const packageJson = await importWithTypeJson(import.meta, "../package.json"); + +const exportMappings = new Map([ + [ ".", "../lib/exports.mjs" ], + [ "./async", "../lib/exports-async.mjs" ], + [ "./promise", "../lib/exports-promise.mjs" ], + [ "./sync", "../lib/exports-sync.mjs" ], + [ "./helpers", "../helpers/helpers.cjs" ], + [ "./style/all", "../style/all.json" ], + [ "./style/cirosantilli", "../style/cirosantilli.json" ], + [ "./style/prettier", "../style/prettier.json" ], + [ "./style/relaxed", "../style/relaxed.json" ] +]); + +test("exportMappings table", (t) => { + t.deepEqual( + Object.keys(packageJson.exports), + [ ...exportMappings.keys() ] + ); +}); + +const jsonRe = /\.json$/u; +// ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time +// const importOptionsJson = { "with": { "type": "json" } }; + +for (const [ exportName, exportPath ] of exportMappings) { + const exportByName = exportName.replace(/^\./u, packageJson.name); + test(`export mapping for ${exportByName}`, async(t) => { + t.plan(1); + const json = jsonRe.test(exportPath); + const importExportByName = json ? + require(exportByName) : + await import(exportByName); + const importExportByPath = json ? + require(exportPath) : + await import(exportPath); + t.is(importExportByName, importExportByPath); + }); +} + +test(`exported names`, async(t) => { + t.plan(1); + const exportedNames = {}; + for (const [ exportName, exportPath ] of exportMappings) { + const exportByName = exportName.replace(/^\./u, packageJson.name); + const json = jsonRe.test(exportPath); + const importExportByName = json ? + require(exportByName) : + // eslint-disable-next-line no-await-in-loop + await import(exportByName); + // Filter out module.exports to keep snapshot consistent between Node 22 (missing) and 23 (present) + exportedNames[exportByName] = Object.keys(importExportByName).filter((name) => name !== "module.exports"); + } + t.snapshot(exportedNames); +}); + +test("subpathImports and conditions", async(t) => { + t.plan(8); + const scenarios = [ + { "conditions": "browser", "throws": true }, + { "conditions": "default", "throws": false }, + { "conditions": "markdownlint-imports-browser", "throws": true }, + { "conditions": "markdownlint-imports-node", "throws": false } + ]; + for (const scenario of scenarios) { + const { conditions, throws } = scenario; + try { + // eslint-disable-next-line no-await-in-loop + await spawn("node", [ `--conditions=${conditions}`, "./standalone.mjs" ], { "cwd": "./example" }); + t.true(!throws, conditions); + } catch { + t.true(throws, conditions); + } + } + // Fake "100%" coverage for node-imports-browser.mjs + const { "fs": browserFs } = await import("../lib/node-imports-browser.mjs"); + t.throws(() => browserFs.access()); + t.throws(() => browserFs.accessSync()); + t.throws(() => browserFs.readFile()); + t.throws(() => browserFs.readFileSync()); +}); diff --git a/test/markdownlint-test-extra-parse.mjs b/test/markdownlint-test-extra-parse.mjs new file mode 100644 index 00000000..84fe3de3 --- /dev/null +++ b/test/markdownlint-test-extra-parse.mjs @@ -0,0 +1,13 @@ +// @ts-check + +import test from "ava"; +import { globby } from "globby"; +import { lint } from "markdownlint/promise"; + +// Parses all Markdown files in all package dependencies +test("parseAllFiles", async(t) => { + t.plan(1); + const files = await globby("**/*.{md,markdown}"); + await lint({ files }); + t.pass(); +}); diff --git a/test/markdownlint-test-extra-type.mjs b/test/markdownlint-test-extra-type.mjs new file mode 100644 index 00000000..f5b0c230 --- /dev/null +++ b/test/markdownlint-test-extra-type.mjs @@ -0,0 +1,28 @@ +// @ts-check + +import fs from "node:fs"; +import path from "node:path"; +import test from "ava"; +import { lint } from "markdownlint/sync"; + +// Simulates typing each test file to validate handling of partial input +const files = fs + .readdirSync("./test") + .filter((file) => /\.md$/.test(file)); +for (const file of files) { + const strings = {}; + let content = fs.readFileSync(path.join("./test", file), "utf8"); + while (content) { + strings[content.length.toString()] = content; + content = content.slice(0, -1); + } + test.serial(`type ${file}`, (t) => { + t.plan(1); + lint({ + // @ts-ignore + strings, + "resultVersion": 0 + }); + t.pass(); + }); +} diff --git a/test/markdownlint-test-fixes.mjs b/test/markdownlint-test-fixes.mjs new file mode 100644 index 00000000..6cf6407d --- /dev/null +++ b/test/markdownlint-test-fixes.mjs @@ -0,0 +1,530 @@ +// @ts-check + +import test from "ava"; +import { applyFix, applyFixes } from "markdownlint"; + +test("applyFix", (t) => { + t.plan(4); + const testCases = [ + [ + "Hello world.", + { + "editColumn": 12, + "deleteCount": 1 + }, + undefined, + "Hello world" + ], + [ + "Hello world.", + { + "editColumn": 13, + "insertText": "\n" + }, + undefined, + "Hello world.\n" + ], + [ + "Hello world.", + { + "editColumn": 13, + "insertText": "\n" + }, + "\n", + "Hello world.\n" + ], + [ + "Hello world.", + { + "editColumn": 13, + "insertText": "\n" + }, + "\r\n", + "Hello world.\r\n" + ] + ]; + for (const testCase of testCases) { + const [ line, fixInfo, lineEnding, expected ] = testCase; + // @ts-ignore + const actual = applyFix(line, fixInfo, lineEnding); + t.is(actual, String(expected), "Incorrect fix applied."); + } +}); + +test("applyFixes", (t) => { + t.plan(30); + const testCases = [ + [ + "Hello world.", + [], + "Hello world." + ], + [ + "Hello world.", + [ + { + "lineNumber": 1, + "fixInfo": {} + } + ], + "Hello world." + ], + [ + "Hello world.", + [ + { + "lineNumber": 1, + "fixInfo": { + "insertText": "Very " + } + } + ], + "Very Hello world." + ], + [ + "Hello world.", + [ + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 7, + "insertText": "big " + } + } + ], + "Hello big world." + ], + [ + "Hello world.", + [ + { + "lineNumber": 1, + "fixInfo": { + "deleteCount": 6 + } + } + ], + "world." + ], + [ + "Hello world.", + [ + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 7, + "deleteCount": 5, + "insertText": "there" + } + } + ], + "Hello there." + ], + [ + "Hello world.", + [ + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 12, + "deleteCount": 1 + } + }, + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 6, + "deleteCount": 1 + } + } + ], + "Helloworld" + ], + [ + "Hello world.", + [ + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 13, + "insertText": " Hi." + } + } + ], + "Hello world. Hi." + ], + [ + "Hello\nworld", + [ + { + "lineNumber": 1, + "fixInfo": { + "deleteCount": -1 + } + } + ], + "world" + ], + [ + "Hello\nworld", + [ + { + "lineNumber": 2, + "fixInfo": { + "deleteCount": -1 + } + } + ], + "Hello" + ], + [ + "Hello\nworld", + [ + { + "lineNumber": 2, + "fixInfo": { + "lineNumber": 1, + "deleteCount": -1 + } + } + ], + "world" + ], + [ + "Hello\nworld", + [ + { + "lineNumber": 1, + "fixInfo": { + "lineNumber": 2, + "deleteCount": -1 + } + } + ], + "Hello" + ], + [ + "Hello world", + [ + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 4, + "deleteCount": 1 + } + }, + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 10, + "deleteCount": 1 + } + } + ], + "Helo word" + ], + [ + "Hello world", + [ + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 10, + "deleteCount": 1 + } + }, + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 4, + "deleteCount": 1 + } + } + ], + "Helo word" + ], + [ + "Hello\nworld", + [ + { + "fixInfo": { + "lineNumber": 1, + "deleteCount": -1 + } + }, + { + "fixInfo": { + "lineNumber": 1, + "insertText": "Big " + } + } + ], + "world" + ], + [ + "Hello\nworld", + [ + { + "fixInfo": { + "lineNumber": 1, + "deleteCount": -1 + } + }, + { + "fixInfo": { + "lineNumber": 2, + "deleteCount": -1 + } + } + ], + "" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "insertText": "aa" + } + }, + { + "fixInfo": { + "lineNumber": 1, + "insertText": "b" + } + } + ], + "aaHello world" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "insertText": "a" + } + }, + { + "fixInfo": { + "lineNumber": 1, + "insertText": "bb" + } + } + ], + "bbHello world" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 6, + "insertText": " big" + } + }, + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "deleteCount": 1 + } + } + ], + "Hello big orld" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 8, + "deleteCount": 2 + } + }, + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "deleteCount": 2 + } + } + ], + "Hello wld" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "deleteCount": 2 + } + }, + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 8, + "deleteCount": 2 + } + } + ], + "Hello wld" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "deleteCount": 1, + "insertText": "z" + } + } + ], + "Hello zorld" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "deleteCount": 1 + } + }, + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "insertText": "z" + } + } + ], + "Hello zorld" + ], + [ + "Hello world", + [ + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "insertText": "z" + } + }, + { + "fixInfo": { + "lineNumber": 1, + "editColumn": 7, + "deleteCount": 1 + } + } + ], + "Hello zorld" + ], + [ + "Hello\nworld\nhello\rworld", + [ + { + "fixInfo": { + "lineNumber": 4, + "editColumn": 6, + "insertText": "\n" + } + } + ], + "Hello\nworld\nhello\nworld\n" + ], + [ + "Hello\r\nworld\r\nhello\nworld", + [ + { + "fixInfo": { + "lineNumber": 4, + "editColumn": 6, + "insertText": "\n" + } + } + ], + "Hello\r\nworld\r\nhello\r\nworld\r\n" + ], + [ + "Hello\rworld\rhello\nworld", + [ + { + "fixInfo": { + "lineNumber": 4, + "editColumn": 6, + "insertText": "\n" + } + } + ], + "Hello\rworld\rhello\rworld\r" + ], + [ + "Hello\r\nworld", + [ + { + "lineNumber": 2, + "fixInfo": { + "editColumn": 6, + "insertText": "\n\n" + } + } + ], + "Hello\r\nworld\r\n\r\n" + ], + [ + "Hello world", + [ + { + "lineNumber": 1, + "fixInfo": { + "insertText": "x" + } + }, + { + "lineNumber": 1, + "fixInfo": { + "deleteCount": -1 + } + } + ], + "" + ], + [ + " hello world", + [ + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 1, + "deleteCount": 1 + } + }, + { + "lineNumber": 1, + "fixInfo": { + "editColumn": 2, + "deleteCount": 1, + "insertText": "H" + } + } + ], + "Hello world" + ] + ]; + for (const testCase of testCases) { + const [ input, errors, expected ] = testCase; + // @ts-ignore + const actual = applyFixes(input, errors); + t.is(actual, String(expected), "Incorrect fix applied."); + } +}); diff --git a/test/markdownlint-test-helpers.mjs b/test/markdownlint-test-helpers.mjs new file mode 100644 index 00000000..255b9066 --- /dev/null +++ b/test/markdownlint-test-helpers.mjs @@ -0,0 +1,556 @@ +// @ts-check + +import os from "node:os"; +import path from "node:path"; +import test from "ava"; +import { characterEntities } from "character-entities"; +import { gemoji } from "gemoji"; +import helpers, { formatLintResults } from "../helpers/helpers.cjs"; +import { lint } from "markdownlint/promise"; +import { forEachInlineCodeSpan } from "../lib/markdownit.cjs"; +import { getReferenceLinkImageData } from "../lib/cache.mjs"; + +test("clearHtmlCommentTextValid", (t) => { + t.plan(1); + const validComments = [ + "", + "", + "", + "", + " ", + " ", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "texttext", + "texttext", + "texttext", + "", + "texttexttext", + "texttext", + "", + "", + "", + "", + " ", + " ", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "texttext", + "texttext", + "texttext", + "", + "texttexttext", + "texttext", + "", + "", + " -->", + "text-->", + "text-->", + "", + "-->", + "t-->", + "-->", + "t-->", + "t-->", + " " + ]; + const actual = helpers.clearHtmlCommentText(invalidComments.join("\n")); + const expected = invalidComments.join("\n"); + t.is(actual, expected); +}); + +test("clearHtmlCommentTextNonGreedy", (t) => { + t.plan(1); + const nonGreedyComments = [ + " -->", + " -->", + " -->", + " -->" + ]; + const nonGreedyResult = [ + " -->", + " -->", + " -->", + " -->" + ]; + const actual = helpers.clearHtmlCommentText(nonGreedyComments.join("\n")); + const expected = nonGreedyResult.join("\n"); + t.is(actual, expected); +}); + +test("clearHtmlCommentTextEmbedded", (t) => { + t.plan(1); + const embeddedComments = [ + "texttext", + "", + "texttext", + "texttext", + "texttext" + ]; + const embeddedResult = [ + "texttext", + "", + "texttext", + "texttext", + "texttext" + ]; + const actual = helpers.clearHtmlCommentText(embeddedComments.join("\n")); + const expected = embeddedResult.join("\n"); + t.is(actual, expected); +}); + +test("isBlankLine", (t) => { + t.plan(33); + // @ts-ignore + t.true(helpers.isBlankLine(null), "[null]"); + const blankLines = [ + "", + " ", + " ", + "\t\t\t", + "\r", + "\n", + "\t\r\n", + " ", + "", + "", + "\t", + ">", + "> ", + "> > > \t", + "> ", + ">>", + " ", + "-->", + "text --> --> text", + "text ", + "text text", + "text --> text --> text " } }); + t.deepEqual( + formatLintResults(lintResults), + [ + "content:1:3 error MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading [Context: \"# Heading\"]", + "content:1 error MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: \"# Heading\"]", + "content:2:1 warning MD033/no-inline-html Inline HTML [Element: br]", + "content:2:64 error MD047/single-trailing-newline Files should end with a single newline character" + ] + ); +}); diff --git a/test/markdownlint-test-micromark.mjs b/test/markdownlint-test-micromark.mjs new file mode 100644 index 00000000..7810128f --- /dev/null +++ b/test/markdownlint-test-micromark.mjs @@ -0,0 +1,90 @@ +// @ts-check + +import fs from "node:fs/promises"; +import test from "ava"; +import { newLineRe } from "../helpers/helpers.cjs"; +import { filterByPredicate, filterByTypes } from "../helpers/micromark-helpers.cjs"; +import { getEvents, parse } from "../lib/micromark-parse.mjs"; + +const testContent = new Promise((resolve, reject) => { + fs + .readFile("./test/every-markdown-syntax.md", "utf8") + .then((content) => content.split(newLineRe).join("\n")) + .then(resolve, reject); +}); + +const testTokens = new Promise((resolve, reject) => { + testContent.then(parse).then(resolve, reject); +}); + +test("parse", async(t) => { + t.plan(1); + t.snapshot(await testTokens, "Unexpected tokens"); +}); + +test("getEvents/filterByPredicate", async(t) => { + t.plan(1); + const content = await testContent; + const events = getEvents(content); + let inHtmlFlow = false; + const eventTypes = events + .filter((event) => { + const result = !inHtmlFlow && (event[0] === "enter"); + if (event[1].type === "htmlFlow") { + inHtmlFlow = !inHtmlFlow; + } + return result; + }) + .map((event) => event[1].type); + const tokens = parse(content); + const filtered = filterByPredicate( + tokens, + () => true, + (token) => ((token.type === "htmlFlow") ? [] : token.children) + ); + const tokenTypes = filtered.map((token) => token.type); + t.deepEqual(tokenTypes, eventTypes); +}); + +test("filterByTypes, htmlFlow false", async(t) => { + t.plan(7); + const tokens = await testTokens; + /** @type {import("micromark-util-types").TokenType[]} */ + const types = [ "atxHeadingText", "codeText", "htmlText", "setextHeadingText" ]; + const filtered = filterByTypes(tokens, types); + // Using flat tokens + for (const token of filtered) { + t.true(token.type.endsWith("Text")); + } + // Not using flat tokens + t.deepEqual( + filtered, + filterByTypes([ ...tokens ], types) + ); +}); + +test("filterByTypes, htmlFlow true", async(t) => { + t.plan(9); + const tokens = await testTokens; + /** @type {import("micromark-util-types").TokenType[]} */ + const types = [ "atxHeadingText", "codeText", "htmlText", "setextHeadingText" ]; + // Using flat tokens + const filtered = filterByTypes(tokens, types, true); + for (const token of filtered) { + t.true(token.type.endsWith("Text")); + } + // Not using flat tokens + t.deepEqual( + filtered, + filterByTypes([ ...tokens ], types, true) + ); +}); + +test("filterByPredicate/filterByTypes", async(t) => { + t.plan(1); + const tokens = await testTokens; + const byPredicate = filterByPredicate(tokens, () => true); + const allTypes = new Set(byPredicate.map((token) => token.type)); + const byTypes = filterByTypes(tokens, [ ...allTypes.values() ], true); + t.deepEqual(byPredicate, byTypes); +}); diff --git a/test/markdownlint-test-parallel.mjs b/test/markdownlint-test-parallel.mjs new file mode 100644 index 00000000..1ce6121e --- /dev/null +++ b/test/markdownlint-test-parallel.mjs @@ -0,0 +1,40 @@ +// @ts-check + +import { availableParallelism } from "node:os"; +import { Worker } from "node:worker_threads"; +import { lint } from "markdownlint/sync"; +import { __filename } from "./esm-helpers.mjs"; + +/** + * Lint specified Markdown files (using multiple threads). + * + * @param {import("markdownlint").Options} options Configuration options. + * @returns {Promise} Results object. + */ +export function markdownlintParallel(options) { + const workerCount = availableParallelism(); + const files = options.files || []; + const chunkSize = Math.ceil(files.length / workerCount); + const promises = []; + for (let i = 0; i < workerCount; i++) { + promises.push(new Promise((resolve, reject) => { + const workerData = { + ...options, + "files": files.slice(i * chunkSize, (i + 1) * chunkSize) + }; + const worker = new Worker(__filename(import.meta).replace(/parallel\.mjs$/, "worker.mjs"), { workerData }); + worker.on("message", resolve); + worker.on("error", reject); + })); + } + return Promise.all(promises).then((workerResults) => { + const combinedResults = lint(null); + for (const workerResult of workerResults) { + // eslint-disable-next-line guard-for-in + for (const result in workerResult) { + combinedResults[result] = workerResult[result]; + } + } + return combinedResults; + }); +} diff --git a/test/markdownlint-test-project.mjs b/test/markdownlint-test-project.mjs new file mode 100644 index 00000000..4580f41c --- /dev/null +++ b/test/markdownlint-test-project.mjs @@ -0,0 +1,56 @@ +// @ts-check + +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +import test from "ava"; +import { globby } from "globby"; +import { lint as lintPromise } from "markdownlint/promise"; + +const projectFiles = [ + "*.md", + "doc/*.md", + "helpers/*.md", + "micromark/*.md", + "schema/*.md" +]; +const files = await globby(projectFiles); + +test("projectFiles", (t) => { + t.plan(2); + t.is(files.length, 62); + const options = { + files, + "config": require("../.markdownlint.json") + }; + return lintPromise(options).then((actual) => { + const expected = {}; + for (const file of files) { + expected[file] = []; + } + t.deepEqual(actual, expected, "Issue(s) with project files."); + }); +}); + +test("projectFilesExtendedAscii", (t) => { + t.plan(2); + const ignoreFiles = new Set([ + "doc/Rules.md", + "doc/md010.md", + "doc/md026.md", + "doc/md036.md" + ]); + const filteredFiles = files.filter((file) => !ignoreFiles.has(file)); + t.is(filteredFiles.length, 58); + const options = { + "files": filteredFiles, + "config": require("../.markdownlint.json"), + "customRules": [ require("markdownlint-rule-extended-ascii") ] + }; + return lintPromise(options).then((actual) => { + const expected = {}; + for (const file of filteredFiles) { + expected[file] = []; + } + t.deepEqual(actual, expected, "Issue(s) with project files."); + }); +}); diff --git a/test/markdownlint-test-repos-dotnet-docs.mjs b/test/markdownlint-test-repos-dotnet-docs.mjs new file mode 100644 index 00000000..a419503a --- /dev/null +++ b/test/markdownlint-test-repos-dotnet-docs.mjs @@ -0,0 +1,13 @@ +// @ts-check + +import path from "node:path"; +const { join } = path.posix; +import test from "ava"; +import { lintTestRepo } from "./markdownlint-test-repos.mjs"; + +test("https://github.com/dotnet/docs", (t) => { + const rootDir = "./test-repos/dotnet-docs"; + const globPatterns = [ join(rootDir, "**/*.md") ]; + const configPath = join(rootDir, ".markdownlint-cli2.jsonc"); + return lintTestRepo(t, globPatterns, configPath, undefined, true); +}); diff --git a/test/markdownlint-test-repos-mdn-content.mjs b/test/markdownlint-test-repos-mdn-content.mjs new file mode 100644 index 00000000..78088e86 --- /dev/null +++ b/test/markdownlint-test-repos-mdn-content.mjs @@ -0,0 +1,13 @@ +// @ts-check + +import path from "node:path"; +const { join } = path.posix; +import test from "ava"; +import { lintTestRepo } from "./markdownlint-test-repos.mjs"; + +test("https://github.com/mdn/content", (t) => { + const rootDir = "./test-repos/mdn-content"; + const globPatterns = [ join(rootDir, "**/*.md") ]; + const configPath = join(rootDir, ".markdownlint-cli2.jsonc"); + return lintTestRepo(t, globPatterns, configPath, undefined, true); +}); diff --git a/test/markdownlint-test-repos-small.mjs b/test/markdownlint-test-repos-small.mjs new file mode 100644 index 00000000..541654ef --- /dev/null +++ b/test/markdownlint-test-repos-small.mjs @@ -0,0 +1,100 @@ +// @ts-check + +import path from "node:path"; +const { join } = path.posix; +import test from "ava"; +import { excludeGlobs, lintTestRepo } from "./markdownlint-test-repos.mjs"; + +// Run markdownlint the same way the corresponding repositories do + +test("https://github.com/apache/airflow", (t) => { + const rootDir = "./test-repos/apache-airflow"; + const globPatterns = [ join(rootDir, "**/*.{md,mdown,markdown}") ]; + const configPath = join(rootDir, ".markdownlint.yml"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/electron/electron", (t) => { + const rootDir = "./test-repos/electron-electron"; + const globPatterns = [ + join(rootDir, "*.md"), + join(rootDir, "docs/**/*.md") + ]; + const configPath = join(rootDir, ".markdownlint-cli2.jsonc"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/eslint/eslint", (t) => { + const rootDir = "./test-repos/eslint-eslint"; + const globPatterns = [ join(rootDir, "docs/**/*.md") ]; + const configPath = join(rootDir, ".markdownlint.yml"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/mkdocs/mkdocs", (t) => { + const rootDir = "./test-repos/mkdocs-mkdocs"; + const globPatterns = [ + join(rootDir, "README.md"), + join(rootDir, "CONTRIBUTING.md"), + join(rootDir, "docs"), + ...excludeGlobs( + rootDir, + "docs/CNAME", + "docs/**/*.css", + "docs/**/*.png", + "docs/**/*.py", + "docs/**/*.svg" + ) + ]; + const configPath = join(rootDir, ".markdownlint.yaml"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/mochajs/mocha", (t) => { + const rootDir = "./test-repos/mochajs-mocha"; + const globPatterns = [ + join(rootDir, "*.md"), + join(rootDir, "docs/**/*.md"), + join(rootDir, ".github/*.md"), + join(rootDir, "lib/**/*.md"), + join(rootDir, "test/**/*.md"), + join(rootDir, "example/**/*.md"), + ...excludeGlobs( + rootDir, + "CHANGELOG.md" + ) + ]; + const configPath = join(rootDir, ".markdownlint.json"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/pi-hole/docs", (t) => { + const rootDir = "./test-repos/pi-hole-docs"; + const globPatterns = [ join(rootDir, "**/*.md") ]; + const configPath = join(rootDir, ".markdownlint.json"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/v8/v8.dev", (t) => { + const rootDir = "./test-repos/v8-v8-dev"; + const globPatterns = [ join(rootDir, "src/**/*.md") ]; + const configPath = join(rootDir, ".markdownlint.json"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/webhintio/hint", (t) => { + const rootDir = "./test-repos/webhintio-hint"; + const globPatterns = [ + join(rootDir, "**/*.md"), + ...excludeGlobs(rootDir, "**/CHANGELOG.md") + ]; + const configPath = join(rootDir, ".markdownlintrc"); + return lintTestRepo(t, globPatterns, configPath); +}); + +test("https://github.com/webpack/webpack.js.org", (t) => { + const rootDir = "./test-repos/webpack-webpack-js-org"; + const globPatterns = [ join(rootDir, "**/*.md") ]; + const configPath = join(rootDir, ".markdownlint.json"); + return lintTestRepo(t, globPatterns, configPath); +}); diff --git a/test/markdownlint-test-repos.mjs b/test/markdownlint-test-repos.mjs new file mode 100644 index 00000000..13b54c20 --- /dev/null +++ b/test/markdownlint-test-repos.mjs @@ -0,0 +1,70 @@ +// @ts-check + +import path from "node:path"; +const { join } = path.posix; +import { globby } from "globby"; +import jsoncParser from "jsonc-parser"; +import jsYaml from "js-yaml"; +import { formatLintResults } from "markdownlint/helpers"; +import { lint, readConfig } from "markdownlint/promise"; +import { markdownlintParallel } from "./markdownlint-test-parallel.mjs"; + +/** @typedef {import("markdownlint").Configuration} Configuration */ + +/** + * Lints a test repository. + * + * @param {import("ava").ExecutionContext} t Test instance. + * @param {string[]} globPatterns Array of files to in/exclude. + * @param {string} configPath Path to config file. + * @param {Configuration} [configOverrides] Configuration overrides. + * @param {boolean} [parallel] True to lint in parallel. + * @returns {Promise} Test result. + */ +export function lintTestRepo(t, globPatterns, configPath, configOverrides, parallel) { + t.plan(1); + const jsoncParse = (/** @type {string} */ json) => { + const config = jsoncParser.parse(json, [], { "allowTrailingComma": true }); + return config.config || config; + }; + const yamlParse = (/** @type {string} */ yaml) => jsYaml.load(yaml); + return Promise.all([ + globby(globPatterns), + readConfig(configPath, [ jsoncParse, yamlParse ]) + ]).then((globbyAndReadConfigResults) => { + const [ files, rawConfig ] = globbyAndReadConfigResults; + // eslint-disable-next-line no-console + console.log(`${t.title}: Linting ${files.length} files...`); + const cookedConfig = Object.fromEntries( + Object.entries(rawConfig) + .map(([ k, v ]) => [ + k.replace(/header/, "heading"), + v + ]) + ); + const config = { + ...cookedConfig, + ...configOverrides + }; + return (parallel ? markdownlintParallel : lint)({ + files, + config + }).then((results) => { + t.snapshot( + formatLintResults(results).join("\n"), + "Expected linting violations" + ); + }); + }); +} + +/** + * Excludes a list of globs. + * + * @param {string} rootDir Root directory for globs. + * @param {...string} globs Globs to exclude. + * @returns {string[]} Array of excluded globs. + */ +export function excludeGlobs(rootDir, ...globs) { + return globs.map((glob) => "!" + join(rootDir, glob)); +} diff --git a/test/markdownlint-test-result-object.mjs b/test/markdownlint-test-result-object.mjs new file mode 100644 index 00000000..41f4ef81 --- /dev/null +++ b/test/markdownlint-test-result-object.mjs @@ -0,0 +1,673 @@ +// @ts-check + +import test from "ava"; +import { lint as lintAsync } from "markdownlint/async"; +import { lint as lintPromise } from "markdownlint/promise"; +import { lint as lintSync } from "markdownlint/sync"; +import { convertToResultVersion0, convertToResultVersion1, convertToResultVersion2 } from "markdownlint/helpers"; +import { importWithTypeJson } from "./esm-helpers.mjs"; +const packageJson = await importWithTypeJson(import.meta, "../package.json"); +const { homepage, version } = packageJson; + +test("resultObjectToStringNotEnumerable", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "string": "# Heading" + } + }; + lintAsync(options, function callback(err, result) { + t.falsy(err); + // eslint-disable-next-line guard-for-in + for (const property in result) { + t.not(property, "toString", "Function should not enumerate."); + } + resolve(); + }); +})); + +test("resultFormattingV0", (t) => new Promise((resolve) => { + t.plan(4); + const options = { + "files": [ + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" + ], + "config": { + "MD041": true + }, + "noInlineConfig": true, + "resultVersion": 0 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "./test/atx_heading_spacing.md": { + "MD018": [ 1 ], + "MD019": [ 3, 5 ], + "MD041": [ 1 ] + }, + "./test/first_heading_bad_atx.md": { + "MD041": [ 1 ] + } + }; + // @ts-ignore + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore + let actualMessage = actualResult.toString(); + let expectedMessage = + "./test/atx_heading_spacing.md: 1: MD018" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 1: MD041" + + " First line in a file should be a top-level heading\n" + + "./test/first_heading_bad_atx.md: 1: MD041" + + " First line in a file should be a top-level heading"; + t.is(actualMessage, expectedMessage, "Incorrect message (name)."); + // @ts-ignore + actualMessage = actualResult.toString(true); + expectedMessage = + "./test/atx_heading_spacing.md: 1: no-missing-space-atx" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 1: first-line-heading" + + " First line in a file should be a top-level heading\n" + + "./test/first_heading_bad_atx.md: 1: first-line-heading" + + " First line in a file should be a top-level heading"; + t.is(actualMessage, expectedMessage, "Incorrect message (alias)."); + resolve(); + }); +})); + +test("resultFormattingSyncV0", (t) => { + t.plan(3); + const options = { + "files": [ + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" + ], + "config": { + "MD041": true + }, + "noInlineConfig": true, + "resultVersion": 0 + }; + const actualResult = lintSync(options); + const expectedResult = { + "./test/atx_heading_spacing.md": { + "MD018": [ 1 ], + "MD019": [ 3, 5 ], + "MD041": [ 1 ] + }, + "./test/first_heading_bad_atx.md": { + "MD041": [ 1 ] + } + }; + // @ts-ignore + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + let actualMessage = actualResult.toString(); + let expectedMessage = + "./test/atx_heading_spacing.md: 1: MD018" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 1: MD041" + + " First line in a file should be a top-level heading\n" + + "./test/first_heading_bad_atx.md: 1: MD041" + + " First line in a file should be a top-level heading"; + t.is(actualMessage, expectedMessage, "Incorrect message (name)."); + // @ts-ignore + actualMessage = actualResult.toString(true); + expectedMessage = + "./test/atx_heading_spacing.md: 1: no-missing-space-atx" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 1: first-line-heading" + + " First line in a file should be a top-level heading\n" + + "./test/first_heading_bad_atx.md: 1: first-line-heading" + + " First line in a file should be a top-level heading"; + t.is(actualMessage, expectedMessage, "Incorrect message (alias)."); +}); + +test("resultFormattingV1", (t) => new Promise((resolve) => { + t.plan(3); + const options = { + "strings": { + "truncate": + "# Multiple spaces inside hashes on closed atx style heading #\n" + }, + "files": [ + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" + ], + "config": { + "MD041": true + }, + "noInlineConfig": true, + "resultVersion": 1 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "truncate": [ + { "lineNumber": 1, + "ruleName": "MD021", + "ruleAlias": "no-multiple-space-closed-atx", + "ruleDescription": + "Multiple spaces inside hashes on closed atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md021.md`, + "errorDetail": null, + "errorContext": "# Multiple spaces inside hash...", + "errorRange": [ 3, 1 ] } + ], + "./test/atx_heading_spacing.md": [ + { "lineNumber": 1, + "ruleName": "MD018", + "ruleAlias": "no-missing-space-atx", + "ruleDescription": "No space after hash on atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md018.md`, + "errorDetail": null, + "errorContext": "#Heading 1 {MD018}", + "errorRange": [ 1, 2 ] }, + { "lineNumber": 3, + "ruleName": "MD019", + "ruleAlias": "no-multiple-space-atx", + "ruleDescription": "Multiple spaces after hash on atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`, + "errorDetail": null, + "errorContext": "## Heading 2 {MD019}", + "errorRange": [ 4, 1 ] }, + { "lineNumber": 5, + "ruleName": "MD019", + "ruleAlias": "no-multiple-space-atx", + "ruleDescription": "Multiple spaces after hash on atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`, + "errorDetail": null, + "errorContext": "## Heading 3 {MD019}", + "errorRange": [ 4, 2 ] }, + { "lineNumber": 1, + "ruleName": "MD041", + "ruleAlias": "first-line-heading", + "ruleDescription": "First line in a file should be a top-level heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`, + "errorDetail": null, + "errorContext": "#Heading 1 {MD018}", + "errorRange": null } + ], + "./test/first_heading_bad_atx.md": [ + { "lineNumber": 1, + "ruleName": "MD041", + "ruleAlias": "first-line-heading", + "ruleDescription": "First line in a file should be a top-level heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`, + "errorDetail": null, + "errorContext": "## Heading", + "errorRange": null } + ] + }; + // @ts-ignore + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore + const actualMessage = actualResult.toString(); + const expectedMessage = + "./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" + + " No space after hash on atx style heading" + + " [Context: \"#Heading 1 {MD018}\"]\n" + + "./test/atx_heading_spacing.md: 3: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 2 {MD019}\"]\n" + + "./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 3 {MD019}\"]\n" + + "./test/atx_heading_spacing.md: 1: MD041/first-line-heading" + + " First line in a file should be a top-level heading" + + " [Context: \"#Heading 1 {MD018}\"]\n" + + "./test/first_heading_bad_atx.md: 1: MD041/first-line-heading" + + " First line in a file should be a top-level heading" + + " [Context: \"## Heading\"]\n" + + "truncate: 1: MD021/no-multiple-space-closed-atx" + + " Multiple spaces inside hashes on closed atx style heading" + + " [Context: \"# Multiple spaces inside hash...\"]"; + t.is(actualMessage, expectedMessage, "Incorrect message."); + resolve(); + }); +})); + +test("resultFormattingV2", (t) => new Promise((resolve) => { + t.plan(3); + const options = { + "strings": { + "truncate": + "# Multiple spaces inside hashes on closed atx style heading #\n" + }, + "files": [ + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" + ], + "config": { + "MD041": true + }, + "noInlineConfig": true, + "resultVersion": 2 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "truncate": [ + { "lineNumber": 1, + "ruleNames": [ "MD021", "no-multiple-space-closed-atx" ], + "ruleDescription": + "Multiple spaces inside hashes on closed atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md021.md`, + "errorDetail": null, + "errorContext": "# Multiple spaces inside hash...", + "errorRange": [ 3, 1 ] } + ], + "./test/atx_heading_spacing.md": [ + { "lineNumber": 1, + "ruleNames": [ "MD018", "no-missing-space-atx" ], + "ruleDescription": "No space after hash on atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md018.md`, + "errorDetail": null, + "errorContext": "#Heading 1 {MD018}", + "errorRange": [ 1, 2 ] }, + { "lineNumber": 3, + "ruleNames": [ "MD019", "no-multiple-space-atx" ], + "ruleDescription": "Multiple spaces after hash on atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`, + "errorDetail": null, + "errorContext": "## Heading 2 {MD019}", + "errorRange": [ 4, 1 ] }, + { "lineNumber": 5, + "ruleNames": [ "MD019", "no-multiple-space-atx" ], + "ruleDescription": "Multiple spaces after hash on atx style heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`, + "errorDetail": null, + "errorContext": "## Heading 3 {MD019}", + "errorRange": [ 4, 2 ] }, + { "lineNumber": 1, + "ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ], + "ruleDescription": "First line in a file should be a top-level heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`, + "errorDetail": null, + "errorContext": "#Heading 1 {MD018}", + "errorRange": null } + ], + "./test/first_heading_bad_atx.md": [ + { "lineNumber": 1, + "ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ], + "ruleDescription": "First line in a file should be a top-level heading", + "ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`, + "errorDetail": null, + "errorContext": "## Heading", + "errorRange": null } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore + const actualMessage = actualResult.toString(); + const expectedMessage = + "./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" + + " No space after hash on atx style heading" + + " [Context: \"#Heading 1 {MD018}\"]\n" + + "./test/atx_heading_spacing.md: 3: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 2 {MD019}\"]\n" + + "./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 3 {MD019}\"]\n" + + "./test/atx_heading_spacing.md: 1:" + + " MD041/first-line-heading/first-line-h1" + + " First line in a file should be a top-level heading" + + " [Context: \"#Heading 1 {MD018}\"]\n" + + "./test/first_heading_bad_atx.md: 1:" + + " MD041/first-line-heading/first-line-h1" + + " First line in a file should be a top-level heading" + + " [Context: \"## Heading\"]\n" + + "truncate: 1: MD021/no-multiple-space-closed-atx" + + " Multiple spaces inside hashes on closed atx style heading" + + " [Context: \"# Multiple spaces inside hash...\"]"; + t.is(actualMessage, expectedMessage, "Incorrect message."); + resolve(); + }); +})); + +test("resultFormattingV3", (t) => new Promise((resolve) => { + t.plan(3); + const options = { + "strings": { + "input": + "# Heading \n" + + "\n" + + "Text\ttext\t\ttext\n" + + "Text * emphasis * text" + }, + "resultVersion": 3 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "input": [ + { + "lineNumber": 1, + "ruleNames": [ "MD009", "no-trailing-spaces" ], + "ruleDescription": "Trailing spaces", + "ruleInformation": `${homepage}/blob/v${version}/doc/md009.md`, + "errorDetail": "Expected: 0 or 2; Actual: 3", + "errorContext": null, + "errorRange": [ 10, 3 ], + "fixInfo": { + "editColumn": 10, + "deleteCount": 3 + }, + "severity": "error" + }, + { + "lineNumber": 3, + "ruleNames": [ "MD010", "no-hard-tabs" ], + "ruleDescription": "Hard tabs", + "ruleInformation": `${homepage}/blob/v${version}/doc/md010.md`, + "errorDetail": "Column: 5", + "errorContext": null, + "errorRange": [ 5, 1 ], + "fixInfo": { + "editColumn": 5, + "deleteCount": 1, + "insertText": " " + }, + "severity": "error" + }, + { + "lineNumber": 3, + "ruleNames": [ "MD010", "no-hard-tabs" ], + "ruleDescription": "Hard tabs", + "ruleInformation": `${homepage}/blob/v${version}/doc/md010.md`, + "errorDetail": "Column: 10", + "errorContext": null, + "errorRange": [ 10, 2 ], + "fixInfo": { + "editColumn": 10, + "deleteCount": 2, + "insertText": " " + }, + "severity": "error" + }, + { + "lineNumber": 4, + "ruleNames": [ "MD037", "no-space-in-emphasis" ], + "ruleDescription": "Spaces inside emphasis markers", + "ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`, + "errorDetail": null, + "errorContext": "* e", + "errorRange": [ 7, 1 ], + "fixInfo": { + "editColumn": 7, + "deleteCount": 1 + }, + "severity": "error" + }, + { + "lineNumber": 4, + "ruleNames": [ "MD037", "no-space-in-emphasis" ], + "ruleDescription": "Spaces inside emphasis markers", + "ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`, + "errorDetail": null, + "errorContext": "s *", + "errorRange": [ 16, 1 ], + "fixInfo": { + "editColumn": 16, + "deleteCount": 1 + }, + "severity": "error" + }, + { + "lineNumber": 4, + "ruleNames": [ "MD047", "single-trailing-newline" ], + "ruleDescription": "Files should end with a single newline character", + "ruleInformation": `${homepage}/blob/v${version}/doc/md047.md`, + "errorDetail": null, + "errorContext": null, + "errorRange": [ 22, 1 ], + "fixInfo": { + "insertText": "\n", + "editColumn": 23 + }, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore + const actualMessage = actualResult.toString(); + const expectedMessage = + "input: 1: MD009/no-trailing-spaces" + + " Trailing spaces [Expected: 0 or 2; Actual: 3]\n" + + "input: 3: MD010/no-hard-tabs" + + " Hard tabs [Column: 5]\n" + + "input: 3: MD010/no-hard-tabs" + + " Hard tabs [Column: 10]\n" + + "input: 4: MD037/no-space-in-emphasis" + + " Spaces inside emphasis markers [Context: \"* e\"]\n" + + "input: 4: MD037/no-space-in-emphasis" + + " Spaces inside emphasis markers [Context: \"s *\"]\n" + + "input: 4: MD047/single-trailing-newline" + + " Files should end with a single newline character"; + t.is(actualMessage, expectedMessage, "Incorrect message."); + resolve(); + }); +})); + +test("onePerLineResultVersion0", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "input": "# Heading\theading\t\theading\n" + }, + "resultVersion": 0 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "input": { + "MD010": [ 1 ] + } + }; + // @ts-ignore + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("onePerLineResultVersion1", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "input": "# Heading\theading\t\theading\n" + }, + "resultVersion": 1 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "input": [ + { + "lineNumber": 1, + "ruleName": "MD010", + "ruleAlias": "no-hard-tabs", + "ruleDescription": "Hard tabs", + "ruleInformation": + `${homepage}/blob/v${version}/doc/md010.md`, + "errorDetail": "Column: 10", + "errorContext": null, + "errorRange": [ 10, 1 ] + } + ] + }; + // @ts-ignore + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("onePerLineResultVersion2", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "input": "# Heading\theading\t\theading\n" + }, + "resultVersion": 2 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "input": [ + { + "lineNumber": 1, + "ruleNames": [ "MD010", "no-hard-tabs" ], + "ruleDescription": "Hard tabs", + "ruleInformation": + `${homepage}/blob/v${version}/doc/md010.md`, + "errorDetail": "Column: 10", + "errorContext": null, + "errorRange": [ 10, 1 ] + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("manyPerLineResultVersion3", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "input": "# Heading\theading\t\theading\n" + }, + "resultVersion": 3 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "input": [ + { + "lineNumber": 1, + "ruleNames": [ "MD010", "no-hard-tabs" ], + "ruleDescription": "Hard tabs", + "ruleInformation": + `${homepage}/blob/v${version}/doc/md010.md`, + "errorDetail": "Column: 10", + "errorContext": null, + "errorRange": [ 10, 1 ], + "fixInfo": { + "editColumn": 10, + "deleteCount": 1, + "insertText": " " + }, + "severity": "error" + }, + { + "lineNumber": 1, + "ruleNames": [ "MD010", "no-hard-tabs" ], + "ruleDescription": "Hard tabs", + "ruleInformation": + `${homepage}/blob/v${version}/doc/md010.md`, + "errorDetail": "Column: 18", + "errorContext": null, + "errorRange": [ 18, 2 ], + "fixInfo": { + "editColumn": 18, + "deleteCount": 2, + "insertText": " " + }, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("frontMatterResultVersion3", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "input": "---\n---\n# Heading\nText\n" + }, + "resultVersion": 3 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "input": [ + { + "lineNumber": 3, + "ruleNames": + [ "MD022", "blanks-around-headings" ], + "ruleDescription": "Headings should be surrounded by blank lines", + "ruleInformation": + `${homepage}/blob/v${version}/doc/md022.md`, + "errorDetail": "Expected: 1; Actual: 0; Below", + "errorContext": "# Heading", + "errorRange": null, + "fixInfo": { + "lineNumber": 4, + "insertText": "\n" + }, + "severity": "error" + } + ] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("convertToResultVersionN", async(t) => { + t.plan(8); + const options = { + "files": [ + "./test/break-all-the-rules.md", + "./test/inline-disable-enable.md" + ], + "strings": { + "first": "# Heading", + "second": "## Heading" + } + }; + const [ base, version3, version2, version1, version0 ] = await Promise.all([ + lintPromise(options), + // @ts-ignore + lintPromise({ ...options, "resultVersion": 3 }), + // @ts-ignore + lintPromise({ ...options, "resultVersion": 2 }), + // @ts-ignore + lintPromise({ ...options, "resultVersion": 1 }), + // @ts-ignore + lintPromise({ ...options, "resultVersion": 0 }) + ]); + const v3 = version3; + t.deepEqual(v3, base); + t.is(v3.toString(), base.toString()); + const v2 = convertToResultVersion2(base); + t.deepEqual(v2, version2); + t.is(v2.toString(), version2.toString()); + const v1 = convertToResultVersion1(base); + t.deepEqual(v1, version1); + t.is(v1.toString(), version1.toString()); + const v0 = convertToResultVersion0(base); + t.deepEqual(v0, version0); + t.is(v0.toString(), version0.toString()); +}); diff --git a/test/markdownlint-test-scenarios.mjs b/test/markdownlint-test-scenarios.mjs new file mode 100644 index 00000000..5321f33b --- /dev/null +++ b/test/markdownlint-test-scenarios.mjs @@ -0,0 +1,112 @@ +// @ts-check + +import fs from "node:fs/promises"; +import path from "node:path"; +import test from "ava"; +import { lint } from "markdownlint/promise"; +import { applyFixes } from "markdownlint"; +import helpers from "../helpers/helpers.cjs"; +import { fixableRuleNames } from "../lib/constants.mjs"; + +const numericalSortCompareFn = (a, b) => a - b; + +/** + * Create a test function for the specified test file. + * + * @param {string} file Test file relative path. + * @returns {import("ava").Implementation} Test function. + */ +function createTestForFile(file) { + return (t) => ( + // Read and lint Markdown test file + Promise.all([ + fs.readFile(file, "utf8"), + lint({ + "files": [ file ] + }) + ]) + // Compare expected results and snapshot + .then((params) => { + const [ content, results ] = params; + // Canonicalize version number + const errors = results[file] + .filter((error) => !!error.ruleInformation); + for (const error of errors) { + error.ruleInformation = + error.ruleInformation.replace(/v\d+\.\d+\.\d+/, "v0.0.0"); + } + // Match identified issues by MD### markers + const marker = /\{(MD\d+)(?::([-+]?)(\d+))?\}/g; + const lines = content.split(helpers.newLineRe); + const expected = {}; + // @ts-ignore + for (const [ index, line ] of lines.entries()) { + let match = null; + while ((match = marker.exec(line))) { + const [ , rule, delta, value ] = match; + let lineNumber = index + 1; + if (value) { + const valueInt = Number.parseInt(value, 10); + if (delta) { + lineNumber += ((delta === "+") ? 1 : -1) * valueInt; + } else { + lineNumber = valueInt; + } + } + // eslint-disable-next-line no-multi-assign + const indices = expected[rule] = expected[rule] || []; + if (!indices.includes(lineNumber)) { + indices.push(lineNumber); + } + } + } + for (const list of Object.values(expected)) { + list.sort(numericalSortCompareFn); + } + const actual = {}; + for (const error of errors) { + const rule = error.ruleNames[0]; + // eslint-disable-next-line no-multi-assign + const indices = actual[rule] = actual[rule] || []; + if (indices[indices.length - 1] !== error.lineNumber) { + indices.push(error.lineNumber); + } + t.true( + !error.fixInfo || fixableRuleNames.includes(rule), + `Fixable rule ${rule} is not tagged as such.` + ); + } + for (const list of Object.values(actual)) { + list.sort(numericalSortCompareFn); + } + t.deepEqual(actual, expected, "Too few or too many issues found."); + // Create snapshot + const fixed = applyFixes(content, errors) + .replace(/\r\n/g, "\n"); + t.snapshot({ + errors, + fixed + }); + // Identify missing fixes + return lint({ + "strings": { + "input": fixed + } + }).then((fixedResults) => { + const unfixed = fixedResults.input.filter((error) => !!error.fixInfo); + t.deepEqual(unfixed, [], "Fixable error(s) not fixed."); + }); + }) + .catch() + ); +} + +const dir = await fs.readdir("./test"); +const files = dir.filter((file) => /\.md$/.test(file)); +for (const file of files) { + // @ts-ignore + test( + file, + createTestForFile(path.join("./test", file)) + ); +} diff --git a/test/markdownlint-test-worker.mjs b/test/markdownlint-test-worker.mjs new file mode 100644 index 00000000..7678aa35 --- /dev/null +++ b/test/markdownlint-test-worker.mjs @@ -0,0 +1,12 @@ +// @ts-check + +import { parentPort, workerData } from "node:worker_threads"; +import { lint } from "markdownlint/promise"; + +const lintResults = await lint(workerData); +// @ts-ignore +parentPort + // eslint-disable-next-line unicorn/require-post-message-target-origin + .postMessage(lintResults); +// eslint-disable-next-line n/no-process-exit +process.exit(); diff --git a/test/markdownlint-test.js b/test/markdownlint-test.js deleted file mode 100644 index c21d33a3..00000000 --- a/test/markdownlint-test.js +++ /dev/null @@ -1,780 +0,0 @@ -"use strict"; - -var fs = require("fs"); -var path = require("path"); -var md = require("markdown-it")(); -var assign = require("lodash.assign"); -var clone = require("lodash.clone"); -var Q = require("q"); -var markdownlint = require("../lib/markdownlint"); -var shared = require("../lib/shared"); -var rules = require("../lib/rules"); -var polyfills = require("../demo/browser-polyfills"); -var defaultConfig = require("./markdownlint-test-default-config.json"); - -function createTestForFile(file) { - return function testForFile(test) { - test.expect(1); - var configFile = file.replace(/\.md$/, ".json"); - var actualPromise = Q.nfcall(fs.stat, configFile) - .then( - function configFileExists() { - return Q.nfcall(fs.readFile, configFile, shared.utf8Encoding) - .then( - function configFileContents(contents) { - return JSON.parse(contents); - }); - }, - function noConfigFile() { - return null; - }) - .then( - function lintWithConfig(config) { - var mergedConfig = assign(clone(defaultConfig), config); - return Q.nfcall(markdownlint, { - "files": [ file ], - "config": mergedConfig - }); - }); - var expectedPromise = Q.nfcall(fs.readFile, file, shared.utf8Encoding) - .then( - function fileContents(contents) { - var lines = contents.split(shared.newLineRe); - var results = {}; - lines.forEach(function forLine(line, lineNum) { - var regex = /\{(MD\d+)(?::(\d+))?\}/g; - var match; - while ((match = regex.exec(line))) { - var rule = match[1]; - var errors = results[rule] || []; - errors.push(match[2] ? parseInt(match[2], 10) : lineNum + 1); - results[rule] = errors; - } - }); - var sortedResults = {}; - Object.keys(results).sort().forEach(function forKey(key) { - sortedResults[key] = results[key]; - }); - return sortedResults; - }); - Q.all([ actualPromise, expectedPromise ]) - .then( - function compareResults(fulfillments) { - var actual = fulfillments[0]; - var results = fulfillments[1]; - var expected = {}; - expected[file] = results; - test.deepEqual(actual, expected, "Line numbers are not correct."); - }) - .done(test.done, test.done); - }; -} - -fs.readdirSync("./test").forEach(function forFile(file) { - if (file.match(/\.md$/)) { - module.exports[file] = createTestForFile(path.join("./test", file)); - } -}); - -module.exports.projectFiles = function projectFiles(test) { - test.expect(2); - var options = { - "files": [ "README.md" ] - }; - markdownlint(options, function callback(err, actual) { - test.ifError(err); - var expected = { "README.md": {} }; - test.deepEqual(actual, expected, "Issue(s) with project files."); - test.done(); - }); -}; - -module.exports.resultFormatting = function resultFormatting(test) { - test.expect(3); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": defaultConfig - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD002": [ 3 ], - "MD018": [ 1 ], - "MD019": [ 3, 5 ] - }, - "./test/first_header_bad_atx.md": { - "MD002": [ 1 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - var actualMessage = actualResult.toString(); - var expectedMessage = - "./test/atx_header_spacing.md: 3: MD002" + - " First header should be a h1 header\n" + - "./test/atx_header_spacing.md: 1: MD018" + - " No space after hash on atx style header\n" + - "./test/atx_header_spacing.md: 3: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/atx_header_spacing.md: 5: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/first_header_bad_atx.md: 1: MD002" + - " First header should be a h1 header"; - test.equal(actualMessage, expectedMessage, "Incorrect message."); - test.done(); - }); -}; - -module.exports.resultFormattingSync = function resultFormattingSync(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": defaultConfig - }; - var actualResult = markdownlint.sync(options); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD002": [ 3 ], - "MD018": [ 1 ], - "MD019": [ 3, 5 ] - }, - "./test/first_header_bad_atx.md": { - "MD002": [ 1 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - var actualMessage = actualResult.toString(); - var expectedMessage = - "./test/atx_header_spacing.md: 3: MD002" + - " First header should be a h1 header\n" + - "./test/atx_header_spacing.md: 1: MD018" + - " No space after hash on atx style header\n" + - "./test/atx_header_spacing.md: 3: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/atx_header_spacing.md: 5: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/first_header_bad_atx.md: 1: MD002" + - " First header should be a h1 header"; - test.equal(actualMessage, expectedMessage, "Incorrect message."); - test.done(); -}; - -module.exports.stringInputLineEndings = function stringInputLineEndings(test) { - test.expect(2); - var options = { - "strings": { - "cr": "One\rTwo\r#Three", - "lf": "One\nTwo\n#Three", - "crlf": "One\r\nTwo\r\n#Three", - "mixed": "One\rTwo\n#Three" - }, - "config": defaultConfig - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "cr": { "MD018": [ 3 ] }, - "lf": { "MD018": [ 3 ] }, - "crlf": { "MD018": [ 3 ] }, - "mixed": { "MD018": [ 3 ] } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.inputOnlyNewline = function inputOnlyNewline(test) { - test.expect(2); - var options = { - "strings": { - "cr": "\r", - "lf": "\n", - "crlf": "\r\n" - }, - "config": { - "default": false - } - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "cr": {}, - "lf": {}, - "crlf": {} - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.defaultTrue = function defaultTrue(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": { - "default": true - } - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD002": [ 3 ], - "MD018": [ 1 ], - "MD019": [ 3, 5 ], - "MD041": [ 1 ] - }, - "./test/first_header_bad_atx.md": { - "MD002": [ 1 ], - "MD041": [ 1 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.defaultFalse = function defaultFalse(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": { - "default": false - } - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": {}, - "./test/first_header_bad_atx.md": {} - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.defaultUndefined = function defaultUndefined(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": {} - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD002": [ 3 ], - "MD018": [ 1 ], - "MD019": [ 3, 5 ], - "MD041": [ 1 ] - }, - "./test/first_header_bad_atx.md": { - "MD002": [ 1 ], - "MD041": [ 1 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.disableRules = function disableRules(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": { - "MD002": false, - "default": true, - "MD019": false, - "MD041": false - } - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD018": [ 1 ] - }, - "./test/first_header_bad_atx.md": {} - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.enableRules = function enableRules(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": { - "MD002": true, - "default": false, - "MD019": true - } - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD002": [ 3 ], - "MD019": [ 3, 5 ] - }, - "./test/first_header_bad_atx.md": { - "MD002": [ 1 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.disableTag = function disableTag(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": { - "default": true, - "spaces": false - } - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD002": [ 3 ], - "MD041": [ 1 ] - }, - "./test/first_header_bad_atx.md": { - "MD002": [ 1 ], - "MD041": [ 1 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.enableTag = function enableTag(test) { - test.expect(2); - var options = { - "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ], - "config": { - "default": false, - "spaces": true - } - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/atx_header_spacing.md": { - "MD018": [ 1 ], - "MD019": [ 3, 5 ] - }, - "./test/first_header_bad_atx.md": {} - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.styleFiles = function styleFiles(test) { - test.expect(4); - fs.readdir("./style", function readdir(err, files) { - test.ifError(err); - files.forEach(function forFile(file) { - test.ok(require(path.join("../style", file)), "Unable to load/parse."); - }); - test.done(); - }); -}; - -module.exports.styleAll = function styleAll(test) { - test.expect(2); - var options = { - "files": [ "./test/break-all-the-rules.md" ], - "config": require("../style/all.json") - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/break-all-the-rules.md": { - "MD001": [ 3 ], - "MD002": [ 1 ], - "MD003": [ 5, 30 ], - "MD004": [ 8 ], - "MD005": [ 12 ], - "MD006": [ 8 ], - "MD007": [ 8, 11 ], - "MD009": [ 14 ], - "MD010": [ 14 ], - "MD011": [ 16 ], - "MD012": [ 18 ], - "MD013": [ 21 ], - "MD014": [ 23 ], - "MD018": [ 25 ], - "MD019": [ 27 ], - "MD020": [ 29 ], - "MD021": [ 30 ], - "MD022": [ 30 ], - "MD023": [ 30 ], - "MD024": [ 34 ], - "MD026": [ 40 ], - "MD027": [ 42 ], - "MD028": [ 43 ], - "MD029": [ 47 ], - "MD030": [ 8 ], - "MD031": [ 50 ], - "MD032": [ 51 ], - "MD033": [ 55 ], - "MD034": [ 57 ], - "MD035": [ 61 ], - "MD036": [ 65 ], - "MD037": [ 67 ], - "MD038": [ 69 ], - "MD039": [ 71 ], - "MD040": [ 73 ], - "MD041": [ 1 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.styleRelaxed = function styleRelaxed(test) { - test.expect(2); - var options = { - "files": [ "./test/break-all-the-rules.md" ], - "config": require("../style/relaxed.json") - }; - markdownlint(options, function callback(err, actualResult) { - test.ifError(err); - var expectedResult = { - "./test/break-all-the-rules.md": { - "MD001": [ 3 ], - "MD002": [ 1 ], - "MD003": [ 5, 30 ], - "MD004": [ 8 ], - "MD005": [ 12 ], - "MD011": [ 16 ], - "MD014": [ 23 ], - "MD018": [ 25 ], - "MD019": [ 27 ], - "MD020": [ 29 ], - "MD021": [ 30 ], - "MD022": [ 30 ], - "MD023": [ 30 ], - "MD024": [ 34 ], - "MD026": [ 40 ], - "MD029": [ 47 ], - "MD031": [ 50 ], - "MD032": [ 51 ], - "MD035": [ 61 ], - "MD036": [ 65 ] - } - }; - test.deepEqual(actualResult, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.nullFrontMatter = function nullFrontMatter(test) { - test.expect(2); - markdownlint({ - "strings": { - "content": "---\n\t\n---\n# Header\n" - }, - "frontMatter": null, - "config": { - "default": false, - "MD010": true - } - }, function callback(err, result) { - test.ifError(err); - var expectedResult = { - "content": { "MD010": [ 2 ] } - }; - test.deepEqual(result, expectedResult, "Undetected issues."); - test.done(); - }); -}; - -module.exports.customFrontMatter = function customFrontMatter(test) { - test.expect(2); - markdownlint({ - "strings": { - "content": "\n\t\n\n# Header\n" - }, - "frontMatter": /[^]*<\/head>/, - "config": { - "default": false, - "MD010": true - } - }, function callback(err, result) { - test.ifError(err); - var expectedResult = { - "content": {} - }; - test.deepEqual(result, expectedResult, "Did not get empty results."); - test.done(); - }); -}; - -module.exports.filesArrayNotModified = function filesArrayNotModified(test) { - test.expect(2); - var files = [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" - ]; - var expectedFiles = files.slice(); - markdownlint({ "files": files }, function callback(err) { - test.ifError(err); - test.deepEqual(files, expectedFiles, "Files modified."); - test.done(); - }); -}; - -module.exports.missingOptions = function missingOptions(test) { - test.expect(2); - markdownlint(null, function callback(err, result) { - test.ifError(err); - test.deepEqual(result, {}, "Did not get empty result for missing options."); - test.done(); - }); -}; - -module.exports.missingFilesAndStrings = function missingFilesAndStrings(test) { - test.expect(2); - markdownlint({}, function callback(err, result) { - test.ifError(err); - test.ok(result, "Did not get result for missing files/strings."); - test.done(); - }); -}; - -module.exports.missingCallback = function missingCallback(test) { - test.expect(0); - markdownlint(); - test.done(); -}; - -module.exports.badFile = function badFile(test) { - test.expect(4); - markdownlint({ - "files": [ "./badFile" ] - }, function callback(err, result) { - test.ok(err, "Did not get an error for bad file."); - test.ok(err instanceof Error, "Error not instance of Error."); - test.equal(err.code, "ENOENT", "Error code for bad file not ENOENT."); - test.ok(!result, "Got result for bad file."); - test.done(); - }); -}; - -module.exports.badFileSync = function badFileSync(test) { - test.expect(4); - test.throws(function badFileCall() { - markdownlint.sync({ - "files": [ "./badFile" ] - }); - }, function testError(err) { - test.ok(err, "Did not get an error for bad file."); - test.ok(err instanceof Error, "Error not instance of Error."); - test.equal(err.code, "ENOENT", "Error code for bad file not ENOENT."); - return true; - }, "Did not get exception for bad file."); - test.done(); -}; - -module.exports.missingStringValue = function missingStringValue(test) { - test.expect(2); - markdownlint({ - "strings": { - "undefined": undefined, - "null": null, - "empty": "" - }, - "config": defaultConfig - }, function callback(err, result) { - test.ifError(err); - var expectedResult = { - "undefined": {}, - "null": {}, - "empty": {} - }; - test.deepEqual(result, expectedResult, "Did not get empty results."); - test.done(); - }); -}; - -module.exports.readme = function readme(test) { - test.expect(97); - var tagToRules = {}; - rules.forEach(function forRule(rule) { - rule.tags.forEach(function forTag(tag) { - var tagRules = tagToRules[tag] || []; - tagRules.push(rule.name); - tagToRules[tag] = tagRules; - }); - }); - fs.readFile("README.md", shared.utf8Encoding, - function readFile(err, contents) { - test.ifError(err); - var rulesLeft = rules.slice(); - var seenRules = false; - var inRules = false; - var seenTags = false; - var inTags = false; - md.parse(contents, {}).forEach(function forToken(token) { - if (token.type === "bullet_list_open") { - if (!seenRules) { - seenRules = true; - inRules = true; - } else if (!seenTags) { - seenTags = true; - inTags = true; - } - } else if (token.type === "bullet_list_close") { - inRules = false; - inTags = false; - } else if (token.type === "inline") { - if (inRules) { - var rule = rulesLeft.shift(); - test.ok(rule, - "Missing rule implementation for " + token.content + "."); - if (rule) { - var expected = "**" + rule.name + "** - " + rule.desc; - test.equal(token.content, expected, "Rule mismatch."); - } - } else if (inTags) { - var parts = token.content.replace(/\*\*/g, "").split(/ - |, |,\n/); - var tag = parts.shift(); - test.deepEqual(parts, tagToRules[tag] || [], - "Rule mismatch for tag " + tag + "."); - delete tagToRules[tag]; - } - } - }); - var ruleLeft = rulesLeft.shift(); - test.ok(!ruleLeft, - "Missing rule documentation for " + (ruleLeft || {}).name + "."); - var tagLeft = Object.keys(tagToRules).shift(); - test.ok(!tagLeft, "Undocumented tag " + tagLeft + "."); - test.done(); - }); -}; - -module.exports.doc = function doc(test) { - test.expect(151); - fs.readFile("doc/Rules.md", shared.utf8Encoding, - function readFile(err, contents) { - test.ifError(err); - var rulesLeft = rules.slice(); - var inHeading = false; - var rule = null; - md.parse(contents, {}).forEach(function forToken(token) { - if ((token.type === "heading_open") && (token.tag === "h2")) { - inHeading = true; - } else if (token.type === "heading_close") { - inHeading = false; - } else if (token.type === "inline") { - if (inHeading) { - test.ok(!rule, - "Missing tags for rule " + (rule || {}).name + "."); - rule = rulesLeft.shift(); - test.ok(rule, - "Missing rule implementation for " + token.content + "."); - if (rule) { - var expected = rule.name + " - " + rule.desc; - test.equal(token.content, expected, "Rule mismatch."); - } - } else if (/^Tags: /.test(token.content) && rule) { - var tags = token.content.split(/, |: | /).slice(1); - test.deepEqual(tags, rule.tags, - "Tag mismatch for rule " + rule.name + "."); - rule = null; - } - } - }); - var ruleLeft = rulesLeft.shift(); - test.ok(!ruleLeft, - "Missing rule documentation for " + (ruleLeft || {}).name + "."); - test.ok(!rule, "Missing tags for rule " + (rule || {}).name + "."); - test.done(); - }); -}; - -module.exports.typeAllFiles = function typeAllFiles(test) { - // Simulates typing each test file to validate handling of partial input - var files = fs.readdirSync("./test"); - files.forEach(function forFile(file) { - if (/\.md$/.test(file)) { - var content = fs.readFileSync( - path.join("./test", file), shared.utf8Encoding); - while (content) { - markdownlint.sync({ - "strings": { - "content": content - } - }); - content = content.slice(0, -1); - } - } - }); - test.done(); -}; - -module.exports.trimPolyfills = function trimPolyfills(test) { - var inputs = [ - "text text", - " text text ", - " text text ", - // ECMAScript Whitespace - "\u0009 text text \u0009", - "\u000b text text \u000b", - "\u000c text text \u000c", - "\u0020 text text \u0020", - "\u00a0 text text \u00a0", - "\ufeff text text \ufeff", - // ECMAScript LineTerminator - "\u000a text text \u000a", - "\u000d text text \u000d", - "\u2028 text text \u2028", - "\u2029 text text \u2029" - ]; - test.expect(inputs.length * 2); - inputs.forEach(function forInput(input) { - test.equal(polyfills.trimLeftPolyfill.call(input), input.trimLeft(), - "trimLeft incorrect for '" + input + "'"); - test.equal(polyfills.trimRightPolyfill.call(input), input.trimRight(), - "trimRight incorrect for '" + input + "'"); - }); - test.done(); -}; diff --git a/test/markdownlint-test.mjs b/test/markdownlint-test.mjs new file mode 100644 index 00000000..1696c0f4 --- /dev/null +++ b/test/markdownlint-test.mjs @@ -0,0 +1,1622 @@ +// @ts-check + +import fs from "node:fs"; +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +import path from "node:path"; +import Ajv from "ajv"; +import { globby } from "globby"; +import jsoncParser from "jsonc-parser"; +import jsYaml from "js-yaml"; +import markdownIt from "markdown-it"; +import pluginInline from "markdown-it-for-inline"; +import pluginSub from "markdown-it-sub"; +import pluginSup from "markdown-it-sup"; +import test from "ava"; +import { getVersion } from "markdownlint"; +import { lint as lintAsync } from "markdownlint/async"; +import { lint as lintPromise } from "markdownlint/promise"; +import { lint as lintSync } from "markdownlint/sync"; +import * as cache from "../lib/cache.mjs"; +import * as constants from "../lib/constants.mjs"; +import rules from "../lib/rules.mjs"; +import customRules from "./rules/rules.cjs"; +import { __dirname, importWithTypeJson } from "./esm-helpers.mjs"; +/** @type {{exports: Object., homepage: string, version: string}} */ +const packageJson = await importWithTypeJson(import.meta, "../package.json"); +/** @type {{$id: string, properties: Object}} */ +const configSchema = await importWithTypeJson(import.meta, "../schema/markdownlint-config-schema.json"); +const configSchemaStrict = await importWithTypeJson(import.meta, "../schema/markdownlint-config-schema-strict.json"); + +const deprecatedRuleNames = new Set(constants.deprecatedRuleNames); +const ajvOptions = { + "allowUnionTypes": true +}; + +/** @typedef {import("ava").ImplementationFn<[]>} ImplementationFn */ +/** @typedef {import("markdownlint").Configuration} Configuration */ +/** @typedef {import("markdownlint").LintResults} LintResults */ + +/** + * Gets an instance of a markdown-it factory, suitable for use with options.markdownItFactory. + * + * @param {import("../lib/markdownlint.mjs").Plugin[]} markdownItPlugins Additional markdown-it plugins. + * @returns {import("../lib/markdownlint.mjs").MarkdownItFactory} Function to create a markdown-it parser. + */ +function getMarkdownItFactory(markdownItPlugins) { + return () => { + const md = markdownIt({ "html": true }); + for (const markdownItPlugin of markdownItPlugins) { + // @ts-ignore + md.use(...markdownItPlugin); + } + return md; + }; +} + +test("simpleAsync", (t) => new Promise((resolve) => { + t.plan(3); + const options = { + "strings": { + "content": "# Heading" + } + }; + lintAsync(options, (err, actual) => { + t.falsy(err); + t.is(actual?.content.length, 1); + t.is(actual?.content[0].ruleNames[0], "MD047"); + resolve(); + }); +})); + +test("simpleSync", (t) => { + t.plan(2); + const options = { + "strings": { + "content": "# Heading" + } + }; + const actual = lintSync(options); + t.is(actual.content.length, 1); + t.is(actual.content[0].ruleNames[0], "MD047"); +}); + +test("simplePromise", (t) => { + t.plan(2); + const options = { + "strings": { + "content": "# Heading" + } + }; + return lintPromise(options).then((actual) => { + t.is(actual.content.length, 1); + t.is(actual.content[0].ruleNames[0], "MD047"); + }); +}); + +test("stringInputLineEndings", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "cr": "One\rTwo\r#Three\n", + "lf": "One\nTwo\n#Three\n", + "crlf": "One\r\nTwo\r\n#Three\n", + "mixed": "One\rTwo\n#Three\n" + }, + "config": { + "MD041": false + }, + "resultVersion": 0 + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "cr": { "MD018": [ 3 ] }, + "lf": { "MD018": [ 3 ] }, + "crlf": { "MD018": [ 3 ] }, + "mixed": { "MD018": [ 3 ] } + }; + // @ts-ignore + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("inputOnlyNewline", (t) => new Promise((resolve) => { + t.plan(2); + const options = { + "strings": { + "cr": "\r", + "lf": "\n", + "crlf": "\r\n" + }, + "config": { + "default": false + } + }; + lintAsync(options, function callback(err, actualResult) { + t.falsy(err); + const expectedResult = { + "cr": [], + "lf": [], + "crlf": [] + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +/** @typedef {Object} NormalizedLintResults */ + +/** + * Normalizes LintResults. + * + * @param {LintResults} results LintResults. + * @returns {NormalizedLintResults} Normalized LintResults. + */ +function normalizeLintResults(results) { + return Object.fromEntries( + Object.entries(results).map( + ([ source, errors ]) => [ + source, + errors.map( + ({ lineNumber, ruleNames, severity }) => `${ruleNames[0]} ${lineNumber} ${severity}` + ) + ] + ) + ); +} + +/** + * Gets a Configuration value test implementation. + * + * @param {Configuration} config Configuration object. + * @param {NormalizedLintResults} expected Expected result. + * @returns {ImplementationFn} Test implementation. + */ +function getConfigTestImplementation(config, expected) { + return async(t) => { + t.plan(1); + const options = { + config, + "files": [ + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" + ], + "noInlineConfig": true + }; + const actual = await lintPromise(options); + t.deepEqual(normalizeLintResults(actual), expected); + }; +} + +/** + * Converts a config test scenario from errors to warnings. + * + * @param {Object.} configTest Config test scenario. + * @returns {Object.} Converted scenario. + */ +function configTestAsWarnings(configTest) { + return JSON.parse(JSON.stringify(configTest).replaceAll("error", "warning")); +} + +const configTestExpected = { + "./test/atx_heading_spacing.md": [], + "./test/first_heading_bad_atx.md": [] +}; +const configTestExpected1 = { + "./test/atx_heading_spacing.md": [ + "MD018 1 error" + ], + "./test/first_heading_bad_atx.md": [] +}; +const configTestExpected11 = { + "./test/atx_heading_spacing.md": [ + "MD041 1 error" + ], + "./test/first_heading_bad_atx.md": [ + "MD041 1 error" + ] +}; +const configTestExpected135 = { + "./test/atx_heading_spacing.md": [ + "MD018 1 error", + "MD019 3 error", + "MD019 5 error" + ], + "./test/first_heading_bad_atx.md": [] +}; +const configTestExpected3511 = { + "./test/atx_heading_spacing.md": [ + "MD019 3 error", + "MD019 5 error", + "MD041 1 error" + ], + "./test/first_heading_bad_atx.md": [ + "MD041 1 error" + ] +}; +const configTestExpected13511 = { + "./test/atx_heading_spacing.md": [ + "MD018 1 error", + "MD019 3 error", + "MD019 5 error", + "MD041 1 error" + ], + "./test/first_heading_bad_atx.md": [ + "MD041 1 error" + ] +}; + +test("defaultUnset", getConfigTestImplementation( + {}, + configTestExpected13511 +)); + +test("defaultTrue", getConfigTestImplementation( + { "default": true }, + configTestExpected13511 +)); + +test("defaultFalse", getConfigTestImplementation( + { "default": false }, + configTestExpected +)); + +test("defaultTruthy", getConfigTestImplementation( + // @ts-ignore + { "default": 1 }, + configTestExpected13511 +)); + +test("defaultFalsy", getConfigTestImplementation( + // @ts-ignore + { "default": 0 }, + configTestExpected +)); + +test("defaultError", getConfigTestImplementation( + { "default": "error" }, + configTestExpected13511 +)); + +test("defaultWarning", getConfigTestImplementation( + // @ts-ignore + { "default": "warning" }, + configTestAsWarnings(configTestExpected13511) +)); + +test("defaultMultipleTrue", getConfigTestImplementation( + { + "default": true, + "DEFAULT": false + }, + configTestExpected13511 +)); + +test("defaultMultipleFalse", getConfigTestImplementation( + { + "DEFAULT": false, + "default": true + }, + configTestExpected +)); + +test("disableRules", getConfigTestImplementation( + { + "default": true, + "MD019": false, + "first-line-h1": false, + "extra": false + }, + configTestExpected1 +)); + +test("disableRulesFalsy", getConfigTestImplementation( + { + "default": true, + // @ts-ignore + "MD019": 0, + // @ts-ignore + "first-line-h1": 0, + "extra": 0 + }, + configTestExpected1 +)); + +test("enableRules", getConfigTestImplementation( + { + "MD041": true, + "default": false, + "no-multiple-space-atx": true, + "extra": true + }, + configTestExpected3511 +)); + +test("enableRulesMixedCase", getConfigTestImplementation( + { + "Md041": true, + "DeFaUlT": false, + "nO-mUlTiPlE-sPaCe-AtX": true, + "ExTrA": true + }, + configTestExpected3511 +)); + +test("enableRulesTruthy", getConfigTestImplementation( + { + // @ts-ignore + "MD041": 1, + "default": false, + // @ts-ignore + "no-multiple-space-atx": 1, + "extra": 1 + }, + configTestExpected3511 +)); + +test("enableRulesError", getConfigTestImplementation( + { + "MD041": "error", + "default": false, + "no-multiple-space-atx": "error", + "extra": "error" + }, + configTestExpected3511 +)); + +test("enableRulesWarning", getConfigTestImplementation( + { + "MD041": "warning", + "default": false, + "no-multiple-space-atx": "warning", + "extra": "warning" + }, + configTestAsWarnings(configTestExpected3511) +)); + +test("enableRulesObjectEmpty", getConfigTestImplementation( + { + "MD041": {}, + "default": false, + "no-multiple-space-atx": {}, + "extra": {} + }, + configTestExpected3511 +)); + +test("enableRulesObjectSeverityTruthy", getConfigTestImplementation( + { + "MD041": { + // @ts-ignore + "severity": 1 + }, + "default": false, + "no-multiple-space-atx": { + // @ts-ignore + "severity": 1 + }, + "extra": { + "severity": 1 + } + }, + configTestExpected3511 +)); + +test("enableRulesObjectSeverityFalsy", getConfigTestImplementation( + { + "MD041": { + // @ts-ignore + "severity": 0 + }, + "default": false, + "no-multiple-space-atx": { + // @ts-ignore + "severity": 0 + }, + "extra": { + "severity": 0 + } + }, + configTestExpected3511 +)); + +test("enableRulesObjectSeverityError", getConfigTestImplementation( + { + "MD041": { + "severity": "error" + }, + "default": false, + "no-multiple-space-atx": { + "severity": "error" + }, + "extra": { + "severity": "error" + } + }, + configTestExpected3511 +)); + +test("enableRulesObjectSeverityWarning", getConfigTestImplementation( + { + "MD041": { + "severity": "warning" + }, + "default": false, + "no-multiple-space-atx": { + "severity": "warning" + }, + "extra": { + "severity": "warning" + } + }, + configTestAsWarnings(configTestExpected3511) +)); + +test("enableRulesObjectEnabledTrue", getConfigTestImplementation( + { + "MD041": { + "enabled": true + }, + "default": false, + "no-multiple-space-atx": { + "enabled": true + }, + "extra": { + "enabled": true + } + }, + configTestExpected3511 +)); + +test("enableRulesObjectEnabledFalse", getConfigTestImplementation( + { + "MD041": { + "enabled": false + }, + "default": true, + "no-multiple-space-atx": { + "enabled": false + }, + "extra": { + "enabled": false + } + }, + configTestExpected1 +)); + +test("enableRulesObjectEnabledTruthy", getConfigTestImplementation( + { + "MD041": { + // @ts-ignore + "enabled": 1 + }, + "default": false, + "no-multiple-space-atx": { + // @ts-ignore + "enabled": 1 + }, + "extra": { + "enabled": 1 + } + }, + configTestExpected3511 +)); + +test("enableRulesObjectEnabledFalsy", getConfigTestImplementation( + { + "MD041": { + // @ts-ignore + "enabled": 0 + }, + "default": true, + "no-multiple-space-atx": { + // @ts-ignore + "enabled": 0 + }, + "extra": { + "enabled": 0 + } + }, + configTestExpected1 +)); + +test("disableTag", getConfigTestImplementation( + { + "default": true, + "spaces": false, + "extra": false + }, + configTestExpected11 +)); + +test("disableTagFalsy", getConfigTestImplementation( + { + "default": true, + // @ts-ignore + "spaces": 0, + "extra": 0 + }, + configTestExpected11 +)); + +test("enableTag", getConfigTestImplementation( + { + "default": false, + "spaces": true, + "extra": true + }, + configTestExpected135 +)); + +test("enableTagMixedCase", getConfigTestImplementation( + { + "DeFaUlT": false, + "SpAcEs": true, + "ExTrA": true + }, + configTestExpected135 +)); + +test("enableTagTruthy", getConfigTestImplementation( + { + "default": false, + // @ts-ignore + "spaces": 1, + "extra": 1 + }, + configTestExpected135 +)); + +test("enableTagError", getConfigTestImplementation( + { + "default": false, + "spaces": "error", + "extra": "error" + }, + configTestExpected135 +)); + +test("enableTagWarning", getConfigTestImplementation( + { + "default": false, + "spaces": "warning", + "extra": "warning" + }, + configTestAsWarnings(configTestExpected135) +)); + +test("styleFiles", async(t) => { + t.plan(8); + const files = await fs.promises.readdir("./style"); + for (const file of files) { + t.truthy(require(path.join("../style", file)), "Unable to load/parse."); + const exportValue = `./style/${file}`; + const exportKey = exportValue.replace(/\.json$/, ""); + t.is(packageJson.exports[exportKey], exportValue); + } +}); + +test("styleAll", async(t) => { + t.plan(1); + const options = { + "files": [ "./test/break-all-the-rules.md" ], + "config": require("../style/all.json"), + "noInlineConfig": true, + "resultVersion": 0 + }; + const actualResult = await lintPromise(options); + const expectedResult = { + "./test/break-all-the-rules.md": { + "MD001": [ 3 ], + "MD003": [ 5, 31 ], + "MD004": [ 8 ], + "MD005": [ 12 ], + "MD007": [ 8, 11 ], + "MD009": [ 14 ], + "MD010": [ 14 ], + "MD011": [ 16 ], + "MD012": [ 18 ], + "MD013": [ 21 ], + "MD014": [ 23 ], + "MD018": [ 25 ], + "MD019": [ 27 ], + "MD020": [ 29 ], + "MD021": [ 31 ], + "MD022": [ 86 ], + "MD023": [ 40 ], + "MD024": [ 35 ], + "MD026": [ 40 ], + "MD027": [ 42 ], + "MD028": [ 43 ], + "MD029": [ 47 ], + "MD030": [ 8 ], + "MD031": [ 50 ], + "MD032": [ 7, 8, 51 ], + "MD033": [ 55 ], + "MD034": [ 57 ], + "MD035": [ 61 ], + "MD036": [ 65 ], + "MD037": [ 67 ], + "MD038": [ 69 ], + "MD039": [ 71 ], + "MD040": [ 73 ], + "MD041": [ 1 ], + "MD042": [ 81 ], + "MD045": [ 85 ], + "MD046": [ 49, 73, 77 ], + "MD047": [ 144 ], + "MD048": [ 77 ], + "MD049": [ 90 ], + "MD050": [ 94 ], + "MD051": [ 96 ], + "MD052": [ 98 ], + "MD053": [ 100 ], + "MD055": [ 110 ], + "MD056": [ 116 ], + "MD058": [ 119, 121 ], + "MD059": [ 124 ], + "MD060": [ 110 ] + } + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); +}); + +test("styleRelaxed", async(t) => { + t.plan(1); + const options = { + "files": [ "./test/break-all-the-rules.md" ], + "config": require("../style/relaxed.json"), + "noInlineConfig": true, + "resultVersion": 0 + }; + const actualResult = await lintPromise(options); + const expectedResult = { + "./test/break-all-the-rules.md": { + "MD001": [ 3 ], + "MD003": [ 5, 31 ], + "MD004": [ 8 ], + "MD005": [ 12 ], + "MD011": [ 16 ], + "MD014": [ 23 ], + "MD018": [ 25 ], + "MD019": [ 27 ], + "MD020": [ 29 ], + "MD021": [ 31 ], + "MD022": [ 86 ], + "MD023": [ 40 ], + "MD024": [ 35 ], + "MD026": [ 40 ], + "MD029": [ 47 ], + "MD031": [ 50 ], + "MD032": [ 7, 8, 51 ], + "MD035": [ 61 ], + "MD036": [ 65 ], + "MD042": [ 81 ], + "MD045": [ 85 ], + "MD046": [ 49, 73, 77 ], + "MD047": [ 144 ], + "MD048": [ 77 ], + "MD049": [ 90 ], + "MD050": [ 94 ], + "MD051": [ 96 ], + "MD052": [ 98 ], + "MD053": [ 100 ], + "MD055": [ 110 ], + "MD056": [ 116 ], + "MD058": [ 119, 121 ], + "MD059": [ 124 ], + "MD060": [ 110 ] + } + }; + t.deepEqual(actualResult, expectedResult, "Undetected issues."); +}); + +test("nullFrontMatter", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "strings": { + "content": "---\n\t\n---\n# Heading\n" + }, + "frontMatter": null, + "config": { + "default": false, + "MD010": true + }, + // @ts-ignore + "resultVersion": 0 + }, function callback(err, result) { + t.falsy(err); + const expectedResult = { + "content": { "MD010": [ 2 ] } + }; + // @ts-ignore + t.deepEqual(result, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("customFrontMatter", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "strings": { + "content": "\n\t\n\n# Heading\n" + }, + "frontMatter": /[\s\S]*<\/head>/, + "config": { + "default": false, + "MD010": true + } + }, function callback(err, result) { + t.falsy(err); + const expectedResult = { + "content": [] + }; + t.deepEqual(result, expectedResult, "Did not get empty results."); + resolve(); + }); +})); + +test("noInlineConfig", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "strings": { + "content": [ + "# Heading", + "", + "\tTab", + "", + "", + "", + "\tTab", + "", + "", + "", + "\tTab\n" + ].join("\n") + }, + "noInlineConfig": true, + // @ts-ignore + "resultVersion": 0 + }, function callback(err, result) { + t.falsy(err); + const expectedResult = { + "content": { + "MD010": [ 3, 7, 11 ] + } + }; + // @ts-ignore + t.deepEqual(result, expectedResult, "Undetected issues."); + resolve(); + }); +})); + +test("readmeHeadings", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "files": "README.md", + "noInlineConfig": true, + "config": { + "default": false, + "MD013": { + "line_length": 150 + }, + "MD043": { + "headings": [ + "# markdownlint", + "## Install", + "## Overview", + "### Related", + "### References", + "## Demonstration", + "## Rules / Aliases", + "### Custom Rules", + "## Tags", + "## Configuration", + "## API", + "### Linting", + "#### options", + "##### options.config", + "##### options.configParsers", + "##### options.customRules", + "##### options.files", + "##### options.frontMatter", + "##### options.fs", + "##### options.handleRuleFailures", + "##### options.markdownItFactory", + "##### options.noInlineConfig", + "##### ~~options.resultVersion~~", + "##### options.strings", + "#### callback", + "#### result", + "### Config", + "#### file", + "#### parsers", + "#### fs", + "#### callback", + "#### result", + "### Fixing", + "### Miscellaneous", + "## Usage", + "## Browser", + "## Examples", + "## Contributing", + "## Releasing", + "## History" + ] + } + } + }, function callback(err, result) { + t.falsy(err); + const expected = { "README.md": [] }; + t.deepEqual(result, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("filesArrayNotModified", (t) => new Promise((resolve) => { + t.plan(2); + const files = [ + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" + ]; + const expectedFiles = [ ...files ]; + lintAsync({ "files": files }, function callback(err) { + t.falsy(err); + t.deepEqual(files, expectedFiles, "Files modified."); + resolve(); + }); +})); + +test("filesArrayAsString", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "files": "README.md", + "noInlineConfig": true, + "config": { + "MD013": { "line_length": 150 }, + "MD024": false + } + }, function callback(err, actual) { + t.falsy(err); + const expected = { "README.md": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("missingOptions", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync(null, function callback(err, result) { + t.falsy(err); + t.deepEqual( + result, + {}, + "Did not get empty result for missing options." + ); + resolve(); + }); +})); + +test("missingFilesAndStrings", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({}, function callback(err, result) { + t.falsy(err); + t.truthy(result, "Did not get result for missing files/strings."); + resolve(); + }); +})); + +test("missingCallback", (t) => { + t.plan(0); + // @ts-ignore + lintAsync(); +}); + +test("badFile", (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + "files": [ "./badFile" ] + }, function callback(err, result) { + t.truthy(err, "Did not get an error for bad file."); + t.true(err instanceof Error, "Error not instance of Error."); + // @ts-ignore + t.is(err.code, "ENOENT", "Error code for bad file not ENOENT."); + t.true(!result, "Got result for bad file."); + resolve(); + }); +})); + +test("badFileSync", (t) => { + t.plan(1); + t.throws( + function badFileCall() { + lintSync({ + "files": [ "./badFile" ] + }); + }, + { + "message": /ENOENT/ + }, + "Did not get correct exception for bad file." + ); +}); + +test("badFilePromise", (t) => new Promise((resolve) => { + t.plan(3); + lintPromise({ + "files": [ "./badFile" ] + }).then( + null, + (error) => { + t.truthy(error, "Did not get an error for bad file."); + t.true(error instanceof Error, "Error not instance of Error."); + t.is(error.code, "ENOENT", "Error code for bad file not ENOENT."); + resolve(); + } + ); +})); + +test("missingStringValue", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "strings": { + // @ts-ignore + "undefined": undefined, + // @ts-ignore + "null": null, + "empty": "" + } + }, function callback(err, result) { + t.falsy(err); + const expectedResult = { + "undefined": [], + "null": [], + "empty": [] + }; + t.deepEqual(result, expectedResult, "Did not get empty results."); + resolve(); + }); +})); + +test("customFileSystemSync", (t) => { + t.plan(2); + const file = "/dir/file.md"; + const fsApi = { + "access": () => { throw new Error("access"); }, + "accessSync": () => { throw new Error("accessSync"); }, + "readFile": () => { throw new Error("readFile"); }, + // @ts-ignore + "readFileSync": (p) => { + t.is(p, file); + return "# Heading"; + } + }; + const result = lintSync({ + "files": file, + "fs": fsApi + }); + t.deepEqual(result[file].length, 1, "Did not report violations."); +}); + +test("customFileSystemAsync", (t) => new Promise((resolve) => { + t.plan(3); + const file = "/dir/file.md"; + const fsApi = { + "access": () => { throw new Error("access"); }, + "accessSync": () => { throw new Error("accessSync"); }, + // @ts-ignore + "readFile": (p, o, cb) => { + t.is(p, file); + cb(null, "# Heading"); + }, + "readFileSync": () => { throw new Error("readFileSync"); } + }; + lintAsync({ + "files": file, + "fs": fsApi + }, function callback(err, result) { + t.falsy(err); + // @ts-ignore + t.deepEqual(result[file].length, 1, "Did not report violations."); + resolve(); + }); +})); + +test("readme", async(t) => { + t.plan(132); + /** @type {Object.} */ + const tagToRules = {}; + for (const rule of rules) { + for (const tag of rule.tags) { + const tagRules = tagToRules[tag] || []; + tagRules.push(rule.names[0]); + tagToRules[tag] = tagRules; + } + } + const contents = await fs.promises.readFile("README.md", "utf8"); + const rulesLeft = [ ...rules ]; + let seenRelated = false; + let seenReferences = false; + let seenRules = false; + let inRules = false; + let seenTags = false; + let inTags = false; + // @ts-ignore + for (const token of markdownIt().parse(contents, {})) { + if ( + (token.type === "bullet_list_open") && + (token.level === 0) + ) { + if (!seenRelated) { + seenRelated = true; + } else if (!seenReferences) { + seenReferences = true; + } else if (!seenRules) { + seenRules = true; + inRules = true; + } else if (!seenTags) { + seenTags = true; + inTags = true; + } + } else if ( + (token.type === "bullet_list_close") && + (token.level === 0) + ) { + inRules = false; + inTags = false; + } else if (token.type === "inline") { + if (inRules) { + const rule = rulesLeft.shift(); + t.truthy(rule, + "Missing rule implementation for " + token.content + "."); + if (rule) { + const ruleName = rule.names[0]; + const ruleAliases = rule.names.slice(1); + let expected = "**[" + ruleName + "](doc/" + + ruleName.toLowerCase() + ".md)** *" + + ruleAliases.join("/") + "* - " + rule.description; + if (deprecatedRuleNames.has(ruleName)) { + expected = "~~" + expected + "~~"; + } + t.is(token.content, expected, "Rule mismatch."); + } + } else if (inTags) { + const parts = + token.content.replace(/[`*]/g, "").split(/ - |, |,\n/); + const tag = parts.shift() || ""; + t.deepEqual(parts, tagToRules[tag] || [], + "Rule mismatch for tag " + tag + "."); + delete tagToRules[tag]; + } + } + } + const ruleLeft = rulesLeft.shift(); + t.true(!ruleLeft, + "Missing rule documentation for " + + (ruleLeft || "[NO RULE]").toString() + "."); + const tagLeft = Object.keys(tagToRules).shift(); + t.true(!tagLeft, "Undocumented tag " + tagLeft + "."); +}); + +test("validateJsonUsingConfigSchemaStrict", async(t) => { + t.plan(223); + // @ts-ignore + const ajv = new Ajv(ajvOptions); + const validateSchemaStrict = ajv.compile(configSchemaStrict); + const configRe = + /^[\s\S]*[\s\S]*$/; + const ignoreFiles = new Set([ + "README.md", + "test/inline-configure-file-invalid.md", + "test/inline-configure-file-violations.md", + "test/invalid-ul-style-style.md", + "test/long-lines-negative-line-length.md", + "test/wrong-types-in-config-file.md" + ]); + const files = await globby([ + "*.md", + "doc/*.md", + "helpers/*.md", + "micromark/*.md", + "schema/*.md", + "test/*.md" + ]); + const testFiles = files.filter((file) => !ignoreFiles.has(file)); + for (const file of testFiles) { + const data = fs.readFileSync(file, "utf8"); + if (configRe.test(data)) { + const config = data.replace(configRe, "$1"); + const result = validateSchemaStrict(JSON.parse(config)); + t.truthy( + result, + `${file}\n${JSON.stringify(validateSchemaStrict.errors, null, 2)}` + ); + } + } +}); + +test("validateConfigSchemaAllowsUnknownProperties", (t) => { + t.plan(4); + // @ts-ignore + const ajv = new Ajv(ajvOptions); + const validateSchema = ajv.compile(configSchema); + const validateSchemaStrict = ajv.compile(configSchemaStrict); + const testCases = [ + { + "property": true + }, + { + "property": { + "object": 1 + } + } + ]; + for (const testCase of testCases) { + const result = validateSchema(testCase); + t.truthy( + result, + "Unknown property blocked by default: " + JSON.stringify(validateSchema.errors, null, 2) + ); + const resultStrict = validateSchemaStrict(testCase); + t.falsy( + resultStrict, + "Unknown property allowed when strict: " + JSON.stringify(validateSchemaStrict.errors, null, 2) + ); + } +}); + +test("validateConfigSchemaAppliesToUnknownProperties", (t) => { + t.plan(4); + // @ts-ignore + const ajv = new Ajv(ajvOptions); + const validateSchema = ajv.compile(configSchema); + for (const allowed of [ true, {} ]) { + t.truthy( + validateSchema({ "property": allowed }), + `Unknown property value ${allowed} blocked` + ); + } + for (const blocked of [ 2, "string" ]) { + t.falsy( + validateSchema({ "property": blocked }), + `Unknown property value ${blocked} allowed` + ); + } +}); + +test("validateConfigExampleJson", (t) => { + t.plan(4); + + // Validate schema + // @ts-ignore + const ajv = new Ajv(ajvOptions); + const validateSchema = ajv.compile(configSchema); + t.is( + configSchema.$id.replace(/^.*\/v(?\d+\.\d+\.\d+)\/.*$/u, "$"), + packageJson.version + ); + // @ts-ignore + t.is(configSchema.$id, configSchema.properties.$schema.default); + + // Validate JSONC + const fileJson = ".markdownlint.jsonc"; + const dataJson = fs.readFileSync( + path.join(__dirname(import.meta), "../schema", fileJson), + "utf8" + ); + const jsonObject = jsoncParser.parse(dataJson); + const result = validateSchema(jsonObject); + t.truthy( + result, + `${fileJson}\n${JSON.stringify(validateSchema.errors, null, 2)}` + ); + + // Validate YAML + const fileYaml = ".markdownlint.yaml"; + const dataYaml = fs.readFileSync( + path.join(__dirname(import.meta), "../schema", fileYaml), + "utf8" + ); + const yamlObject = jsYaml.load(dataYaml); + t.deepEqual(yamlObject, jsonObject, + "YAML example does not match JSON example."); +}); + +test("allBuiltInRulesHaveValidUrl", (t) => { + t.plan(159); + for (const rule of rules) { + // @ts-ignore + t.truthy(rule.information); + // @ts-ignore + t.true(Object.getPrototypeOf(rule.information) === URL.prototype); + const ruleName = rule.names[0].toLowerCase(); + t.is( + // @ts-ignore + rule.information.href, + `${packageJson.homepage}/blob/v${packageJson.version}/doc/${ruleName}.md` + ); + } +}); + +test("someCustomRulesHaveValidUrl", (t) => { + t.plan(9); + for (const rule of customRules.all) { + t.true(!rule.information || + (Object.getPrototypeOf(rule.information) === URL.prototype)); + if (rule === customRules.anyBlockquote) { + t.is( + rule.information?.href, + `${packageJson.homepage}/blob/main/test/rules/any-blockquote.js` + ); + } else if (rule === customRules.lettersEX) { + t.is( + rule.information?.href, + `${packageJson.homepage}/blob/main/test/rules/letters-E-X.js` + ); + } + } +}); + +test("coverageForCacheMicromarkTokensWhenUndefined", (t) => { + t.plan(1); + cache.initialize(undefined); + t.is(cache.micromarkTokens().length, 0); +}); + +test("micromarkParseCalledWhenNeeded", (t) => new Promise((resolve) => { + t.plan(3); + /** @type {import("markdownlint").Rule} */ + const markdownItRule = { + "names": [ "markdown-it-rule" ], + "description": "markdown-it rule", + "tags": [ "test" ], + "parser": "markdownit", + "function": () => { + t.true(cache.micromarkTokens().length > 0); + } + }; + lintAsync({ + "strings": { + "string": "# Heading\n\nText\n" + }, + "config": { + "markdown-it-rule": true + }, + "customRules": [ markdownItRule ], + "markdownItFactory": getMarkdownItFactory([]) + }, function callback(err, actual) { + t.falsy(err); + const expected = { "string": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("micromarkParseSkippedWhenNotNeeded", (t) => new Promise((resolve) => { + t.plan(3); + /** @type {import("markdownlint").Rule} */ + const markdownItRule = { + "names": [ "markdown-it-rule" ], + "description": "markdown-it rule", + "tags": [ "test" ], + "parser": "markdownit", + "function": () => { + t.true(cache.micromarkTokens().length === 0); + } + }; + lintAsync({ + "strings": { + "string": "# Heading\n\nText\n" + }, + "config": { + "default": false, + "markdown-it-rule": true + }, + "customRules": [ markdownItRule ], + "markdownItFactory": getMarkdownItFactory([]) + }, function callback(err, actual) { + t.falsy(err); + const expected = { "string": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("markdownItPluginsSingle", (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + "strings": { + "string": "# Heading\n\nText\n" + }, + // Use a markdown-it custom rule so the markdown-it plugin will be run + "customRules": customRules.anyBlockquote, + "markdownItFactory": getMarkdownItFactory([ + [ pluginInline, "check_text_plugin", "text", () => t.true(true) ] + ]) + }, function callback(err, actual) { + t.falsy(err); + const expected = { "string": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("markdownItPluginsMultiple", (t) => new Promise((resolve) => { + t.plan(4); + lintAsync({ + "strings": { + "string": "# Heading\n\nText H~2~0 text 29^th^ text\n" + }, + // Use a markdown-it custom rule so the markdown-it plugin will be run + "customRules": customRules.anyBlockquote, + "markdownItFactory": getMarkdownItFactory([ + [ pluginSub ], + [ pluginSup ], + [ pluginInline, "check_sub_plugin", "sub_open", () => t.true(true) ], + [ pluginInline, "check_sup_plugin", "sup_open", () => t.true(true) ] + ]) + }, function callback(err, actual) { + t.falsy(err); + const expected = { "string": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("markdownItPluginsNoMarkdownIt", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "strings": { + "string": "# Heading\n\nText\n" + }, + "markdownItFactory": getMarkdownItFactory([ + [ pluginInline, "check_text_plugin", "text", () => t.fail() ] + ]) + }, function callback(err, actual) { + t.falsy(err); + const expected = { "string": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("markdownItPluginsUnusedUncalled", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "config": { + "default": false + }, + "strings": { + "string": "# Heading\n\nText\n" + }, + // Use a markdown-it custom rule so the markdown-it plugin will be run + "customRules": customRules.anyBlockquote, + "markdownItFactory": getMarkdownItFactory([ + [ pluginInline, "check_text_plugin", "text", () => t.fail() ] + ]) + }, function callback(err, actual) { + t.falsy(err); + const expected = { "string": [] }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("Pandoc footnote", (t) => new Promise((resolve) => { + t.plan(2); + lintAsync({ + "strings": { + "string": +`# Heading + +Text with: [^footnote] + +[^footnote]: Footnote text on multiple + + lines including a [reference][] + +[reference]: https://example.com +` + }, + // @ts-ignore + "resultVersion": 0 + }, (err, actual) => { + t.falsy(err); + const expected = { "string": {} }; + t.deepEqual(actual, expected, "Unexpected issues."); + resolve(); + }); +})); + +test("token-map-spans", (t) => { + t.plan(38); + /** @type {import("markdownlint").Options} */ + const options = { + "customRules": [ + { + "names": [ "token-map-spans" ], + "description": "token-map-spans", + "tags": [ "tms" ], + "parser": "markdownit", + "function": function tokenMapSpans(params) { + /** @type {number[]} */ + const tokenLines = []; + let lastLineNumber = -1; + const inlines = params.parsers.markdownit.tokens.filter( + (c) => c.type === "inline" + ); + for (const token of inlines) { + t.truthy(token.map); + for (let i = token.map[0]; i < token.map[1]; i++) { + if (tokenLines.includes(i)) { + t.true( + lastLineNumber === token.lineNumber, + `Line ${i + 1} is part of token maps from multiple lines.` + ); + } else { + tokenLines.push(i); + } + lastLineNumber = token.lineNumber; + } + } + } + } + ], + "files": [ "./test/token-map-spans.md" ], + "markdownItFactory": getMarkdownItFactory([]) + }; + lintSync(options); +}); + +test("configParsersInvalid", async(t) => { + t.plan(2); + const options = { + "strings": { + "content": [ + "Text", + "", + "", + "" + ].join("\n") + } + }; + const actual = await lintPromise(options); + t.is(actual.content.length, 1); + t.is(actual.content[0].ruleNames[0], "MD041"); +}); + +test("configParsersJSON", async(t) => { + t.plan(1); + const options = { + "strings": { + "content": [ + "Text", + "", + "", + "" + ].join("\n") + } + }; + const actual = await lintPromise(options); + t.is(actual.content.length, 0); +}); + +test("configParsersJSONC", async(t) => { + t.plan(1); + const options = { + "strings": { + "content": [ + "Text", + "", + "", + "" + ].join("\n") + }, + "configParsers": [ jsoncParser.parse ] + }; + const actual = await lintPromise(options); + t.is(actual.content.length, 0); +}); + +test("configParsersYAML", async(t) => { + t.plan(1); + const options = { + "strings": { + "content": [ + "Text", + "", + "", + "" + ].join("\n") + }, + "configParsers": [ jsYaml.load ] + }; + // @ts-ignore + const actual = await lintPromise(options); + t.is(actual.content.length, 0); +}); + +test("configParsersTOML", async(t) => { + t.plan(1); + const options = { + "strings": { + "content": [ + "Text", + "", + "", + "" + ].join("\n") + }, + "configParsers": [ + require("toml").parse + ] + }; + const actual = await lintPromise(options); + t.is(actual.content.length, 0); +}); + +test("getVersion", (t) => { + t.plan(1); + const actual = getVersion(); + const expected = packageJson.version; + t.is(actual, expected, "Version string not correct."); +}); + +test("constants", (t) => { + t.plan(2); + // @ts-ignore + t.is(constants.homepage, packageJson.homepage); + // @ts-ignore + t.is(constants.version, packageJson.version); +}); + +test("version numbers match", async(t) => { + t.plan(441); + const files = [ + // See previous test + // "./package.json", + "./CHANGELOG.md", + "./README.md", + "./helpers/README.md", + "./lib/configuration-strict.d.ts", + // See previous test + // "./lib/constants.mjs", + "./schema/.markdownlint.jsonc", + "./schema/.markdownlint.yaml", + "./schema/markdownlint-config-schema.json", + "./schema/markdownlint-config-schema-strict.json" + ]; + const contents = await Promise.all(files.map((file) => fs.promises.readFile(file, "utf8"))); + for (const content of contents) { + // eslint-disable-next-line init-declarations + let match; + const githubProjectOrFileRe = /(?:DavidAnson\/markdownlint|markdownlint\/blob)\/v(\d+\.\d+\.\d+)/gu; + while ((match = githubProjectOrFileRe.exec(content)) !== null) { + t.is(match[1], packageJson.version); + } + const firstChangelogRe = /## (\d+\.\d+\.\d+)/u; + match = firstChangelogRe.exec(content); + if (match) { + t.is(match[1], packageJson.version); + } + } +}); diff --git a/test/mathjax-scenarios.md b/test/mathjax-scenarios.md new file mode 100644 index 00000000..48aa996c --- /dev/null +++ b/test/mathjax-scenarios.md @@ -0,0 +1,15 @@ +# Mathjax Scenarios + +$1 * 2 * 3$ + +$$1 * 2 * 3$$ + +$$1 ++ 2 ++ 3$$ + +$$ +1 +$$$$ +2 +$$ diff --git a/test/md003-escaped-trailing-hash.md b/test/md003-escaped-trailing-hash.md new file mode 100644 index 00000000..1548133c --- /dev/null +++ b/test/md003-escaped-trailing-hash.md @@ -0,0 +1,21 @@ +# Heading + +## Heading with trailing hash \# + +## Heading with trailing hash no space\# + +### Heading with trailing hash \#\# + +### Heading with trailing hash no space\#\# + +### Heading with trailing hash #\# + +### Heading with trailing hash no space#\# + +### Heading with trailing hash {MD003} ## + +### Heading with trailing hash no space{MD020}## + +### Heading with trailing hash {MD020} \## + +### Heading with trailing hash no space{MD020}\## diff --git a/test/md004-list-items-in-blockquote.md b/test/md004-list-items-in-blockquote.md new file mode 100644 index 00000000..0b95d9dd --- /dev/null +++ b/test/md004-list-items-in-blockquote.md @@ -0,0 +1,23 @@ +# Heading + +Text + +- Item +- Item + +Text + +>- Item +>- Item + +Text + +> - Item +> - Item + +Text + +> > - Item +> > - Item + +Text diff --git a/test/md022-line-number-out-of-range.md b/test/md022-line-number-out-of-range.md new file mode 100644 index 00000000..b06173e3 --- /dev/null +++ b/test/md022-line-number-out-of-range.md @@ -0,0 +1,5 @@ +-- + diff --git a/test/md033-cannot-read-property-of-undefined.md b/test/md033-cannot-read-property-of-undefined.md new file mode 100644 index 00000000..ad626347 --- /dev/null +++ b/test/md033-cannot-read-property-of-undefined.md @@ -0,0 +1,15 @@ +# Heading + +Head | Head +--------|------------ +
| {MD033} + +{MD033} | Head +--------|------------ +
| {MD033} +text | text +{MD033} | text + + diff --git a/test/md036-emphasis-as-heading.md b/test/md036-emphasis-as-heading.md new file mode 100644 index 00000000..a2fe1252 --- /dev/null +++ b/test/md036-emphasis-as-heading.md @@ -0,0 +1,17 @@ +# Simplified examples from issue #26 + +* Item +* **Emphasized item** +* Item + +_Emphasis as heading {MD036}_ + +1. **Emphasized item** + * Item + * Item +1. **Emphasized item** + * Item + * **Emphasized item** + * Item + +**Emphasis as heading {MD036}** diff --git a/test/md038-scenarios.md b/test/md038-scenarios.md new file mode 100644 index 00000000..c32f13d3 --- /dev/null +++ b/test/md038-scenarios.md @@ -0,0 +1,59 @@ +# MD038 Scenarios + +## Allowed: No space + +`code` + +## Allowed: Padding, no backtick + +` code ` + +## Allowed: Padding, backtick + +`` `code` `` + +## Allowed: Start or end, backtick + +``code` `` + +`` `code`` + +## Reported: Start or end, no backtick + +`code ` {MD038} + +`code` (fixed) + +` code` {MD038} + +`code` (fixed) + +## Reported: Start or end, backtick + +``code` `` {MD038} + +``code` `` (fixed) + +`` `code`` {MD038} + +`` `code`` (fixed) + +## Reported: Start and end, no backtick + +` code ` {MD038} + +`code` (fixed) + +## Reported: Start and end, backtick + +`` code` `` {MD038} + +`` code` `` (fixed) + +`` `code `` {MD038} + +`` `code `` (fixed) + +`` `code` `` {MD038} + +`` `code` `` (fixed) diff --git a/test/md040-allowed_languages.md b/test/md040-allowed_languages.md new file mode 100644 index 00000000..5fbe3d24 --- /dev/null +++ b/test/md040-allowed_languages.md @@ -0,0 +1,74 @@ +# md040-allowed_languages.md + +Code block with `html` not in allowed_languages: + +```html +

markdownlint

{MD040:5} +``` + +Code block with `css` not in allowed_languages: + +```css +body {} {MD040:11} +``` + +Code block with `MD` (uppercase) not in allowed_languages: + +```MD +hello md {MD040:17} +``` + +Code block with `ts` (lowercase) not in allowed_languages: + +```ts +let foo = "bar"; {MD040:23} +``` + +Code block with `js` in allowed_languages: + +```js +console.log('markdownlint') +``` + +Code block with `js foo` allowed_languages: + +```js foo +console.log('bar') +``` + +Code block with ` scss` (prefixed by a space) in allowed_languages: {MD038} + +``` scss +body { + h1 { + color: red; + } +} +``` + +Code block with `md` (lowercase) in allowed_languages: + +```md +hello md +``` + +Code block with `TS` (uppercase) in allowed_languages: + +```TS +body { + h1 { + color: red; + } +} +``` + + diff --git a/test/md040-language_only.md b/test/md040-language_only.md new file mode 100644 index 00000000..003bd949 --- /dev/null +++ b/test/md040-language_only.md @@ -0,0 +1,35 @@ +# md040-language_only.md + +Fence code block information with leading whitespace: + +``` html +

markdownlint

+``` + +Fence code block information with trailing whitespace: + +```css +body {} {MD009:11} +``` + +Fence code block information with extra data: + +```html version=5 +MarkdownLint {MD040:17} +``` + +Fence code block information without whitespaces and extra data: + +```css +a {} +``` + + diff --git a/test/md041-ignore-leading-comments-combined.md b/test/md041-ignore-leading-comments-combined.md new file mode 100644 index 00000000..f43e6006 --- /dev/null +++ b/test/md041-ignore-leading-comments-combined.md @@ -0,0 +1,15 @@ +# Heading # + +Text text text + +Embedded tab + +Text text text + +Trailing space {MD009} + +Text text text + + diff --git a/test/md041-ignore-leading-comments-violation.md b/test/md041-ignore-leading-comments-violation.md new file mode 100644 index 00000000..e52ed08c --- /dev/null +++ b/test/md041-ignore-leading-comments-violation.md @@ -0,0 +1,15 @@ + + +Text text text {MD041} + +Embedded tab + +Text text text + +Trailing space {MD009} + +Text text text + + diff --git a/test/md041-ignore-leading-comments.md b/test/md041-ignore-leading-comments.md new file mode 100644 index 00000000..2c24f5ec --- /dev/null +++ b/test/md041-ignore-leading-comments.md @@ -0,0 +1,17 @@ + + +# Heading + +Text text text + +Embedded tab + +Text text text + +Trailing space {MD009} + +Text text text + + diff --git a/test/md041-yaml-title-and-first-line-heading.md b/test/md041-yaml-title-and-first-line-heading.md new file mode 100644 index 00000000..4ebe67b4 --- /dev/null +++ b/test/md041-yaml-title-and-first-line-heading.md @@ -0,0 +1,13 @@ +--- +path: "/post" +date: "2012-06-21T10:14:00.000+02:00" +title: "First level heading" +--- + +## Second level heading + + diff --git a/test/md052-invalid-range-bug.md b/test/md052-invalid-range-bug.md new file mode 100644 index 00000000..b97ae1d1 --- /dev/null +++ b/test/md052-invalid-range-bug.md @@ -0,0 +1,5 @@ +# MD052 Invalid Range Bug + +* [0, N) +* `inputs[0][d]` +* `inputs[k]` diff --git a/test/micromark-regressions.md b/test/micromark-regressions.md new file mode 100644 index 00000000..68497701 --- /dev/null +++ b/test/micromark-regressions.md @@ -0,0 +1,8 @@ +# Micromark Regressions + +## + +* List item + :::Directive + +Text diff --git a/test/mixed-emphasis-markers.md b/test/mixed-emphasis-markers.md new file mode 100644 index 00000000..92c22393 --- /dev/null +++ b/test/mixed-emphasis-markers.md @@ -0,0 +1,19 @@ +# Mixed Emphasis Markers + +This paragraph *uses* both _kinds_ of emphasis marker. {MD049} + +This paragraph _uses_ both *kinds* of emphasis marker. {MD049} + +This paragraph *nests both _kinds_ of emphasis* marker. {MD049} + +This paragraph *nests both __kinds__ of emphasis* marker. + +This paragraph **nests both __kinds__ of emphasis** marker. {MD050} + +This paragraph _nests both *kinds* of emphasis_ marker. {MD049} + +This paragraph _nests both **kinds** of emphasis_ marker. {MD049} {MD050} + +This paragraph __nests both **kinds** of emphasis__ marker. {MD050} + + diff --git a/test/mixed_header_types_atx.md b/test/mixed_header_types_atx.md deleted file mode 100644 index 9e66f992..00000000 --- a/test/mixed_header_types_atx.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header - -## Header 2 {MD003} ## - -Header 3 {MD003} ----------------- \ No newline at end of file diff --git a/test/mixed_header_types_atx_closed.md b/test/mixed_header_types_atx_closed.md deleted file mode 100644 index fdd549dc..00000000 --- a/test/mixed_header_types_atx_closed.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 # - -## Header 2 {MD003} - -Header 3 {MD003} ----------------- \ No newline at end of file diff --git a/test/mixed_header_types_setext.md b/test/mixed_header_types_setext.md deleted file mode 100644 index 1a4d8891..00000000 --- a/test/mixed_header_types_setext.md +++ /dev/null @@ -1,6 +0,0 @@ -Header 1 -======== - -## Header 2 {MD003} - -## Header 3 {MD003} ## \ No newline at end of file diff --git a/test/mixed_heading_types_atx.md b/test/mixed_heading_types_atx.md new file mode 100644 index 00000000..b82f5462 --- /dev/null +++ b/test/mixed_heading_types_atx.md @@ -0,0 +1,6 @@ +# Heading + +## Heading 2 {MD003} ## + +Heading 3 {MD003} +----------------- diff --git a/test/mixed_heading_types_atx_closed.md b/test/mixed_heading_types_atx_closed.md new file mode 100644 index 00000000..e786dd65 --- /dev/null +++ b/test/mixed_heading_types_atx_closed.md @@ -0,0 +1,6 @@ +# Heading 1 # + +## Heading 2 {MD003} + +Heading 3 {MD003} +----------------- diff --git a/test/mixed_heading_types_setext.md b/test/mixed_heading_types_setext.md new file mode 100644 index 00000000..47515ac8 --- /dev/null +++ b/test/mixed_heading_types_setext.md @@ -0,0 +1,6 @@ +Heading 1 +======== + +## Heading 2 {MD003} + +## Heading 3 {MD003} ## diff --git a/test/no-alt-text.md b/test/no-alt-text.md new file mode 100644 index 00000000..9641aadb --- /dev/null +++ b/test/no-alt-text.md @@ -0,0 +1,86 @@ +# Images with and without alternate text + +![Alternate text](image.jpg) + +![](image.jpg) {MD045} + +![Alternate text](image.jpg "Title") + +![](image.jpg "Title") {MD045} + +Image without alternate text ![](image.jpg) in a sentence. {MD045} + +Reference image with alternate text ![Alternate text][notitle] + +Reference image without alternate text ![][notitle] {MD045} + +Reference image with alternate text and title ![Alternate text][title] + +Reference image without alternate text and title ![][title] {MD045} + +Link to image with alternate text [![Alternate text](image.jpg)](image.jpg) + +Link to image without alternate text [![](image.jpg)](image.jpg) {MD045} + +Multi-line image with alternate text ![Alternate text](image.jpg "Title" +) + +Multi-line image without alternate text ![](image.jpg "Title" +) {MD045:28} + + + +Image tag with alt attribute set to text +Descriptive text + +Image tag with alt attribute not set + {MD045} + +Image tag with alt attribute set to decorative with an empty double-quote string + + +Image tag with alt attribute set to decorative with an empty single-quote string + + +Image tag with no alt attribute {MD045} + +Multi-line image tag with no alt text + {MD045:48} + +Multi-line image tag with alt attribute not set + {MD045:52} + +Multi-line image tag with alt text +Description + +Uppercase image tag with alt attribute set +Descriptive text + +Uppercase image tag with no alt set {MD045} + +

+ {MD045} +

+ +No alt attribute is okay when the image is hidden from assistive technology: + + + +But not when disabled: {MD045} + +Multi-line image tag aria-hidden: + + + + +[notitle]: image.jpg +[title]: image.jpg "Title" diff --git a/test/no-multiple-blanks-maximum.md b/test/no-multiple-blanks-maximum.md new file mode 100644 index 00000000..f128aaa0 --- /dev/null +++ b/test/no-multiple-blanks-maximum.md @@ -0,0 +1,52 @@ +# Heading + +Text + +Text + + +Text + + + +Text + + + + +Text {MD012:16} + + + + + +Text {MD012:21} {MD012:22} + + + + + + +Text {MD012:27} {MD012:28} {MD012:29} + +Text + + + + +Text {MD012:36} + + + +Text + + +Text + +Text + + diff --git a/test/no-multiple-blanks.md b/test/no-multiple-blanks.md new file mode 100644 index 00000000..f9a2ab01 --- /dev/null +++ b/test/no-multiple-blanks.md @@ -0,0 +1,24 @@ +# Heading + +Text + +Text + + +Text {MD012:7} + + + +Text {MD012:10} {MD012:11} + + + + +Text {MD012:14} {MD012:15} {MD012:16} + +Text + + +Text {MD012:21} + +Text diff --git a/test/no-tabs-edge-case-MD010.md b/test/no-tabs-edge-case-MD010.md new file mode 100644 index 00000000..516a68c1 --- /dev/null +++ b/test/no-tabs-edge-case-MD010.md @@ -0,0 +1,11 @@ + text {MD010} +text and text 2 {MD010} +texts with trailing spaces{MD010} + + diff --git a/test/no_first_line_header.json b/test/no_first_line_header.json deleted file mode 100644 index 054e8566..00000000 --- a/test/no_first_line_header.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "MD041": true -} diff --git a/test/no_first_line_header.md b/test/no_first_line_header.md deleted file mode 100644 index ef1745b0..00000000 --- a/test/no_first_line_header.md +++ /dev/null @@ -1 +0,0 @@ -This is a file without a top level header {MD041} diff --git a/test/no_first_line_heading.md b/test/no_first_line_heading.md new file mode 100644 index 00000000..888099bf --- /dev/null +++ b/test/no_first_line_heading.md @@ -0,0 +1 @@ +This is a file without a top level heading {MD041} diff --git a/test/no_first_line_top_level_header.json b/test/no_first_line_top_level_header.json deleted file mode 100644 index f94c9582..00000000 --- a/test/no_first_line_top_level_header.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "default": true, - "MD002": false, - "MD041": true -} diff --git a/test/no_first_line_top_level_header.md b/test/no_first_line_top_level_header.md deleted file mode 100644 index c0848eea..00000000 --- a/test/no_first_line_top_level_header.md +++ /dev/null @@ -1 +0,0 @@ -## Second level header {MD041} diff --git a/test/no_first_line_top_level_heading.md b/test/no_first_line_top_level_heading.md new file mode 100644 index 00000000..35d68ecb --- /dev/null +++ b/test/no_first_line_top_level_heading.md @@ -0,0 +1 @@ +## Second level heading {MD041} diff --git a/test/node_modules/pseudo-package/config-frompackage.json b/test/node_modules/pseudo-package/config-frompackage.json new file mode 100644 index 00000000..f56f00bf --- /dev/null +++ b/test/node_modules/pseudo-package/config-frompackage.json @@ -0,0 +1,4 @@ +{ + "no-hard-tabs": false, + "whitespace": false +} diff --git a/test/node_modules/pseudo-package/package.json b/test/node_modules/pseudo-package/package.json new file mode 100644 index 00000000..65133867 --- /dev/null +++ b/test/node_modules/pseudo-package/package.json @@ -0,0 +1,3 @@ +{ + "main": "config-frompackage.json" +} diff --git a/test/ordered-list-item-prefix-double-digits-ordered.md b/test/ordered-list-item-prefix-double-digits-ordered.md new file mode 100644 index 00000000..c27c41ae --- /dev/null +++ b/test/ordered-list-item-prefix-double-digits-ordered.md @@ -0,0 +1,42 @@ +# Ordered ist Item Prefix Double Digits Ordered + +Good list: + +1. Item +2. Item +3. Item +4. Item +5. Item +6. Item +7. Item +8. Item +9. Item +10. Item +11. Item + +Bad list 1: + +1. Item +10. Item {MD029} +9. Item {MD029} + +Bad list 2: + +11. Item {MD029} +10. Item {MD029} + +Bad list 3 + +12. Item {MD029} +1. Item {MD029} + +Bad list 4: + +0. Item +10. Item {MD029} + + diff --git a/test/ordered-list-item-prefix-one.md b/test/ordered-list-item-prefix-one.md new file mode 100644 index 00000000..b0a4eb19 --- /dev/null +++ b/test/ordered-list-item-prefix-one.md @@ -0,0 +1,80 @@ +# Ordered list examples + +text + +1. Item + +text + +2. Item {MD029} + +text + +1. Item +1. Item +1. Item + +text + +1. Item +2. Item {MD029} +3. Item {MD029} + +text + +1. Item +2. Item {MD029} +1. Item +4. Item {MD029} + +text + +1. Item +1. Item +3. Item {MD029} +1. Item + +text + +1. Item +2. Item {MD029} +3. Item {MD029} + +text + +4. Item {MD029} +5. Item {MD029} + +text + +- Item + 1. Item + 1. Item + 1. Item +- Item + 1. Item + 2. Item {MD029} + 3. Item {MD029} +- Item + 1. Item + 2. Item {MD029} + 4. Item {MD029} +- Item + +text + +0. Item {MD029} +1. Item +2. Item {MD029} + +text + +0. Item {MD029} +1. Item +3. Item {MD029} + + diff --git a/test/ordered-list-item-prefix-one_or_ordered.md b/test/ordered-list-item-prefix-one_or_ordered.md new file mode 100644 index 00000000..c4264452 --- /dev/null +++ b/test/ordered-list-item-prefix-one_or_ordered.md @@ -0,0 +1,74 @@ +# Ordered list examples + +text + +1. Item + +text + +2. Item {MD029} + +text + +1. Item +1. Item +1. Item + +text + +1. Item +2. Item +3. Item + +text + +1. Item +2. Item +1. Item {MD029} +4. Item + +text + +1. Item +1. Item +3. Item {MD029} +1. Item + +text + +1. Item +2. Item +3. Item + +text + +4. Item {MD029} +5. Item {MD029} + +text + +- Item + 1. Item + 1. Item + 1. Item +- Item + 1. Item + 2. Item + 3. Item +- Item + 1. Item + 2. Item + 4. Item {MD029} +- Item + +text + +0. Item +1. Item +2. Item + +text + +0. Item +1. Item +3. Item {MD029} diff --git a/test/ordered-list-item-prefix-ordered.md b/test/ordered-list-item-prefix-ordered.md new file mode 100644 index 00000000..8d54f85c --- /dev/null +++ b/test/ordered-list-item-prefix-ordered.md @@ -0,0 +1,80 @@ +# Ordered list examples + +text + +1. Item + +text + +2. Item {MD029} + +text + +1. Item +1. Item {MD029} +1. Item {MD029} + +text + +1. Item +2. Item +3. Item + +text + +1. Item +2. Item +1. Item {MD029} +4. Item + +text + +1. Item +1. Item {MD029} +3. Item +1. Item {MD029} + +text + +1. Item +2. Item +3. Item + +text + +4. Item {MD029} +5. Item {MD029} + +text + +- Item + 1. Item + 1. Item {MD029} + 1. Item {MD029} +- Item + 1. Item + 2. Item + 3. Item +- Item + 1. Item + 2. Item + 4. Item {MD029} +- Item + +text + +0. Item +1. Item +2. Item + +text + +0. Item +1. Item +3. Item {MD029} + + diff --git a/test/ordered-list-item-prefix-single-alternate.md b/test/ordered-list-item-prefix-single-alternate.md new file mode 100644 index 00000000..562b21d4 --- /dev/null +++ b/test/ordered-list-item-prefix-single-alternate.md @@ -0,0 +1,3 @@ +# Ordered list examples + +9. Item {MD029} diff --git a/test/ordered-list-item-prefix-sublists-ordered.md b/test/ordered-list-item-prefix-sublists-ordered.md new file mode 100644 index 00000000..ef1aeb12 --- /dev/null +++ b/test/ordered-list-item-prefix-sublists-ordered.md @@ -0,0 +1,47 @@ +# Ordered List Item Prefix Sublists Ordered + +Good list and sublist: + +1. Item +2. Item + 1. Item + 2. Item +3. Item + +Good list and bad sublist: + +1. Item +2. Item + 3. Item + 4. Item +3. Item + +Bad list and good sublist: + +1. Item +4. Item {MD029} + 1. Item + 2. Item +5. Item {MD029} + +Bad list and bad sublist: + +1. Item +4. Item {MD029} + 1. Item + 3. Item {MD029} +5. Item {MD029} + +Bad list and bad sublist (0): + +0. Item +4. Item {MD029} + 1. Item + 3. Item {MD029} +5. Item {MD029} + + diff --git a/test/ordered-list-item-prefix-zero-alternate.md b/test/ordered-list-item-prefix-zero-alternate.md new file mode 100644 index 00000000..7895cce5 --- /dev/null +++ b/test/ordered-list-item-prefix-zero-alternate.md @@ -0,0 +1,25 @@ +# Ordered list examples + +text + +0. Item +0. Item +0. Item + +text + +1. Item {MD029} +1. Item {MD029} +1. Item {MD029} + +text + +1. Item {MD029} +2. Item {MD029} +3. Item {MD029} + + diff --git a/test/ordered-list-item-prefix-zero.md b/test/ordered-list-item-prefix-zero.md new file mode 100644 index 00000000..9e3dba9a --- /dev/null +++ b/test/ordered-list-item-prefix-zero.md @@ -0,0 +1,80 @@ +# Ordered list examples + +text + +0. Item + +text + +1. Item {MD029} + +text + +0. Item +0. Item +0. Item + +text + +1. Item {MD029} +2. Item {MD029} +3. Item {MD029} + +text + +0. Item +1. Item {MD029} +0. Item +2. Item {MD029} + +text + +0. Item +0. Item +2. Item {MD029} +0. Item + +text + +1. Item {MD029} +2. Item {MD029} +3. Item {MD029} + +text + +4. Item {MD029} +5. Item {MD029} + +text + +- Item + 0. Item + 0. Item + 0. Item +- Item + 1. Item {MD029} + 2. Item {MD029} + 3. Item {MD029} +- Item + 0. Item + 1. Item {MD029} + 2. Item {MD029} +- Item + +text + +0. Item +1. Item {MD029} +2. Item {MD029} + +text + +0. Item +1. Item {MD029} +3. Item {MD029} + + diff --git a/test/ordered_list_item_prefix-paren.md b/test/ordered_list_item_prefix-paren.md new file mode 100644 index 00000000..b4b95588 --- /dev/null +++ b/test/ordered_list_item_prefix-paren.md @@ -0,0 +1,21 @@ +# ordered_list_item_prefix-paren + +Good list: + +1) Do this. +1) Do that. +1) ??? +1) Profit! + +Bad list: + +1) Do this. +2) Do nothing. {MD029} +3) ??? {MD029} +4) Failed! {MD029} + + diff --git a/test/ordered_list_item_prefix.md b/test/ordered_list_item_prefix.md index f5ab9564..1c41f962 100644 --- a/test/ordered_list_item_prefix.md +++ b/test/ordered_list_item_prefix.md @@ -1,3 +1,5 @@ +# ordered_list_item_prefix + Good list: 1. Do this. @@ -11,3 +13,9 @@ Bad list: 2. Do nothing. {MD029} 3. ??? {MD029} 4. Failed! {MD029} + + diff --git a/test/ordered_list_item_prefix_ordered-paren.md b/test/ordered_list_item_prefix_ordered-paren.md new file mode 100644 index 00000000..4c601d79 --- /dev/null +++ b/test/ordered_list_item_prefix_ordered-paren.md @@ -0,0 +1,21 @@ +# ordered_list_item_prefix_ordered-paren + +Good list: + +1) Do this. +2) Do that. +3) ??? +4) Profit! + +Bad list: + +1) Do this. +1) Do nothing. {MD029} +1) ??? {MD029} +1) Failed! {MD029} + + diff --git a/test/ordered_list_item_prefix_ordered.json b/test/ordered_list_item_prefix_ordered.json deleted file mode 100644 index 02b6e8d2..00000000 --- a/test/ordered_list_item_prefix_ordered.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD029": { - "style": "ordered" - } -} diff --git a/test/ordered_list_item_prefix_ordered.md b/test/ordered_list_item_prefix_ordered.md index 1d9895d3..23e535de 100644 --- a/test/ordered_list_item_prefix_ordered.md +++ b/test/ordered_list_item_prefix_ordered.md @@ -1,3 +1,5 @@ +# ordered_list_item_prefix_ordered + Good list: 1. Do this. @@ -11,3 +13,9 @@ Bad list: 1. Do nothing. {MD029} 1. ??? {MD029} 1. Failed! {MD029} + + diff --git a/test/pandoc-footnotes.md b/test/pandoc-footnotes.md new file mode 100644 index 00000000..04fc5e07 --- /dev/null +++ b/test/pandoc-footnotes.md @@ -0,0 +1,47 @@ +# Pandoc Footnotes + +> Examples taken from [GitHub issue 599](https://github.com/DavidAnson/markdownlint/issues/599) + +## Example with Pandoc Footnotes + +A sentence with footnotes: [^1] [^2] +A sentence with named footnotes: [^name] [^name2] +A sentence with a link reference: [Pandoc's User Guide][Pandoc1] + +[^1]: I am a footnote! +[^2]: I reference a [PCW][PCW1] article! +[^name]: I am a footnote with name! +[^name2]: I am also a named footnote! I also reference the [PCW][PCW1] article! + +[PCW1]: https://www.example.com/article.html +[Pandoc1]: https://pandoc.org/MANUAL.html#extension-footnotes + +## Example with Long Pandoc Footnotes + +A sentence with a long footnotes: [^long] [^longer] [^longest] + +[^long]: I am a long footnote! + I don't do any harm :) +[^longer]: I am a longer footnote. I do reference the [PCW][PCW2] article. + I do harm. Though, not here: [Pandoc's User Guide][Pandoc2] +[^longest]: I am the longest footnote. I also reference the [PCW][PCW2] article. + + I am a harmful new block of text: [Another][Another2] + +> The previous line of text is treated by CommonMark as an indented code block. +> To handle it as a Pandoc footnote, consider the `markdown-it-footnote` plugin. + +[PCW2]: https://www.example.com/article.html +[Pandoc2]: https://pandoc.org/MANUAL.html#extension-footnotes +[Another2]: https://www.example.com/another.html + +## GitHub Footnotes + +Sample footnotes [^3] [^note3] + +[^3]: A line + A new line + +[^note3]: + I am a new block of text + With a new line as well diff --git a/test/parse-configuration-test.mjs b/test/parse-configuration-test.mjs new file mode 100644 index 00000000..b4cbffe6 --- /dev/null +++ b/test/parse-configuration-test.mjs @@ -0,0 +1,110 @@ +// @ts-check + +import test from "ava"; +import parseConfiguration from "../lib/parse-configuration.mjs"; + +const testObject = { + "string": "text", + "number": 10, + "object": { + "property": "value" + }, + "array": [ 1, 2, 3 ] +}; +const successfulTestObjectResult = { + "config": testObject, + "message": null +}; +const successfulParser = () => testObject; +const failingParser = () => { + throw new Error("failingParser"); +}; + +test("json object, default parser", (t) => { + t.plan(1); + const actual = parseConfiguration("name", JSON.stringify(testObject)); + t.deepEqual(actual, successfulTestObjectResult); +}); + +test("invalid json, default parser", (t) => { + t.plan(1); + const actual = parseConfiguration("name", "{"); + const expected = { + "config": null, + "message": "Unable to parse 'name'; Parser 0: ..." + }; + // Backwards-compatibility for testing Node versions < 22 + if (actual.message) { + actual.message = actual.message.replace(/Parser 0: .*$/, "Parser 0: ..."); + } + t.deepEqual(actual, expected); +}); + +test("parser gets passed content", (t) => { + t.plan(2); + const content = "content"; + const parser = (text) => { + t.is(text, content); + return {}; + }; + const actual = parseConfiguration("name", content, [ parser ]); + const expected = { + "config": {}, + "message": null + }; + t.deepEqual(actual, expected); +}); + +test("parser returns undefined/null/number/string/array", (t) => { + t.plan(5); + const expected = { + "config": {}, + "message": null + }; + const testCases = [ undefined, null, 10, "string", [] ]; + for (const testCase of testCases) { + /** @type {import("../lib/markdownlint.mjs").ConfigurationParser} */ + const parser = + // @ts-ignore + () => testCase; + const actual = parseConfiguration("name", "content", [ parser ]); + t.deepEqual(actual, expected); + } +}); + +test("custom parsers, successful/failing", (t) => { + t.plan(1); + const actual = parseConfiguration("name", "", [ successfulParser, failingParser ]); + t.deepEqual(actual, successfulTestObjectResult); +}); + +test("custom parsers, failing/successful", (t) => { + t.plan(1); + const actual = parseConfiguration("name", "", [ failingParser, successfulParser ]); + t.deepEqual(actual, successfulTestObjectResult); +}); + +test("custom parsers, failing/successful(undefined)", (t) => { + t.plan(1); + const actual = parseConfiguration( + "name", + "", + // @ts-ignore + [ failingParser, () => undefined ] + ); + const expected = { + "config": {}, + "message": null + }; + t.deepEqual(actual, expected); +}); + +test("custom parsers, failing/failing", (t) => { + t.plan(1); + const actual = parseConfiguration("name", "", [ failingParser, failingParser ]); + const expected = { + "config": null, + "message": "Unable to parse 'name'; Parser 0: failingParser; Parser 1: failingParser" + }; + t.deepEqual(actual, expected); +}); diff --git a/test/prettier-tab-width-2-default.md b/test/prettier-tab-width-2-default.md new file mode 100644 index 00000000..d8e9aee7 --- /dev/null +++ b/test/prettier-tab-width-2-default.md @@ -0,0 +1,33 @@ +# Prettier `--tab-width=2` (Default) + +Text + +- Item + - Item + - Item + +Text + +- Item +- Item + - Item + - Item + - Item + - Item + +Text + +1. Item + 1. Item + 1. Item + +Text + +1. Item +2. Item + 1. Item + 2. Item + 1. Item + 2. Item + +Text diff --git a/test/prettier-tab-width-4.md b/test/prettier-tab-width-4.md new file mode 100644 index 00000000..e94db5a0 --- /dev/null +++ b/test/prettier-tab-width-4.md @@ -0,0 +1,45 @@ +# Prettier `--tab-width=4` + +Text + +- Item + - Item + - Item + +Text + +- Item +- Item + - Item + - Item + - Item + - Item + +Text + +1. Item + 1. Item + 1. Item + +Text + +1. Item +2. Item + 1. Item + 2. Item + 1. Item + 2. Item + +Text + + diff --git a/test/profile-fixture.mjs b/test/profile-fixture.mjs new file mode 100644 index 00000000..7a00cdcf --- /dev/null +++ b/test/profile-fixture.mjs @@ -0,0 +1,20 @@ +import { readFile } from "node:fs/promises"; +import { lint } from "markdownlint/promise"; + +const strings = { + "CHANGELOG": await readFile("CHANGELOG.md", "utf8"), + "CONTRIBUTING": await readFile("CONTRIBUTING.md", "utf8"), + "README": await readFile("README.md", "utf8"), + "CustomRules": await readFile("./doc/CustomRules.md", "utf8"), + "Prettier": await readFile("./doc/Prettier.md", "utf8"), + "Rules": await readFile("./doc/Rules.md", "utf8") +}; + +const start = new Date(); +for (let i = 0; i < 250; i++) { + // eslint-disable-next-line no-await-in-loop + await lint({ strings }); +} +const end = new Date(); +// eslint-disable-next-line no-console +console.log(`Elapsed: ${end - start}`); diff --git a/test/proper-names-alternate.md b/test/proper-names-alternate.md new file mode 100644 index 00000000..645f1c14 --- /dev/null +++ b/test/proper-names-alternate.md @@ -0,0 +1,43 @@ +# Detailed Results Proper Names + +Text Markdownlint text. {MD044} + +Text node.JS text. {MD044} + +Text .net text. {MD044} + +Text example.net text. {MD044} + +Text "Markdownlint" text. {MD044} + +Text "node.JS" text. {MD044} + +Text ".net" text. {MD044} + +Text "example.net" text. {MD044} + +Text **Markdownlint** text. {MD044} + +Text **node.JS** text. {MD044} + +Text **.net** text. {MD044} + +Text **example.net** text. {MD044} + +Markdownlint {MD044} + +node.JS {MD044} + +.net {MD044} + +example.net {MD044} + + diff --git a/test/proper-names-links.md b/test/proper-names-links.md new file mode 100644 index 00000000..46d42a62 --- /dev/null +++ b/test/proper-names-links.md @@ -0,0 +1,43 @@ +# Proper names in links + +javascript {MD044} + +Learn about JavaScript here: https://example.com/javascript/about + +Learn about JavaScript here: + +Learn about [JavaScript](https://example.com/javascript/about). + +Learn about [JavaScript](wiki/javascript/about). + +Learn about [JavaScript](wiki/javascript). + +Learn about [JavaScript](javascript/about). + +Learn about [JavaScript](javascript). + +Learn about [JavaScript][js]. + +Learn about [JavaScript][example-js]. + +Learn about [JavaScript][javascript]. + +Learn about [javascript][js]. {MD044} + +Learn about [javascript][example-js]. {MD044} + +Learn about [javascript]. {MD044} + +[js]: https://example.com/javascript/about + [example-js]: javascript + [javascript]: https://example.com/js + [javascript]: https://example.com/js {MD044} + + diff --git a/test/proper-names-no-code.md b/test/proper-names-no-code.md new file mode 100644 index 00000000..885c02d5 --- /dev/null +++ b/test/proper-names-no-code.md @@ -0,0 +1,57 @@ +# markdownlint test file + +Markdownlint is a tool {MD044} + +JavaScript is a language + +JavaScript is not Java + +Nor is it Javascript. {MD044} + +Code in `javascript` + +Execute `via the node.js engine` + + javascript is code + node.js is runtime + +```js +javascript is code {MD046:-1} +node.js is runtime +``` + +A short paragraph +about node.js and {MD044} +also javascript. {MD044} + +`javascript` + +`code +javascript` + +`code +javascript +code` + +`javascript +code` + +text JavaScript text `javascript` text JavaScript text +text `javascript` text JavaScript text `javascript` text + +text javascript text `javascript` text {MD044} +text `javascript` text javascript text {MD044} + + diff --git a/test/proper-names-no-html.md b/test/proper-names-no-html.md new file mode 100644 index 00000000..a209b94c --- /dev/null +++ b/test/proper-names-no-html.md @@ -0,0 +1,54 @@ +# Proper Names No HTML + +Okay text JavaScript. + +Bad text javascript. {MD044} + +Bad code `javascript`. {MD044} + +Description + + + +
+ + + + + +javascript {MD044} + +
javascript
{MD044} + + + + + +
+ +
+ + + + + + diff --git a/test/proper-names-non-word-boundaries.md b/test/proper-names-non-word-boundaries.md new file mode 100644 index 00000000..219fc85b --- /dev/null +++ b/test/proper-names-non-word-boundaries.md @@ -0,0 +1,23 @@ +# Proper Names Non-Word Boundaries + +Text .NET text. + +Text NET. text. + +Text .NET. text. + +Text .net text. {MD044} + +Text net. text. {MD044} + +Text .net. text. {MD044} + + diff --git a/test/proper-names-projects.md b/test/proper-names-projects.md new file mode 100644 index 00000000..46c0f6c7 --- /dev/null +++ b/test/proper-names-projects.md @@ -0,0 +1,62 @@ +# Proper Names of Projects (code_blocks:false) + +The site GitHub + +Not github {MD044} + +Link to [GitHub](https://github.com/) + +Link to [github.com](https://github.com/) + +Link to [github.com](https://github.com/about) + +Link to [github.com/about](https://github.com/about) + +The domain name of GitHub is github.com + +The project Vue + +AKA Vue.js + +Not vue {MD044} + +Or vue.js {MD044} + +The file `vue.js` (code block) + +The library Vuex + +Not vuex {MD044} + +The library vue-router + +Not Vue-router {MD044} + +But vue-router-extra is different + +As is extra-vue-router + +Quoted "Vue" and "vue-router" + +Emphasized *Vue* and *vue-router* + +Underscored _Vue_ and _vue-router_ {MD049} + +Call it npm +But not Npm {MD044} +Or NPM {MD044} + + diff --git a/test/proper-names-substrings.md b/test/proper-names-substrings.md new file mode 100644 index 00000000..fb737616 --- /dev/null +++ b/test/proper-names-substrings.md @@ -0,0 +1,15 @@ +# Proper Names as Substrings + +The proper case is: @aws-control-tower + +Similarly, aws-vault and AWS and @aws-control-tower are all correct. + + diff --git a/test/proper-names-urls.md b/test/proper-names-urls.md new file mode 100644 index 00000000..6693322c --- /dev/null +++ b/test/proper-names-urls.md @@ -0,0 +1,68 @@ +# Proper Names in URLs + +Text https text {MD044} +Text example text {MD044} +Text com text {MD044} +Text directory text {MD044} +Text file text {MD044} +Text HTTPS EXAMPLE COM DIRECTORY FILE text + +> The following lines are deliberately duplicated + +Text https://example.com/directory/file text + +Text https://example.com/directory/file text + +Text text + +Text text + +Text [https://example.com/directory/file](https://example.com/directory/file) text + +Text [https://example.com/directory/file](https://example.com/directory/file) text + +Text `https://example.com/directory/file` text +Text `https://example.com/directory/file` text + +```text +Text https://example.com/directory/file text +Text https://example.com/directory/file text +``` + + Text https://example.com/directory/file text + Text https://example.com/directory/file text + +Text https://example.com/directory/text.file text +Text https://example.com/directory/text.file text + +Text https://example.com/directory/text%20text.file text +Text https://example.com/directory/text%20text.file text + +Text text +Text text + +Text text +Text text + +Text [https://example.com/directory/text.file](https://example.com/directory/text.file) text +Text [https://example.com/directory/text.file](https://example.com/directory/text.file) text + +Text [https://example.com/directory/text%20text.file](https://example.com/directory/text%20text.file) text +Text [https://example.com/directory/text%20text.file](https://example.com/directory/text%20text.file) text + +{MD044:+2} + + diff --git a/test/proper-names.md b/test/proper-names.md new file mode 100644 index 00000000..2e1fc303 --- /dev/null +++ b/test/proper-names.md @@ -0,0 +1,139 @@ +# markdownlint test file + +Markdownlint is a tool {MD044} + +Quoted "Markdownlint" {MD044} + +Emphasized *Markdownlint* {MD044} + +JavaScript is a language + +JavaScript is not Java + +Nor is it Javascript. {MD044} + +markdownlint runs on Node.js via npm + +Node is an environment + +Install into it with NPM {MD044} + +Node.JSX is not a real thing + +Nor is nodesjs or NPMI + +npm can npm stand npm for npm many npm things + +Writing npm is right, but NPM is wrong {MD044} + +Get excited about Github! {MD044} + +Share code on GitHub via Git + +Internet Explorer is a web browser + +OTOH, "internet explorer" is a job {MD044} + +## node.js instructions {MD044} + +Code in `javascript` {MD044} + +Execute `via the node.js engine` {MD044} + +HTML javascript {MD044} + +* Use NPM {MD044} + +> Run Markdownlint on your README {MD044} + + javascript is code {MD044} + node.js is runtime {MD044} + +```javascript +javascript is code {MD044} {MD046:-1} +node.js is runtime {MD044} +``` + +Upload the code (to github) {MD044} + +Image of ![github](https://github.com/). {MD044} + +Image of ![GitHub](https://github.com/). + +Link to [github](https://github.com/). {MD044} + +Link to [GitHub](https://github.com/). + +Link to [markdownlint](https://github.com/DavidAnson/MARKDOWNLINT). + +Bare URL exempt https://github.com/DavidAnson/MARKDOWNLINT {MD034} + +A short paragraph +about node.js and {MD044} +javascript. {MD044} + +{MD044} `javascript` + +`code +javascript` {MD044} + +`code +javascript {MD044} +code` + +`javascript {MD044} +code` + +Text referencing multiplecase name. +Text referencing MultipleCase name. +Text referencing MULTIPLECASE name. {MD044} +Text referencing mULTIPLEcASE name. + +Description + + + + + + + + + + + +
+ + + + + +{MD044:-14} {MD044:-12} {MD044:-9} {MD044:-4} + + diff --git a/test/reference-links-and-images-ignored-labels-empty.md b/test/reference-links-and-images-ignored-labels-empty.md new file mode 100644 index 00000000..7339e58d --- /dev/null +++ b/test/reference-links-and-images-ignored-labels-empty.md @@ -0,0 +1,19 @@ +# Reference Links and Images (Ignored Labels Empty) + +[full][full] {MD052} + +[collapsed][] {MD052} + +[shortcut] {MD052} + +[invalid][invalid] {MD052} + +- [ ] Unchecked task list item +- [x] Checked task list item {MD052} + + diff --git a/test/reference-links-and-images-ignored-labels.md b/test/reference-links-and-images-ignored-labels.md new file mode 100644 index 00000000..3b055e83 --- /dev/null +++ b/test/reference-links-and-images-ignored-labels.md @@ -0,0 +1,23 @@ +# Reference Links and Images (Ignored Labels) + +[full][full] + +[collapsed][] + +[shortcut] + +[invalid][invalid] {MD052} + +- [ ] Unchecked task list item +- [x] Checked task list item {MD052} + + diff --git a/test/reference-links-and-images-shortcuts.md b/test/reference-links-and-images-shortcuts.md new file mode 100644 index 00000000..16126f9f --- /dev/null +++ b/test/reference-links-and-images-shortcuts.md @@ -0,0 +1,122 @@ +# Reference Links and Images (Shortcuts) + +## Shortcut Handling + +Validates the shortcut: [shortcut] + +[shortcut]: https://example.com/shortcut + +Missing reference: [missing] {MD052} + +## Valid Links + +Full reference link: [text][label] + +Collapsed reference link: [label][] + +Shortcut reference link: [label] + +Same line: [text][label] [label][] [label] + +Mixed case: [TEXT][LABEL] [LABEL][] [LABEL] + +With nested brackets: [t\[ex\]t][label] + +Shortcut inline code span: [`code`] + +Shortcut ending in colon: [colon]: + +## Invalid Links + +Missing: [missing] {MD052} + +> Missing in blockquote: [missing] {MD052} + +## Non-Links + +Code span: `[code]` + +Escaped left: \[escaped] + +Escaped right: [escaped\] + +Escaped both: \[escaped\] + +Unmatched [ in text + +Unmatched ] in text + +## Valid Images + +Full style: ![text][image0] + +Collapsed style: ![image1][] + +Shortcut style: ![image2] + +Image in link: [![text][image3]](link) [![image4][]](link) [![image5]](link) + +Image in shortcut link: [![text][image6]][unique6] [![image7][]][unique7] [![image8]][unique8] + +Wrapped in brackets: \[![text][unique9]\] + +Embedded \[in ![text][unique10] brackets\] + +## Invalid Images + +Missing: ![missing] {MD052} + +> Missing in blockquote: ![missing] {MD052} + +## Non-Images + +Escaped left: !\[escaped] + +Escaped right: ![escaped\] + +Escaped both: !\[escaped\] + +## Valid Footnotes + +Footnote[^1] + +## Invalid Footnotes + +Missing[^2] {MD052} + +## GitHub Flavored Markdown Task List Items + +- [ ] Unchecked task list item +- [x] Checked task list item + +- [x] alpha + - [ ] beta + - [x] charlie +- [ ] delta + +## Valid Labels + +[label]: https://example.com/label +[image0]: https://example.com/image0 +[image1]: https://example.com/image1 +[image2]: https://example.com/image2 +[image3]: https://example.com/image3 +[image4]: https://example.com/image4 +[image5]: https://example.com/image5 +[image6]: https://example.com/image6 +[image7]: https://example.com/image7 +[image8]: https://example.com/image8 +[`code`]: https://example.com/code +[colon]: https://example.com/colon +[unique6]: https://example.com/unique6 +[unique7]: https://example.com/unique7 +[unique8]: https://example.com/unique8 +[unique9]: https://example.com/unique9 +[unique10]: https://example.com/unique10 +[^1]: https://example.com/footnote {MD034} + + diff --git a/test/reference-links-and-images.md b/test/reference-links-and-images.md new file mode 100644 index 00000000..474ad548 --- /dev/null +++ b/test/reference-links-and-images.md @@ -0,0 +1,249 @@ +# Reference Links and Images + +## Valid Links + +Full reference link: [text][label] + +Collapsed reference link: [label][] + +Shortcut reference link: [label] + +Same line: [text][label] [label][] [label] + +Mixed case: [TEXT][LABEL] [LABEL][] [LABEL] + +With spaces: [text][label with spaces] [text][ label with spaces ] + +With nested brackets: [t[ex]t][label] + +With inline content: [*text*][label] + +With inline code span: [`code`][label] + +Shortcut inline code span: [`code`] + +Multi-line full text: [multi +line][multi line full text] + +Multi-line full label: [text][multi +line full label] + +Multi-line collapsed label: [multi +line collapsed label][] + +Multi-line shortcut label: [multi line +shortcut label] + +> Multi-line full text: [multi +> line][blockquote multi line full text] +> +> Multi-line full label: [text][blockquote multi +> line full label] +> +> Multi-line collapsed label: [blockquote multi +> line collapsed label][] +> +> Multi-line shortcut label: [blockquote multi line +> shortcut label] +> +> > Multi-line shortcut label: [blockquote blockquote +> > multi line shortcut label] + +Dedicated line: +[text][label] + +Dedicated line with trailing colon: +[text][label]: + +Shortcut ending in colon: [colon]: + +Use of multi-line label: [multi-line-label][] + +Use of link in label: [link-in-label][] + +Standard link: [text](https://example.com/standard) + +Wrapped in brackets: [[text][unique0]] [[unique1][]] [[unique2]] + +[Embedded [text][unique3] in [unique4][] brackets [unique5]] + +## Invalid Links + +Missing label: [text][missing] {MD052} + +Mixed valid/invalid: [text][label] [text][missing] {MD052} + +Missing multi-line label {MD052}: [text][missing +label] + +> Missing label in blockquote: [text][missing] {MD052} + +## Non-Links + +Space: [text] [wrong] + +Empty: [text][ ] + +Code span: `[wrong]` + +Code span: `[wrong][]` + +Code span: `[text][wrong]` + +Code span: `[[wrong]]` + +Code span: `[[wrong][]]` + +Code span: `[[text][wrong]]` + +Escaped left text: \[text][wrong] + +Escaped right text: [text\][wrong] + +Escaped left label: [text]\[wrong] + +Escaped right label: [text][wrong\] + +## Valid Images + +Full style: ![text][image0] + +Collapsed style: ![image1][] + +Shortcut style: ![image2] + +Image in link: [![text][image3]](link) [![image4][]](link) [![image5]](link) + +Image in shortcut link: [![text][image6]][unique6] [![image7][]][unique7] [![image8]][unique8] + +Wrapped in brackets: [![text][unique9]] + +Embedded [in ![text][unique10] brackets] + +## Invalid Images + +Image only: ![text][missing] {MD052} + +Image in link: [![text][missing]][label] {MD052} + +## Non-Images + +Escaped left text: !\[text][wrong] + +Escaped right text: ![text\][wrong] + +Escaped left label: ![text]\[wrong] + +Escaped right label: ![text][wrong\] + +## Valid Footnotes + +Footnote[^1] + +## Invalid Footnotes + +Missing[^2] + +## Valid Labels + +[label]: https://example.com/label +[ label with spaces ]: https://example.com/label-with-spaces +[image]:https://example.com/image +[image0]: https://example.com/image0 +[image1]: https://example.com/image1 +[image2]: https://example.com/image2 +[image3]: https://example.com/image3 +[image4]: https://example.com/image4 +[image5]: https://example.com/image5 +[image6]: https://example.com/image6 +[image7]: https://example.com/image7 +[image8]: https://example.com/image8 +[`code`]: https://example.com/code +[multi line full text]: https://example.com/multi-line-full-text +[multi line full label]: https://example.com/multi-line-full-label +[multi line collapsed label]: https://example.com/multi-line-collapsed-label +[multi line shortcut label]: https://example.com/multi-line-shortcut-label +[blockquote multi line full text]: https://example.com/blockquote-multi-line-full-text +[blockquote multi line full label]: https://example.com/blockquote-multi-line-full-label +[blockquote multi line collapsed label]: https://example.com/blockquote-multi-line-collapsed-label +[blockquote multi line shortcut label]: https://example.com/blockquote-multi-line-shortcut-label +[blockquote blockquote multi line shortcut label]: https://example.com/blockquote-blockquote-multi-line-shortcut-label +[colon]: https://example.com/colon +[multi-line-label]: +https://example.com/multi-line-label +[link-in-label]: https://example.com/path?[brackets][] +[unique0]: https://example.com/unique0 +[unique1]: https://example.com/unique1 +[unique2]: https://example.com/unique2 +[unique3]: https://example.com/unique3 +[unique4]: https://example.com/unique4 +[unique5]: https://example.com/unique5 +[unique6]: https://example.com/unique6 +[unique7]: https://example.com/unique7 +[unique8]: https://example.com/unique8 +[unique9]: https://example.com/unique9 +[unique10]: https://example.com/unique10 +[^1]: https://example.com/footnote {MD034} + +## Ignored Labels + +[//]: # (This is a technique for putting comments in Markdown) + +[//]: <> (Here is another variant) + +## Invalid Labels + +Duplicate/unused: + +[label]: {MD053} +[blank-line-filler-0]: https://example.com +[unused]: {MD053} +[blank-line-filler-1]: https://example.com +[^3]: {MD053} + +[blank-line-filler-0][] [blank-line-filler-1][] + +[Duplicate unused multi-line label {MD053}]: +https://example.com/duplicate-unused-multi-line-label + +[Duplicate unused multi-line label {MD053}]: +https://example.com/duplicate-unused-multi-line-label + +\[Escaped left]: text + +[Escaped right\]: text + +## Valid Links and Images after Labels + +Link and image: [text][label] [![text][image]][label] + +## More Invalid Links and Images after Labels + +Bad link with image [![text][image]][missing] {MD052} + +## Shortcut One-Way Handling + +Validates the label: [shortcut] + +[shortcut]: https://example.com/shortcut + +Not flagged due to ambiguity: [ignored] + +## Open Bracket Pairs + +Unmatched [ in text + +Hidden reference: [hidden][] {MD052} + +## Link references inside reference definitions + +Text with a [^footnote] in it + +[^footnote]: Footnote with an [embedded-reference][] in it + +[embedded-reference]: https://example.com/embedded-reference + +## GitHub Flavored Markdown Task List Items + +- [ ] Unchecked task list item +- [x] Checked task list item diff --git a/test/reference-links-ignored-definitions-empty.md b/test/reference-links-ignored-definitions-empty.md new file mode 100644 index 00000000..6dc4278c --- /dev/null +++ b/test/reference-links-ignored-definitions-empty.md @@ -0,0 +1,13 @@ +# Reference Links Ignored Definitions (Empty) + +Used reference link: [label] + +[label]: https://example.com/label +[oops]: https://example.com/{MD053} +[//]: <> ({MD053}) + + diff --git a/test/reference-links-ignored-definitions.md b/test/reference-links-ignored-definitions.md new file mode 100644 index 00000000..ef063faf --- /dev/null +++ b/test/reference-links-ignored-definitions.md @@ -0,0 +1,17 @@ +# Reference Links Ignored Definitions + +Used reference link: [label] + +[label]: https://example.com/label +[oops]: https://example.com/{MD053} +[okay]: https://example.com/ignored +[yep]: https://example.com/ignored + + diff --git a/test/required-headings-all-optional-at-least-one.md b/test/required-headings-all-optional-at-least-one.md new file mode 100644 index 00000000..432abab1 --- /dev/null +++ b/test/required-headings-all-optional-at-least-one.md @@ -0,0 +1,19 @@ +# One + +## Two + +### THREE + +#### four + +##### Five + +###### SiX + + diff --git a/test/required-headings-all-optional.md b/test/required-headings-all-optional.md new file mode 100644 index 00000000..b22243c3 --- /dev/null +++ b/test/required-headings-all-optional.md @@ -0,0 +1,19 @@ +# One + +## Two + +### THREE + +#### four + +##### Five + +###### SiX + + diff --git a/test/required-headings-all-present.md b/test/required-headings-all-present.md new file mode 100644 index 00000000..a476bd3f --- /dev/null +++ b/test/required-headings-all-present.md @@ -0,0 +1,24 @@ +# One + +## Two + +### THREE + +## four + +## Five + +### SiX + + diff --git a/test/required-headings-match-case.md b/test/required-headings-match-case.md new file mode 100644 index 00000000..10b138d1 --- /dev/null +++ b/test/required-headings-match-case.md @@ -0,0 +1,22 @@ +# Title + +## First Heading + +## Second Heading + +### Random heading + +## Third Heading + + diff --git a/test/required-headings-missing-first.md b/test/required-headings-missing-first.md new file mode 100644 index 00000000..c5437eb5 --- /dev/null +++ b/test/required-headings-missing-first.md @@ -0,0 +1,16 @@ +text + +## Two {MD043} + +### Three + + diff --git a/test/required-headings-missing-last-zero-or-more.md b/test/required-headings-missing-last-zero-or-more.md new file mode 100644 index 00000000..3ad28696 --- /dev/null +++ b/test/required-headings-missing-last-zero-or-more.md @@ -0,0 +1,29 @@ +# One + +## Two + +### THREE + +## four + +## Five + +### SiX + +#### FOO + +{MD043:30} + + diff --git a/test/required-headings-missing-last.md b/test/required-headings-missing-last.md new file mode 100644 index 00000000..4080d426 --- /dev/null +++ b/test/required-headings-missing-last.md @@ -0,0 +1,17 @@ +One +=== + +Two +--- + + + +{MD043} {MD047} \ No newline at end of file diff --git a/test/required-headings-missing-middle-zero-or-more.md b/test/required-headings-missing-middle-zero-or-more.md new file mode 100644 index 00000000..a9a0e673 --- /dev/null +++ b/test/required-headings-missing-middle-zero-or-more.md @@ -0,0 +1,29 @@ +# One + +## Two + +### THREE + +## four + +## Five + +### SiX + +#### 7 + +{MD043:30} + + diff --git a/test/required-headings-missing-middle.md b/test/required-headings-missing-middle.md new file mode 100644 index 00000000..6654052f --- /dev/null +++ b/test/required-headings-missing-middle.md @@ -0,0 +1,16 @@ +# One # + +### Three {MD001} {MD043} ### + +#### Four #### + + diff --git a/test/required-headings-none-one-or-more.md b/test/required-headings-none-one-or-more.md new file mode 100644 index 00000000..7e6752c0 --- /dev/null +++ b/test/required-headings-none-one-or-more.md @@ -0,0 +1,14 @@ +Text + +Text + +{MD043:15} + + diff --git a/test/required-headings-none-zero-or-more.md b/test/required-headings-none-zero-or-more.md new file mode 100644 index 00000000..f535d2f2 --- /dev/null +++ b/test/required-headings-none-zero-or-more.md @@ -0,0 +1,14 @@ +Text + +Text + +Text + + diff --git a/test/required-headings-none.md b/test/required-headings-none.md new file mode 100644 index 00000000..68b393bd --- /dev/null +++ b/test/required-headings-none.md @@ -0,0 +1,11 @@ +# One {MD043} + +## Two + +### Three + + diff --git a/test/required-headings-one-or-more.md b/test/required-headings-one-or-more.md new file mode 100644 index 00000000..26e60a83 --- /dev/null +++ b/test/required-headings-one-or-more.md @@ -0,0 +1,29 @@ +# One + +## Two + +### THREE + +## four + +## Five + +### SiX + +#### 7 + +{MD043:30} + + diff --git a/test/required-headings-optional-first.md b/test/required-headings-optional-first.md new file mode 100644 index 00000000..ae13ecf6 --- /dev/null +++ b/test/required-headings-optional-first.md @@ -0,0 +1,17 @@ +# One + +## Two + +### Three + +#### Four + + diff --git a/test/required-headings-optional-last.md b/test/required-headings-optional-last.md new file mode 100644 index 00000000..1af8a3fb --- /dev/null +++ b/test/required-headings-optional-last.md @@ -0,0 +1,17 @@ +# One + +## Two + +### Three + +#### Four + + diff --git a/test/required-headings-optional-middle.md b/test/required-headings-optional-middle.md new file mode 100644 index 00000000..27e9f4a9 --- /dev/null +++ b/test/required-headings-optional-middle.md @@ -0,0 +1,21 @@ +# One # + +## Two ## + +### Three ### + +#### Four #### + +##### Five ##### + + diff --git a/test/required-headings-optional-redundant.md b/test/required-headings-optional-redundant.md new file mode 100644 index 00000000..159bbf04 --- /dev/null +++ b/test/required-headings-optional-redundant.md @@ -0,0 +1,18 @@ +# One + +## Two + +### Three + +#### Four + + diff --git a/test/required-headings-question-extra.md b/test/required-headings-question-extra.md new file mode 100644 index 00000000..c7e80e6d --- /dev/null +++ b/test/required-headings-question-extra.md @@ -0,0 +1,15 @@ +# Project Name + +## Description + + + +{MD043:+1} diff --git a/test/required-headings-question-first.md b/test/required-headings-question-first.md new file mode 100644 index 00000000..750153c3 --- /dev/null +++ b/test/required-headings-question-first.md @@ -0,0 +1,15 @@ +# Project Name + +## Description + +## Examples + + diff --git a/test/required-headings-question-last.md b/test/required-headings-question-last.md new file mode 100644 index 00000000..6bd04d19 --- /dev/null +++ b/test/required-headings-question-last.md @@ -0,0 +1,15 @@ +# Project Name + +## Description + +## Examples + + diff --git a/test/required-headings-question-middle.md b/test/required-headings-question-middle.md new file mode 100644 index 00000000..4d46599c --- /dev/null +++ b/test/required-headings-question-middle.md @@ -0,0 +1,15 @@ +# Project Name + +## Description + +## Examples + + diff --git a/test/required-headings-question-missing.md b/test/required-headings-question-missing.md new file mode 100644 index 00000000..833402d6 --- /dev/null +++ b/test/required-headings-question-missing.md @@ -0,0 +1,15 @@ +# Project Name + +## Examples + + + +{MD043:+1} diff --git a/test/required-headings-wrong-match-case.md b/test/required-headings-wrong-match-case.md new file mode 100644 index 00000000..a7916c31 --- /dev/null +++ b/test/required-headings-wrong-match-case.md @@ -0,0 +1,24 @@ +# Title + +## First Heading + +## SECOND HEADING + +{MD043:5} + +### Random heading + +## Third Heading + + diff --git a/test/required-headings-zero-or-more-last.md b/test/required-headings-zero-or-more-last.md new file mode 100644 index 00000000..ebf0cb39 --- /dev/null +++ b/test/required-headings-zero-or-more-last.md @@ -0,0 +1,16 @@ +# One + +## Two + +### THREE + + diff --git a/test/required-headings-zero-or-more.md b/test/required-headings-zero-or-more.md new file mode 100644 index 00000000..17ddf09a --- /dev/null +++ b/test/required-headings-zero-or-more.md @@ -0,0 +1,27 @@ +# One + +## Two + +### THREE + +## four + +## Five + +### SiX + +#### 7 + + diff --git a/test/resolve-module-test.mjs b/test/resolve-module-test.mjs new file mode 100644 index 00000000..bc808091 --- /dev/null +++ b/test/resolve-module-test.mjs @@ -0,0 +1,147 @@ +// @ts-check + +import test from "ava"; +import path from "node:path"; +import { __dirname as getDirname } from "./esm-helpers.mjs"; +import { resolveModule, resolveModuleCustomResolve } from "../lib/resolve-module.cjs"; + +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +// eslint-disable-next-line no-underscore-dangle +const __dirname = getDirname(import.meta); + +test("built-in module", (t) => { + t.plan(1); + t.deepEqual( + resolveModule("node:fs"), + require.resolve("node:fs") + ); +}); + +test("locally-installed module", (t) => { + t.plan(1); + t.deepEqual( + resolveModule("micromark"), + require.resolve("micromark") + ); +}); + +test("absolute path to module", (t) => { + t.plan(1); + const absolute = + path.resolve( + __dirname, + "./rules/node_modules/markdownlint-rule-sample-commonjs" + ); + t.deepEqual( + resolveModule(absolute), + require.resolve(absolute) + ); +}); + +test("relative (to __dirname) path to module", (t) => { + t.plan(1); + t.deepEqual( + resolveModule( + "./rules/node_modules/markdownlint-rule-sample-module", + // __dirname is needed because require.resolve is relative to this + // file while resolveModule is relative to resolve-module.cjs + [ __dirname ] + ), + require.resolve( + "./rules/node_modules/markdownlint-rule-sample-module" + ) + ); +}); + +test("module in alternate node_modules", (t) => { + t.plan(3); + t.throws( + () => require.resolve("markdownlint-rule-sample-commonjs"), + { "code": "MODULE_NOT_FOUND" } + ); + t.throws( + () => resolveModule("markdownlint-rule-sample-commonjs"), + { "code": "MODULE_NOT_FOUND" } + ); + t.deepEqual( + resolveModule( + "markdownlint-rule-sample-commonjs", + [ path.join(__dirname, "rules") ] + ), + require.resolve( + "markdownlint-rule-sample-commonjs", + { "paths": [ path.join(__dirname, "rules") ] } + ) + ); +}); + +test("module local, relative, and in alternate node_modules (same paths)", (t) => { + t.plan(3); + const paths = [ + __dirname, + path.join(__dirname, "rules") + ]; + t.deepEqual( + resolveModule( + "micromark", + paths + ), + require.resolve( + "micromark", + { paths } + ) + ); + t.deepEqual( + resolveModule( + "./rules/node_modules/markdownlint-rule-sample-commonjs", + paths + ), + require.resolve( + "./rules/node_modules/markdownlint-rule-sample-commonjs", + { paths } + ) + ); + t.deepEqual( + resolveModule( + "markdownlint-rule-sample-commonjs", + paths + ), + require.resolve( + "markdownlint-rule-sample-commonjs", + { paths } + ) + ); +}); + +test("custom resolve implementation", (t) => { + t.plan(1); + const expected = + require.resolve("./rules/node_modules/markdownlint-rule-sample-module"); + const customResolve = (id, options) => require.resolve(id, options); + customResolve.paths = (request) => require.resolve.paths(request); + t.deepEqual( + resolveModuleCustomResolve( + customResolve, + "./rules/node_modules/markdownlint-rule-sample-module", + [ __dirname ] + ), + expected + ); +}); + +test("custom resolve implementation, missing paths", (t) => { + t.plan(1); + const expected = + require.resolve("./rules/node_modules/markdownlint-rule-sample-commonjs"); + const customResolve = (id, options) => require.resolve(id, options); + t.deepEqual( + resolveModuleCustomResolve( + // @ts-ignore + customResolve, + "./rules/node_modules/markdownlint-rule-sample-commonjs", + [ __dirname ] + ), + expected + ); +}); diff --git a/test/reversed-link-issue-with-markdownlint-12.md b/test/reversed-link-issue-with-markdownlint-12.md new file mode 100644 index 00000000..19a93cc4 --- /dev/null +++ b/test/reversed-link-issue-with-markdownlint-12.md @@ -0,0 +1,9 @@ +# reversed-link-issue-with-markdownlint-12 + +|Pattern|Description| +|-------------|-----------------| +|`(?:\["'\](?<1>\[^"'\]*)["']|(?<1>\S+))`|{MD011}{MD056}| + +|Pattern|Description| +|-------------|-----------------| +|`(?:\["'\](?<1>\[^"'\]*)["']\|(?<1>\S+))`|...| diff --git a/test/reversed_link.md b/test/reversed_link.md index 7184ecbe..dedd34b6 100644 --- a/test/reversed_link.md +++ b/test/reversed_link.md @@ -1,7 +1,92 @@ -Go to (this website)[http://www.example.com] {MD011} {MD034} +# reversed_link + +Go to [this website](https://www.example.com) + +Go to (this website)[https://www.example.com] {MD011} + +Go to (this)[website](https://www.example.com) However, this shouldn't trigger inside code blocks: myObj.getFiles("test")[0] +Nor code fences: + +```js +myObj.getFiles(test)[0]; +``` + Nor inline code: `myobj.getFiles("test")[0]` + +Two (issues)[https://www.example.com/one] in {MD011} +the (same text)[https://www.example.com/two]. {MD011} + +Two (issues)[https://www.example.com/three] on the (same line)[https://www.example.com/four]. {MD011} + +`code code +code` +(reversed)[link] {MD011} + +text +text `code +code code +code` text +text +text (reversed)[link] text {MD011} + +## Escaped JavaScript Content + +var IDENT_RE = '([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*'; {MD011} + +begin: /\B(([\/.])[\w\-.\/=]+)+/, {MD011} + +{begin: '%r\\(', end: '\\)[a-z]*'} + +return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str); {MD011} + +## Escaped Parens + +(reversed)[link] + +a ) a ( a )[a]~ + +a
) a ( a )[a]~
+ +## Backslash Escapes + +xxx(xxx)[xxx] {MD011} + +xxx\(xxx)[xxx] + +xxx(xxx\)[xxx] + +xxx(xxx)\[xxx] + +xxx(xxx)[xxx\] + +## Consecutive Links + +text [link](destination) text [link](destination) text +text [link](destination)[link](destination) text +text [link](destination)[link](destination)[link](destination) text + +text (reversed)[link] text (reversed)[link] text {MD011} + +## Nested Parens + +Text (text `func()[index]`) text + +Text (text(reversed)[link] text {MD011} + +## Empty Content + +Text ()[text] text + +Text (text()[text] text + + diff --git a/test/rules/any-blockquote.cjs b/test/rules/any-blockquote.cjs new file mode 100644 index 00000000..5e4f5f1b --- /dev/null +++ b/test/rules/any-blockquote.cjs @@ -0,0 +1,55 @@ +// @ts-check + +"use strict"; + +/** @type {import("markdownlint").Rule[]} */ +module.exports = [ + + // micromark parser (preferred) + { + "names": [ "any-blockquote-micromark" ], + "description": "Rule that reports an error for any blockquote", + "information": new URL( + "https://github.com/DavidAnson/markdownlint/blob/main/test/rules/any-blockquote.js" + ), + "tags": [ "test" ], + "parser": "micromark", + "function": (params, onError) => { + const blockquotes = params.parsers.micromark.tokens + .filter((token) => token.type === "blockQuote"); + for (const blockquote of blockquotes) { + const lines = blockquote.endLine - blockquote.startLine + 1; + onError({ + "lineNumber": blockquote.startLine, + "detail": "Blockquote spans " + lines + " line(s).", + "context": params.lines[blockquote.startLine - 1] + }); + } + } + }, + + // markdown-it parser (legacy) + { + "names": [ "any-blockquote-markdown-it" ], + "description": "Rule that reports an error for any blockquote", + "information": new URL( + "https://github.com/DavidAnson/markdownlint/blob/main/test/rules/any-blockquote.js" + ), + "tags": [ "test" ], + "parser": "markdownit", + "function": (params, onError) => { + const blockquotes = params.parsers.markdownit.tokens + .filter((token) => token.type === "blockquote_open"); + for (const blockquote of blockquotes) { + const [ startIndex, endIndex ] = blockquote.map; + const lines = endIndex - startIndex; + onError({ + "lineNumber": blockquote.lineNumber, + "detail": "Blockquote spans " + lines + " line(s).", + "context": blockquote.line + }); + } + } + } + +]; diff --git a/test/rules/every-n-lines.cjs b/test/rules/every-n-lines.cjs new file mode 100644 index 00000000..e44ce3ba --- /dev/null +++ b/test/rules/every-n-lines.cjs @@ -0,0 +1,20 @@ +// @ts-check + +"use strict"; + +/** @type {import("markdownlint").Rule} */ +module.exports = { + "names": [ "every-n-lines" ], + "description": "Rule that reports an error every N lines", + "tags": [ "test" ], + "parser": "none", + "function": (params, onError) => { + const n = params.config.n || 2; + for (let lineNumber = n; lineNumber <= params.lines.length; lineNumber += n) { + onError({ + "lineNumber": lineNumber, + "detail": "Line number " + lineNumber + }); + } + } +}; diff --git a/test/rules/first-line.cjs b/test/rules/first-line.cjs new file mode 100644 index 00000000..56e536c1 --- /dev/null +++ b/test/rules/first-line.cjs @@ -0,0 +1,17 @@ +// @ts-check + +"use strict"; + +/** @type {import("markdownlint").Rule} */ +module.exports = { + "names": [ "first-line" ], + "description": "Rule that reports an error for the first line", + "tags": [ "test" ], + "parser": "none", + "function": function rule(params, onError) { + // Unconditionally report an error for line 1 + onError({ + "lineNumber": 1 + }); + } +}; diff --git a/test/rules/letters-E-X.cjs b/test/rules/letters-E-X.cjs new file mode 100644 index 00000000..c9023340 --- /dev/null +++ b/test/rules/letters-E-X.cjs @@ -0,0 +1,32 @@ +// @ts-check + +"use strict"; + +/** @type {import("markdownlint").Rule} */ +module.exports = { + "names": [ "letters-E-X", "letter-E-letter-X", "contains-ex" ], + "description": "Rule that reports an error for lines with the letters 'EX'", + "information": new URL( + "https://github.com/DavidAnson/markdownlint" + + "/blob/main/test/rules/letters-E-X.js" + ), + "tags": [ "test" ], + "parser": "markdownit", + "function": (params, onError) => { + for (const inline of params.parsers.markdownit.tokens.filter( + (token) => token.type === "inline" + )) { + for (const text of inline.children.filter( + (child) => child.type === "text" + )) { + const index = text.content.toLowerCase().indexOf("ex"); + if (index !== -1) { + onError({ + "lineNumber": text.lineNumber, + "context": text.content.substr(index - 1, 4) + }); + } + } + } + } +}; diff --git a/test/rules/lint-javascript.cjs b/test/rules/lint-javascript.cjs new file mode 100644 index 00000000..d9ae1a52 --- /dev/null +++ b/test/rules/lint-javascript.cjs @@ -0,0 +1,36 @@ +// @ts-check + +"use strict"; + +const js = require("@eslint/js"); +const eslint = require("eslint"); +const linter = new eslint.Linter(); +const languageJavaScript = /js|javascript/i; + +/** @type {import("markdownlint").Rule} */ +module.exports = { + "names": [ "lint-javascript" ], + "description": "Rule that lints JavaScript code", + "tags": [ "test", "lint", "javascript" ], + "parser": "markdownit", + "function": (params, onError) => { + const fences = params.parsers.markdownit.tokens + .filter((token) => token.type === "fence"); + for (const fence of fences) { + if (languageJavaScript.test(fence.info)) { + const results = linter.verify(fence.content, js.configs.recommended); + for (const result of results) { + const lineNumber = fence.lineNumber + result.line; + onError({ + "lineNumber": lineNumber, + "detail": result.message, + "context": params.lines[lineNumber - 1] + }); + } + } + } + // Unsupported by this sample: + // "code_block": language unknown + // "code_inline": too brief + } +}; diff --git a/test/rules/node_modules/markdownlint-rule-sample-commonjs/package.json b/test/rules/node_modules/markdownlint-rule-sample-commonjs/package.json new file mode 100644 index 00000000..2af87edf --- /dev/null +++ b/test/rules/node_modules/markdownlint-rule-sample-commonjs/package.json @@ -0,0 +1,14 @@ +{ + "name": "markdownlint-rule-sample-commonjs", + "version": "0.0.1", + "description": "Package for markdownlint custom rule sample (commonjs)", + "main": "sample-rule.cjs", + "type": "commonjs", + "author": "David Anson (https://dlaa.me/)", + "homepage": "https://github.com/DavidAnson/markdownlint", + "license": "MIT", + "keywords": [ + "markdownlint-rule" + ], + "private": true +} diff --git a/test/rules/node_modules/markdownlint-rule-sample-commonjs/sample-rule.cjs b/test/rules/node_modules/markdownlint-rule-sample-commonjs/sample-rule.cjs new file mode 100644 index 00000000..7ab665f4 --- /dev/null +++ b/test/rules/node_modules/markdownlint-rule-sample-commonjs/sample-rule.cjs @@ -0,0 +1,18 @@ +// @ts-check + +"use strict"; + +module.exports = { + "names": [ "sample-rule-commonjs" ], + "description": "Sample rule (commonjs)", + "tags": [ "sample" ], + "function": (params, onError) => { + const hrTokens = params.tokens.filter((token) => token.type === "hr"); + for (const token of hrTokens) { + onError({ + "lineNumber": token.lineNumber, + "detail": "Sample error for hr" + }); + } + } +}; diff --git a/test/rules/node_modules/markdownlint-rule-sample-module/package.json b/test/rules/node_modules/markdownlint-rule-sample-module/package.json new file mode 100644 index 00000000..ccb3eff7 --- /dev/null +++ b/test/rules/node_modules/markdownlint-rule-sample-module/package.json @@ -0,0 +1,14 @@ +{ + "name": "markdownlint-rule-sample-module", + "version": "0.0.1", + "description": "Package for markdownlint custom rule sample (module)", + "main": "sample-rule.mjs", + "type": "module", + "author": "David Anson (https://dlaa.me/)", + "homepage": "https://github.com/DavidAnson/markdownlint", + "license": "MIT", + "keywords": [ + "markdownlint-rule" + ], + "private": true +} diff --git a/test/rules/node_modules/markdownlint-rule-sample-module/sample-rule.mjs b/test/rules/node_modules/markdownlint-rule-sample-module/sample-rule.mjs new file mode 100644 index 00000000..32aeeab1 --- /dev/null +++ b/test/rules/node_modules/markdownlint-rule-sample-module/sample-rule.mjs @@ -0,0 +1,18 @@ +// @ts-check + +const rule = { + "names": [ "sample-rule-module" ], + "description": "Sample rule (module)", + "tags": [ "sample" ], + "function": (params, onError) => { + const hrTokens = params.tokens.filter((token) => token.type === "hr"); + for (const token of hrTokens) { + onError({ + "lineNumber": token.lineNumber, + "detail": "Sample error for hr" + }); + } + } +}; + +export default rule; diff --git a/test/rules/npm/package.json b/test/rules/npm/package.json new file mode 100644 index 00000000..d7a764ea --- /dev/null +++ b/test/rules/npm/package.json @@ -0,0 +1,14 @@ +{ + "name": "markdownlint-rule-sample", + "version": "0.0.1", + "description": "Package for markdownlint custom rule sample", + "type": "commonjs", + "main": "sample-rule.js", + "author": "David Anson (https://dlaa.me/)", + "homepage": "https://github.com/DavidAnson/markdownlint", + "license": "MIT", + "keywords": [ + "markdownlint-rule" + ], + "private": true +} diff --git a/test/rules/npm/sample-rule.js b/test/rules/npm/sample-rule.js new file mode 100644 index 00000000..f15bd322 --- /dev/null +++ b/test/rules/npm/sample-rule.js @@ -0,0 +1,21 @@ +// @ts-check + +"use strict"; + +/** @type {import("../../../lib/markdownlint.mjs").Rule} */ +module.exports = { + "names": [ "sample-rule" ], + "description": "Sample rule", + "tags": [ "sample" ], + "parser": "markdownit", + "function": function rule(params, onError) { + for (const token of params.parsers.markdownit.tokens) { + if (token.type === "hr") { + onError({ + "lineNumber": token.lineNumber, + "detail": "Sample error for hr" + }); + } + } + } +}; diff --git a/test/rules/rules.cjs b/test/rules/rules.cjs new file mode 100644 index 00000000..b344b63b --- /dev/null +++ b/test/rules/rules.cjs @@ -0,0 +1,30 @@ +// @ts-check + +"use strict"; + +const anyBlockquote = require("./any-blockquote.cjs"); +module.exports.anyBlockquote = anyBlockquote[1]; + +const everyNLines = require("./every-n-lines.cjs"); +module.exports.everyNLines = everyNLines; + +const firstLine = require("./first-line.cjs"); +module.exports.firstLine = firstLine; + +const lettersEX = require("./letters-E-X.cjs"); +module.exports.lettersEX = lettersEX; + +const lintJavaScript = require("./lint-javascript.cjs"); +module.exports.lintJavaScript = lintJavaScript; + +const validateJson = require("./validate-json.cjs"); +module.exports.validateJson = validateJson; + +module.exports.all = [ + ...anyBlockquote, + everyNLines, + firstLine, + lettersEX, + lintJavaScript, + validateJson +]; diff --git a/test/rules/validate-json.cjs b/test/rules/validate-json.cjs new file mode 100644 index 00000000..9dd1c668 --- /dev/null +++ b/test/rules/validate-json.cjs @@ -0,0 +1,34 @@ +// @ts-check + +"use strict"; + +const { parse, printParseErrorCode } = require("jsonc-parser"); + +/** @type {import("markdownlint").Rule} */ +module.exports = { + "names": [ "validate-json" ], + "description": "Rule that validates JSON code", + "tags": [ "test", "validate", "json" ], + "parser": "markdownit", + "asynchronous": true, + "function": (params, onError) => { + const fences = params.parsers.markdownit.tokens + .filter((token) => token.type === "fence"); + for (const fence of fences) { + if (/jsonc?/i.test(fence.info)) { + const errors = []; + parse(fence.content, errors); + if (errors.length > 0) { + const detail = errors.map( + (err) => `${printParseErrorCode(err.error)} (offset ${err.offset}, length ${err.length})` + ).join(", "); + onError({ + // @ts-ignore + "lineNumber": fence.lineNumber, + detail + }); + } + } + } + } +}; diff --git a/test/short-headings.md b/test/short-headings.md new file mode 100644 index 00000000..94578762 --- /dev/null +++ b/test/short-headings.md @@ -0,0 +1,83 @@ +# Short Headings + + + +#A + +{MD018:5} + +# B + +# C + +{MD019:11} + +#D# + +{MD020:15} + +# E # + +# F # + +{MD021:21} + +##G + +{MD018:25} + +## H + +## I + +{MD019:31} + +##J## + +{MD020:35} + +## K ## + +## L ## + +{MD021:41} + +#MM + +{MD018:45} + +# NN + +# OO + +{MD019:51} + +#PP# + +{MD020:55} + +# QQ # + +# RR # + +{MD021:61} + +##SS + +{MD018:65} + +## TT + +## UU + +{MD019:71} + +##VV## + +{MD020:75} + +## WW ## + +## XX ## + +{MD021:81} diff --git a/test/simple-table.md b/test/simple-table.md new file mode 100644 index 00000000..1068bf7e --- /dev/null +++ b/test/simple-table.md @@ -0,0 +1,7 @@ +# Heading + +| Head | +| ---- | +| Cell | +| ==== | +| Foot | diff --git a/test/snapshots/markdownlint-test-custom-rules.mjs.md b/test/snapshots/markdownlint-test-custom-rules.mjs.md new file mode 100644 index 00000000..3c7c8522 --- /dev/null +++ b/test/snapshots/markdownlint-test-custom-rules.mjs.md @@ -0,0 +1,6604 @@ +# Snapshot report for `test/markdownlint-test-custom-rules.mjs` + +The actual snapshot is saved in `markdownlint-test-custom-rules.mjs.snap`. + +Generated by [AVA](https://avajs.dev). + +## customRulesMarkdownItTokensSnapshot + +> Unexpected tokens + + [ + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Every Markdown Syntax', + lineNumber: 1, + map: [ + 0, + 2, + ], + markup: '=', + meta: null, + nesting: 1, + tag: 'h1', + type: 'heading_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Every Markdown Syntax', + hidden: false, + info: '', + level: 0, + line: 'Every Markdown Syntax', + lineNumber: 1, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Every Markdown Syntax', + hidden: false, + info: '', + level: 1, + line: 'Every Markdown Syntax', + lineNumber: 1, + map: [ + 0, + 1, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '=', + meta: null, + nesting: -1, + tag: 'h1', + type: 'heading_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: '## Level 2 ATX Heading', + lineNumber: 4, + map: [ + 3, + 4, + ], + markup: '##', + meta: null, + nesting: 1, + tag: 'h2', + type: 'heading_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Level 2 ATX Heading', + hidden: false, + info: '', + level: 0, + line: '## Level 2 ATX Heading', + lineNumber: 4, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Level 2 ATX Heading', + hidden: false, + info: '', + level: 1, + line: '## Level 2 ATX Heading', + lineNumber: 4, + map: [ + 3, + 4, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '##', + meta: null, + nesting: -1, + tag: 'h2', + type: 'heading_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: '### Level 3 Closed ATX Heading ###', + lineNumber: 6, + map: [ + 5, + 6, + ], + markup: '###', + meta: null, + nesting: 1, + tag: 'h3', + type: 'heading_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Level 3 Closed ATX Heading', + hidden: false, + info: '', + level: 0, + line: '### Level 3 Closed ATX Heading ###', + lineNumber: 6, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Level 3 Closed ATX Heading', + hidden: false, + info: '', + level: 1, + line: '### Level 3 Closed ATX Heading ###', + lineNumber: 6, + map: [ + 5, + 6, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '###', + meta: null, + nesting: -1, + tag: 'h3', + type: 'heading_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: '---', + lineNumber: 8, + map: [ + 7, + 8, + ], + markup: '---', + meta: null, + nesting: 0, + tag: 'hr', + type: 'hr', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: [ + 9, + 13, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Text ', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '*', + meta: null, + nesting: 1, + tag: 'em', + type: 'em_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'emphasized', + hidden: false, + info: '', + level: 1, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '*', + meta: null, + nesting: -1, + tag: 'em', + type: 'em_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: ' ', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '**', + meta: null, + nesting: 1, + tag: 'strong', + type: 'strong_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'strong', + hidden: false, + info: '', + level: 1, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '**', + meta: null, + nesting: -1, + tag: 'strong', + type: 'strong_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: ' ', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '_', + meta: null, + nesting: 1, + tag: 'em', + type: 'em_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '__', + meta: null, + nesting: 1, + tag: 'strong', + type: 'strong_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'emphasized+strong', + hidden: false, + info: '', + level: 2, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '__', + meta: null, + nesting: -1, + tag: 'strong', + type: 'strong_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '_', + meta: null, + nesting: -1, + tag: 'em', + type: 'em_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: '.', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: 'br', + type: 'softbreak', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'Text ', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'code', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '`', + meta: null, + nesting: 0, + tag: 'code', + type: 'code_inline', + }, + Token { + attrs: null, + block: false, + children: null, + content: ' ', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'html_inline', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'html', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'html_inline', + }, + Token { + attrs: null, + block: false, + children: null, + content: ' ', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: [ + [ + 'href', + 'https://example.com/page', + ], + ], + block: false, + children: null, + content: '', + hidden: false, + info: 'auto', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: 'autolink', + meta: null, + nesting: 1, + tag: 'a', + type: 'link_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'https://example.com/page', + hidden: false, + info: '', + level: 1, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: 'auto', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: 'autolink', + meta: null, + nesting: -1, + tag: 'a', + type: 'link_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: '.', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text `code` html .', + lineNumber: 11, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: 'br', + type: 'softbreak', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'Text ', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: [ + [ + 'href', + 'https://example.com/page', + ], + ], + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 1, + tag: 'a', + type: 'link_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'link', + hidden: false, + info: '', + level: 1, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'a', + type: 'link_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: ' ', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: [ + [ + 'href', + 'https://example.com/page', + ], + [ + 'title', + 'Title', + ], + ], + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 1, + tag: 'a', + type: 'link_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'link', + hidden: false, + info: '', + level: 1, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'a', + type: 'link_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: ' ', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: [ + [ + 'href', + 'https://example.com/page', + ], + [ + 'title', + 'Title', + ], + ], + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 1, + tag: 'a', + type: 'link_open', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'link', + hidden: false, + info: '', + level: 1, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'a', + type: 'link_close', + }, + Token { + attrs: null, + block: false, + children: null, + content: ' ', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: [ + [ + 'src', + 'https://example.com/page', + ], + [ + 'alt', + '', + ], + [ + 'title', + 'Title', + ], + ], + block: false, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'image', + hidden: false, + info: '', + level: 0, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'image', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: 'img', + type: 'image', + }, + Token { + attrs: null, + block: false, + children: null, + content: '.', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Text [link](https://example.com/page) [link][] [link] ![image][link].', + lineNumber: 12, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: 'br', + type: 'softbreak', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'Text https://example.com/page.', + hidden: false, + info: '', + level: 0, + line: 'Text https://example.com/page.', + lineNumber: 13, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: `Text *emphasized* **strong** ___emphasized+strong___.␊ + Text \`code\` html .␊ + Text [link](https://example.com/page) [link][] [link] ![image][link].␊ + Text https://example.com/page.`, + hidden: false, + info: '', + level: 1, + line: 'Text *emphasized* **strong** ___emphasized+strong___.', + lineNumber: 10, + map: [ + 9, + 13, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Hard ', + lineNumber: 15, + map: [ + 14, + 16, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Hard', + hidden: false, + info: '', + level: 0, + line: 'Hard ', + lineNumber: 15, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: 'Hard ', + lineNumber: 15, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: 'br', + type: 'hardbreak', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'line break', + hidden: false, + info: '', + level: 0, + line: 'line break', + lineNumber: 16, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: `Hard ␊ + line break`, + hidden: false, + info: '', + level: 1, + line: 'Hard ', + lineNumber: 15, + map: [ + 14, + 16, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: '> Block quote', + lineNumber: 20, + map: [ + 19, + 21, + ], + markup: '>', + meta: null, + nesting: 1, + tag: 'blockquote', + type: 'blockquote_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: '> Block quote', + lineNumber: 20, + map: [ + 19, + 20, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Block quote', + hidden: false, + info: '', + level: 0, + line: '> Block quote', + lineNumber: 20, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Block quote', + hidden: false, + info: '', + level: 2, + line: '> Block quote', + lineNumber: 20, + map: [ + 19, + 20, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: '> > Nested', + lineNumber: 21, + map: [ + 20, + 21, + ], + markup: '>', + meta: null, + nesting: 1, + tag: 'blockquote', + type: 'blockquote_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + line: '> > Nested', + lineNumber: 21, + map: [ + 20, + 21, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Nested', + hidden: false, + info: '', + level: 0, + line: '> > Nested', + lineNumber: 21, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Nested', + hidden: false, + info: '', + level: 3, + line: '> > Nested', + lineNumber: 21, + map: [ + 20, + 21, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '>', + meta: null, + nesting: -1, + tag: 'blockquote', + type: 'blockquote_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '>', + meta: null, + nesting: -1, + tag: 'blockquote', + type: 'blockquote_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: '- Unordered', + lineNumber: 23, + map: [ + 22, + 28, + ], + markup: '-', + meta: null, + nesting: 1, + tag: 'ul', + type: 'bullet_list_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: '- Unordered', + lineNumber: 23, + map: [ + 22, + 23, + ], + markup: '-', + meta: null, + nesting: 1, + tag: 'li', + type: 'list_item_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + line: '- Unordered', + lineNumber: 23, + map: [ + 22, + 23, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Unordered', + hidden: false, + info: '', + level: 0, + line: '- Unordered', + lineNumber: 23, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Unordered', + hidden: false, + info: '', + level: 3, + line: '- Unordered', + lineNumber: 23, + map: [ + 22, + 23, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '-', + meta: null, + nesting: -1, + tag: 'li', + type: 'list_item_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: '- List', + lineNumber: 24, + map: [ + 23, + 28, + ], + markup: '-', + meta: null, + nesting: 1, + tag: 'li', + type: 'list_item_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + line: '- List', + lineNumber: 24, + map: [ + 23, + 24, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'List', + hidden: false, + info: '', + level: 0, + line: '- List', + lineNumber: 24, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'List', + hidden: false, + info: '', + level: 3, + line: '- List', + lineNumber: 24, + map: [ + 23, + 24, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + line: ' - Items', + lineNumber: 25, + map: [ + 24, + 28, + ], + markup: '-', + meta: null, + nesting: 1, + tag: 'ul', + type: 'bullet_list_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: ' - Items', + lineNumber: 25, + map: [ + 24, + 28, + ], + markup: '-', + meta: null, + nesting: 1, + tag: 'li', + type: 'list_item_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + line: ' - Items', + lineNumber: 25, + map: [ + 24, + 26, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Items', + hidden: false, + info: '', + level: 0, + line: ' - Items', + lineNumber: 25, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: ' - Items', + lineNumber: 25, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: 'br', + type: 'softbreak', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'Indented', + hidden: false, + info: '', + level: 0, + line: ' Indented', + lineNumber: 26, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: `Items␊ + Indented`, + hidden: false, + info: '', + level: 5, + line: ' - Items', + lineNumber: 25, + map: [ + 24, + 26, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + line: ' Content', + lineNumber: 28, + map: [ + 27, + 28, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Content', + hidden: false, + info: '', + level: 0, + line: ' Content', + lineNumber: 28, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Content', + hidden: false, + info: '', + level: 5, + line: ' Content', + lineNumber: 28, + map: [ + 27, + 28, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + map: null, + markup: '-', + meta: null, + nesting: -1, + tag: 'li', + type: 'list_item_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + map: null, + markup: '-', + meta: null, + nesting: -1, + tag: 'ul', + type: 'bullet_list_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '-', + meta: null, + nesting: -1, + tag: 'li', + type: 'list_item_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '-', + meta: null, + nesting: -1, + tag: 'ul', + type: 'bullet_list_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: '1. Ordered', + lineNumber: 30, + map: [ + 29, + 35, + ], + markup: '.', + meta: null, + nesting: 1, + tag: 'ol', + type: 'ordered_list_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '1', + level: 1, + line: '1. Ordered', + lineNumber: 30, + map: [ + 29, + 30, + ], + markup: '.', + meta: null, + nesting: 1, + tag: 'li', + type: 'list_item_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + line: '1. Ordered', + lineNumber: 30, + map: [ + 29, + 30, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Ordered', + hidden: false, + info: '', + level: 0, + line: '1. Ordered', + lineNumber: 30, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Ordered', + hidden: false, + info: '', + level: 3, + line: '1. Ordered', + lineNumber: 30, + map: [ + 29, + 30, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '.', + meta: null, + nesting: -1, + tag: 'li', + type: 'list_item_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '2', + level: 1, + line: '2. List', + lineNumber: 31, + map: [ + 30, + 35, + ], + markup: '.', + meta: null, + nesting: 1, + tag: 'li', + type: 'list_item_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + line: '2. List', + lineNumber: 31, + map: [ + 30, + 31, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'List', + hidden: false, + info: '', + level: 0, + line: '2. List', + lineNumber: 31, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'List', + hidden: false, + info: '', + level: 3, + line: '2. List', + lineNumber: 31, + map: [ + 30, + 31, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: true, + info: '', + level: 2, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + line: ' 1. Items', + lineNumber: 32, + map: [ + 31, + 35, + ], + markup: '.', + meta: null, + nesting: 1, + tag: 'ol', + type: 'ordered_list_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '1', + level: 3, + line: ' 1. Items', + lineNumber: 32, + map: [ + 31, + 35, + ], + markup: '.', + meta: null, + nesting: 1, + tag: 'li', + type: 'list_item_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + line: ' 1. Items', + lineNumber: 32, + map: [ + 31, + 33, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Items', + hidden: false, + info: '', + level: 0, + line: ' 1. Items', + lineNumber: 32, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + Token { + attrs: null, + block: false, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: ' 1. Items', + lineNumber: 32, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: 'br', + type: 'softbreak', + }, + Token { + attrs: null, + block: false, + children: null, + content: 'Indented', + hidden: false, + info: '', + level: 0, + line: ' Indented', + lineNumber: 33, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: `Items␊ + Indented`, + hidden: false, + info: '', + level: 5, + line: ' 1. Items', + lineNumber: 32, + map: [ + 31, + 33, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + line: ' Content', + lineNumber: 35, + map: [ + 34, + 35, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'p', + type: 'paragraph_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Content', + hidden: false, + info: '', + level: 0, + line: ' Content', + lineNumber: 35, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Content', + hidden: false, + info: '', + level: 5, + line: ' Content', + lineNumber: 35, + map: [ + 34, + 35, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 4, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'p', + type: 'paragraph_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + map: null, + markup: '.', + meta: null, + nesting: -1, + tag: 'li', + type: 'list_item_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + map: null, + markup: '.', + meta: null, + nesting: -1, + tag: 'ol', + type: 'ordered_list_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '.', + meta: null, + nesting: -1, + tag: 'li', + type: 'list_item_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '.', + meta: null, + nesting: -1, + tag: 'ol', + type: 'ordered_list_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: `Fenced code block␊ + `, + hidden: false, + info: 'markdown options', + level: 0, + line: '```markdown options', + lineNumber: 37, + map: [ + 36, + 39, + ], + markup: '```', + meta: null, + nesting: 0, + tag: 'code', + type: 'fence', + }, + Token { + attrs: null, + block: true, + children: null, + content: `Indented code block␊ + `, + hidden: false, + info: '', + level: 0, + line: ' Indented code block', + lineNumber: 41, + map: [ + 40, + 41, + ], + markup: '', + meta: null, + nesting: 0, + tag: 'code', + type: 'code_block', + }, + Token { + attrs: null, + block: true, + children: null, + content: `

␊ + HTML block␊ +

␊ + `, + hidden: false, + info: '', + level: 0, + line: '

', + lineNumber: 43, + map: [ + 42, + 45, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'html_block', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 49, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'table', + type: 'table_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'thead', + type: 'thead_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'tr', + type: 'tr_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'th', + type: 'th_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Table', + hidden: false, + info: '', + level: 0, + line: '| Table | Heading |', + lineNumber: 47, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Table', + hidden: false, + info: '', + level: 4, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: -1, + tag: 'th', + type: 'th_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'th', + type: 'th_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Heading', + hidden: false, + info: '', + level: 0, + line: '| Table | Heading |', + lineNumber: 47, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Heading', + hidden: false, + info: '', + level: 4, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Heading |', + lineNumber: 47, + map: [ + 46, + 47, + ], + markup: '', + meta: null, + nesting: -1, + tag: 'th', + type: 'th_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'tr', + type: 'tr_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'thead', + type: 'thead_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'tbody', + type: 'tbody_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'tr', + type: 'tr_open', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'td', + type: 'td_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Table', + hidden: false, + info: '', + level: 0, + line: '| Table | Cell |', + lineNumber: 49, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Table', + hidden: false, + info: '', + level: 4, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: -1, + tag: 'td', + type: 'td_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: 1, + tag: 'td', + type: 'td_open', + }, + Token { + attrs: null, + block: true, + children: [ + Token { + attrs: null, + block: false, + children: null, + content: 'Cell', + hidden: false, + info: '', + level: 0, + line: '| Table | Cell |', + lineNumber: 49, + map: null, + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'text', + }, + ], + content: 'Cell', + hidden: false, + info: '', + level: 4, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'inline', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 3, + line: '| Table | Cell |', + lineNumber: 49, + map: [ + 48, + 49, + ], + markup: '', + meta: null, + nesting: -1, + tag: 'td', + type: 'td_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 2, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'tr', + type: 'tr_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 1, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'tbody', + type: 'tbody_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: '', + hidden: false, + info: '', + level: 0, + map: null, + markup: '', + meta: null, + nesting: -1, + tag: 'table', + type: 'table_close', + }, + Token { + attrs: null, + block: true, + children: null, + content: `␊ + `, + hidden: false, + info: '', + level: 0, + line: '', + lineNumber: 51, + map: [ + 50, + 51, + ], + markup: '', + meta: null, + nesting: 0, + tag: '', + type: 'html_block', + }, + ] + +## customRulesMicromarkTokensSnapshot + +> Unexpected tokens + + [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 22, + endLine: 1, + parent: [Circular], + startColumn: 1, + startLine: 1, + text: 'Every Markdown Syntax', + type: 'data', + }, + ], + endColumn: 22, + endLine: 1, + parent: [Circular], + startColumn: 1, + startLine: 1, + text: 'Every Markdown Syntax', + type: 'setextHeadingText', + }, + { + children: [], + endColumn: 1, + endLine: 2, + parent: [Circular], + startColumn: 22, + startLine: 1, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 22, + endLine: 2, + parent: [Circular], + startColumn: 1, + startLine: 2, + text: '=====================', + type: 'setextHeadingLineSequence', + }, + ], + endColumn: 22, + endLine: 2, + parent: [Circular], + startColumn: 1, + startLine: 2, + text: '=====================', + type: 'setextHeadingLine', + }, + ], + endColumn: 22, + endLine: 2, + parent: null, + startColumn: 1, + startLine: 1, + text: `Every Markdown Syntax␊ + =====================`, + type: 'setextHeading', + }, + { + children: [], + endColumn: 1, + endLine: 3, + parent: null, + startColumn: 22, + startLine: 2, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 4, + parent: null, + startColumn: 1, + startLine: 3, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 3, + endLine: 4, + parent: [Circular], + startColumn: 1, + startLine: 4, + text: '##', + type: 'atxHeadingSequence', + }, + { + children: [], + endColumn: 4, + endLine: 4, + parent: [Circular], + startColumn: 3, + startLine: 4, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 23, + endLine: 4, + parent: [Circular], + startColumn: 4, + startLine: 4, + text: 'Level 2 ATX Heading', + type: 'data', + }, + ], + endColumn: 23, + endLine: 4, + parent: [Circular], + startColumn: 4, + startLine: 4, + text: 'Level 2 ATX Heading', + type: 'atxHeadingText', + }, + ], + endColumn: 23, + endLine: 4, + parent: null, + startColumn: 1, + startLine: 4, + text: '## Level 2 ATX Heading', + type: 'atxHeading', + }, + { + children: [], + endColumn: 1, + endLine: 5, + parent: null, + startColumn: 23, + startLine: 4, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 6, + parent: null, + startColumn: 1, + startLine: 5, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 4, + endLine: 6, + parent: [Circular], + startColumn: 1, + startLine: 6, + text: '###', + type: 'atxHeadingSequence', + }, + { + children: [], + endColumn: 5, + endLine: 6, + parent: [Circular], + startColumn: 4, + startLine: 6, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 31, + endLine: 6, + parent: [Circular], + startColumn: 5, + startLine: 6, + text: 'Level 3 Closed ATX Heading', + type: 'data', + }, + ], + endColumn: 31, + endLine: 6, + parent: [Circular], + startColumn: 5, + startLine: 6, + text: 'Level 3 Closed ATX Heading', + type: 'atxHeadingText', + }, + { + children: [], + endColumn: 32, + endLine: 6, + parent: [Circular], + startColumn: 31, + startLine: 6, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 35, + endLine: 6, + parent: [Circular], + startColumn: 32, + startLine: 6, + text: '###', + type: 'atxHeadingSequence', + }, + ], + endColumn: 35, + endLine: 6, + parent: null, + startColumn: 1, + startLine: 6, + text: '### Level 3 Closed ATX Heading ###', + type: 'atxHeading', + }, + { + children: [], + endColumn: 1, + endLine: 7, + parent: null, + startColumn: 35, + startLine: 6, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 8, + parent: null, + startColumn: 1, + startLine: 7, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 4, + endLine: 8, + parent: [Circular], + startColumn: 1, + startLine: 8, + text: '---', + type: 'thematicBreakSequence', + }, + ], + endColumn: 4, + endLine: 8, + parent: null, + startColumn: 1, + startLine: 8, + text: '---', + type: 'thematicBreak', + }, + { + children: [], + endColumn: 1, + endLine: 9, + parent: null, + startColumn: 4, + startLine: 8, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 10, + parent: null, + startColumn: 1, + startLine: 9, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 6, + endLine: 10, + parent: [Circular], + startColumn: 1, + startLine: 10, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 7, + endLine: 10, + parent: [Circular], + startColumn: 6, + startLine: 10, + text: '*', + type: 'emphasisSequence', + }, + { + children: [ + { + children: [], + endColumn: 17, + endLine: 10, + parent: [Circular], + startColumn: 7, + startLine: 10, + text: 'emphasized', + type: 'data', + }, + ], + endColumn: 17, + endLine: 10, + parent: [Circular], + startColumn: 7, + startLine: 10, + text: 'emphasized', + type: 'emphasisText', + }, + { + children: [], + endColumn: 18, + endLine: 10, + parent: [Circular], + startColumn: 17, + startLine: 10, + text: '*', + type: 'emphasisSequence', + }, + ], + endColumn: 18, + endLine: 10, + parent: [Circular], + startColumn: 6, + startLine: 10, + text: '*emphasized*', + type: 'emphasis', + }, + { + children: [], + endColumn: 19, + endLine: 10, + parent: [Circular], + startColumn: 18, + startLine: 10, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 21, + endLine: 10, + parent: [Circular], + startColumn: 19, + startLine: 10, + text: '**', + type: 'strongSequence', + }, + { + children: [ + { + children: [], + endColumn: 27, + endLine: 10, + parent: [Circular], + startColumn: 21, + startLine: 10, + text: 'strong', + type: 'data', + }, + ], + endColumn: 27, + endLine: 10, + parent: [Circular], + startColumn: 21, + startLine: 10, + text: 'strong', + type: 'strongText', + }, + { + children: [], + endColumn: 29, + endLine: 10, + parent: [Circular], + startColumn: 27, + startLine: 10, + text: '**', + type: 'strongSequence', + }, + ], + endColumn: 29, + endLine: 10, + parent: [Circular], + startColumn: 19, + startLine: 10, + text: '**strong**', + type: 'strong', + }, + { + children: [], + endColumn: 30, + endLine: 10, + parent: [Circular], + startColumn: 29, + startLine: 10, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 31, + endLine: 10, + parent: [Circular], + startColumn: 30, + startLine: 10, + text: '_', + type: 'emphasisSequence', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 33, + endLine: 10, + parent: [Circular], + startColumn: 31, + startLine: 10, + text: '__', + type: 'strongSequence', + }, + { + children: [ + { + children: [], + endColumn: 50, + endLine: 10, + parent: [Circular], + startColumn: 33, + startLine: 10, + text: 'emphasized+strong', + type: 'data', + }, + ], + endColumn: 50, + endLine: 10, + parent: [Circular], + startColumn: 33, + startLine: 10, + text: 'emphasized+strong', + type: 'strongText', + }, + { + children: [], + endColumn: 52, + endLine: 10, + parent: [Circular], + startColumn: 50, + startLine: 10, + text: '__', + type: 'strongSequence', + }, + ], + endColumn: 52, + endLine: 10, + parent: [Circular], + startColumn: 31, + startLine: 10, + text: '__emphasized+strong__', + type: 'strong', + }, + ], + endColumn: 52, + endLine: 10, + parent: [Circular], + startColumn: 31, + startLine: 10, + text: '__emphasized+strong__', + type: 'emphasisText', + }, + { + children: [], + endColumn: 53, + endLine: 10, + parent: [Circular], + startColumn: 52, + startLine: 10, + text: '_', + type: 'emphasisSequence', + }, + ], + endColumn: 53, + endLine: 10, + parent: [Circular], + startColumn: 30, + startLine: 10, + text: '___emphasized+strong___', + type: 'emphasis', + }, + { + children: [], + endColumn: 54, + endLine: 10, + parent: [Circular], + startColumn: 53, + startLine: 10, + text: '.', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 11, + parent: [Circular], + startColumn: 54, + startLine: 10, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 6, + endLine: 11, + parent: [Circular], + startColumn: 1, + startLine: 11, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 7, + endLine: 11, + parent: [Circular], + startColumn: 6, + startLine: 11, + text: '`', + type: 'codeTextSequence', + }, + { + children: [], + endColumn: 11, + endLine: 11, + parent: [Circular], + startColumn: 7, + startLine: 11, + text: 'code', + type: 'codeTextData', + }, + { + children: [], + endColumn: 12, + endLine: 11, + parent: [Circular], + startColumn: 11, + startLine: 11, + text: '`', + type: 'codeTextSequence', + }, + ], + endColumn: 12, + endLine: 11, + parent: [Circular], + startColumn: 6, + startLine: 11, + text: '`code`', + type: 'codeText', + }, + { + children: [], + endColumn: 13, + endLine: 11, + parent: [Circular], + startColumn: 12, + startLine: 11, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 21, + endLine: 11, + parent: [Circular], + startColumn: 13, + startLine: 11, + text: '', + type: 'htmlTextData', + }, + ], + endColumn: 21, + endLine: 11, + parent: [Circular], + startColumn: 13, + startLine: 11, + text: '', + type: 'htmlText', + }, + { + children: [], + endColumn: 25, + endLine: 11, + parent: [Circular], + startColumn: 21, + startLine: 11, + text: 'html', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 34, + endLine: 11, + parent: [Circular], + startColumn: 25, + startLine: 11, + text: '', + type: 'htmlTextData', + }, + ], + endColumn: 34, + endLine: 11, + parent: [Circular], + startColumn: 25, + startLine: 11, + text: '', + type: 'htmlText', + }, + { + children: [], + endColumn: 35, + endLine: 11, + parent: [Circular], + startColumn: 34, + startLine: 11, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 36, + endLine: 11, + parent: [Circular], + startColumn: 35, + startLine: 11, + text: '<', + type: 'autolinkMarker', + }, + { + children: [], + endColumn: 60, + endLine: 11, + parent: [Circular], + startColumn: 36, + startLine: 11, + text: 'https://example.com/page', + type: 'autolinkProtocol', + }, + { + children: [], + endColumn: 61, + endLine: 11, + parent: [Circular], + startColumn: 60, + startLine: 11, + text: '>', + type: 'autolinkMarker', + }, + ], + endColumn: 61, + endLine: 11, + parent: [Circular], + startColumn: 35, + startLine: 11, + text: '', + type: 'autolink', + }, + { + children: [], + endColumn: 62, + endLine: 11, + parent: [Circular], + startColumn: 61, + startLine: 11, + text: '.', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 12, + parent: [Circular], + startColumn: 62, + startLine: 11, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 6, + endLine: 12, + parent: [Circular], + startColumn: 1, + startLine: 12, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 7, + endLine: 12, + parent: [Circular], + startColumn: 6, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 11, + endLine: 12, + parent: [Circular], + startColumn: 7, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 11, + endLine: 12, + parent: [Circular], + startColumn: 7, + startLine: 12, + text: 'link', + type: 'labelText', + }, + { + children: [], + endColumn: 12, + endLine: 12, + parent: [Circular], + startColumn: 11, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 12, + endLine: 12, + parent: [Circular], + startColumn: 6, + startLine: 12, + text: '[link]', + type: 'label', + }, + { + children: [ + { + children: [], + endColumn: 13, + endLine: 12, + parent: [Circular], + startColumn: 12, + startLine: 12, + text: '(', + type: 'resourceMarker', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'data', + }, + ], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'resourceDestinationString', + }, + ], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'resourceDestinationRaw', + }, + ], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'resourceDestination', + }, + { + children: [], + endColumn: 38, + endLine: 12, + parent: [Circular], + startColumn: 37, + startLine: 12, + text: ')', + type: 'resourceMarker', + }, + ], + endColumn: 38, + endLine: 12, + parent: [Circular], + startColumn: 12, + startLine: 12, + text: '(https://example.com/page)', + type: 'resource', + }, + ], + endColumn: 38, + endLine: 12, + parent: [Circular], + startColumn: 6, + startLine: 12, + text: '[link](https://example.com/page)', + type: 'link', + }, + { + children: [], + endColumn: 39, + endLine: 12, + parent: [Circular], + startColumn: 38, + startLine: 12, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 40, + endLine: 12, + parent: [Circular], + startColumn: 39, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 44, + endLine: 12, + parent: [Circular], + startColumn: 40, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 44, + endLine: 12, + parent: [Circular], + startColumn: 40, + startLine: 12, + text: 'link', + type: 'labelText', + }, + { + children: [], + endColumn: 45, + endLine: 12, + parent: [Circular], + startColumn: 44, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 45, + endLine: 12, + parent: [Circular], + startColumn: 39, + startLine: 12, + text: '[link]', + type: 'label', + }, + { + children: [ + { + children: [], + endColumn: 46, + endLine: 12, + parent: [Circular], + startColumn: 45, + startLine: 12, + text: '[', + type: 'referenceMarker', + }, + { + children: [], + endColumn: 47, + endLine: 12, + parent: [Circular], + startColumn: 46, + startLine: 12, + text: ']', + type: 'referenceMarker', + }, + ], + endColumn: 47, + endLine: 12, + parent: [Circular], + startColumn: 45, + startLine: 12, + text: '[]', + type: 'reference', + }, + ], + endColumn: 47, + endLine: 12, + parent: [Circular], + startColumn: 39, + startLine: 12, + text: '[link][]', + type: 'link', + }, + { + children: [], + endColumn: 48, + endLine: 12, + parent: [Circular], + startColumn: 47, + startLine: 12, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 49, + endLine: 12, + parent: [Circular], + startColumn: 48, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 53, + endLine: 12, + parent: [Circular], + startColumn: 49, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 53, + endLine: 12, + parent: [Circular], + startColumn: 49, + startLine: 12, + text: 'link', + type: 'labelText', + }, + { + children: [], + endColumn: 54, + endLine: 12, + parent: [Circular], + startColumn: 53, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 54, + endLine: 12, + parent: [Circular], + startColumn: 48, + startLine: 12, + text: '[link]', + type: 'label', + }, + ], + endColumn: 54, + endLine: 12, + parent: [Circular], + startColumn: 48, + startLine: 12, + text: '[link]', + type: 'link', + }, + { + children: [], + endColumn: 55, + endLine: 12, + parent: [Circular], + startColumn: 54, + startLine: 12, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 56, + endLine: 12, + parent: [Circular], + startColumn: 55, + startLine: 12, + text: '!', + type: 'labelImageMarker', + }, + { + children: [], + endColumn: 57, + endLine: 12, + parent: [Circular], + startColumn: 56, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 62, + endLine: 12, + parent: [Circular], + startColumn: 57, + startLine: 12, + text: 'image', + type: 'data', + }, + ], + endColumn: 62, + endLine: 12, + parent: [Circular], + startColumn: 57, + startLine: 12, + text: 'image', + type: 'labelText', + }, + { + children: [], + endColumn: 63, + endLine: 12, + parent: [Circular], + startColumn: 62, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 63, + endLine: 12, + parent: [Circular], + startColumn: 55, + startLine: 12, + text: '![image]', + type: 'label', + }, + { + children: [ + { + children: [], + endColumn: 64, + endLine: 12, + parent: [Circular], + startColumn: 63, + startLine: 12, + text: '[', + type: 'referenceMarker', + }, + { + children: [ + { + children: [], + endColumn: 68, + endLine: 12, + parent: [Circular], + startColumn: 64, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 68, + endLine: 12, + parent: [Circular], + startColumn: 64, + startLine: 12, + text: 'link', + type: 'referenceString', + }, + { + children: [], + endColumn: 69, + endLine: 12, + parent: [Circular], + startColumn: 68, + startLine: 12, + text: ']', + type: 'referenceMarker', + }, + ], + endColumn: 69, + endLine: 12, + parent: [Circular], + startColumn: 63, + startLine: 12, + text: '[link]', + type: 'reference', + }, + ], + endColumn: 69, + endLine: 12, + parent: [Circular], + startColumn: 55, + startLine: 12, + text: '![image][link]', + type: 'image', + }, + { + children: [], + endColumn: 70, + endLine: 12, + parent: [Circular], + startColumn: 69, + startLine: 12, + text: '.', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 13, + parent: [Circular], + startColumn: 70, + startLine: 12, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 6, + endLine: 13, + parent: [Circular], + startColumn: 1, + startLine: 13, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 30, + endLine: 13, + parent: [Circular], + startColumn: 6, + startLine: 13, + text: 'https://example.com/page', + type: 'literalAutolinkHttp', + }, + ], + endColumn: 30, + endLine: 13, + parent: [Circular], + startColumn: 6, + startLine: 13, + text: 'https://example.com/page', + type: 'literalAutolink', + }, + { + children: [], + endColumn: 31, + endLine: 13, + parent: [Circular], + startColumn: 30, + startLine: 13, + text: '.', + type: 'data', + }, + ], + endColumn: 31, + endLine: 13, + parent: [Circular], + startColumn: 1, + startLine: 10, + text: `Text *emphasized* **strong** ___emphasized+strong___.␊ + Text \`code\` html .␊ + Text [link](https://example.com/page) [link][] [link] ![image][link].␊ + Text https://example.com/page.`, + type: 'paragraph', + }, + ], + endColumn: 31, + endLine: 13, + parent: null, + startColumn: 1, + startLine: 10, + text: `Text *emphasized* **strong** ___emphasized+strong___.␊ + Text \`code\` html .␊ + Text [link](https://example.com/page) [link][] [link] ![image][link].␊ + Text https://example.com/page.`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 14, + parent: null, + startColumn: 31, + startLine: 13, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 15, + parent: null, + startColumn: 1, + startLine: 14, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 5, + endLine: 15, + parent: [Circular], + startColumn: 1, + startLine: 15, + text: 'Hard', + type: 'data', + }, + { + children: [], + endColumn: 7, + endLine: 15, + parent: [Circular], + startColumn: 5, + startLine: 15, + text: ' ', + type: 'hardBreakTrailing', + }, + { + children: [], + endColumn: 1, + endLine: 16, + parent: [Circular], + startColumn: 7, + startLine: 15, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 11, + endLine: 16, + parent: [Circular], + startColumn: 1, + startLine: 16, + text: 'line break', + type: 'data', + }, + ], + endColumn: 11, + endLine: 16, + parent: [Circular], + startColumn: 1, + startLine: 15, + text: `Hard ␊ + line break`, + type: 'paragraph', + }, + ], + endColumn: 11, + endLine: 16, + parent: null, + startColumn: 1, + startLine: 15, + text: `Hard ␊ + line break`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 17, + parent: null, + startColumn: 11, + startLine: 16, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 18, + parent: null, + startColumn: 1, + startLine: 17, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 18, + parent: [Circular], + startColumn: 1, + startLine: 18, + text: '[', + type: 'definitionLabelMarker', + }, + { + children: [ + { + children: [], + endColumn: 6, + endLine: 18, + parent: [Circular], + startColumn: 2, + startLine: 18, + text: 'link', + type: 'data', + }, + ], + endColumn: 6, + endLine: 18, + parent: [Circular], + startColumn: 2, + startLine: 18, + text: 'link', + type: 'definitionLabelString', + }, + { + children: [], + endColumn: 7, + endLine: 18, + parent: [Circular], + startColumn: 6, + startLine: 18, + text: ']', + type: 'definitionLabelMarker', + }, + ], + endColumn: 7, + endLine: 18, + parent: [Circular], + startColumn: 1, + startLine: 18, + text: '[link]', + type: 'definitionLabel', + }, + { + children: [], + endColumn: 8, + endLine: 18, + parent: [Circular], + startColumn: 7, + startLine: 18, + text: ':', + type: 'definitionMarker', + }, + { + children: [], + endColumn: 9, + endLine: 18, + parent: [Circular], + startColumn: 8, + startLine: 18, + text: ' ', + type: 'lineSuffix', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'data', + }, + ], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'definitionDestinationString', + }, + ], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'definitionDestinationRaw', + }, + ], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'definitionDestination', + }, + { + children: [], + endColumn: 34, + endLine: 18, + parent: [Circular], + startColumn: 33, + startLine: 18, + text: ' ', + type: 'lineSuffix', + }, + { + children: [ + { + children: [], + endColumn: 35, + endLine: 18, + parent: [Circular], + startColumn: 34, + startLine: 18, + text: '"', + type: 'definitionTitleMarker', + }, + { + children: [ + { + children: [], + endColumn: 40, + endLine: 18, + parent: [Circular], + startColumn: 35, + startLine: 18, + text: 'Title', + type: 'data', + }, + ], + endColumn: 40, + endLine: 18, + parent: [Circular], + startColumn: 35, + startLine: 18, + text: 'Title', + type: 'definitionTitleString', + }, + { + children: [], + endColumn: 41, + endLine: 18, + parent: [Circular], + startColumn: 40, + startLine: 18, + text: '"', + type: 'definitionTitleMarker', + }, + ], + endColumn: 41, + endLine: 18, + parent: [Circular], + startColumn: 34, + startLine: 18, + text: '"Title"', + type: 'definitionTitle', + }, + ], + endColumn: 41, + endLine: 18, + parent: [Circular], + startColumn: 1, + startLine: 18, + text: '[link]: https://example.com/page "Title"', + type: 'definition', + }, + ], + endColumn: 41, + endLine: 18, + parent: null, + startColumn: 1, + startLine: 18, + text: '[link]: https://example.com/page "Title"', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 19, + parent: null, + startColumn: 41, + startLine: 18, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 20, + parent: null, + startColumn: 1, + startLine: 19, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 20, + parent: [Circular], + startColumn: 1, + startLine: 20, + text: '>', + type: 'blockQuoteMarker', + }, + { + children: [], + endColumn: 3, + endLine: 20, + parent: [Circular], + startColumn: 2, + startLine: 20, + text: ' ', + type: 'blockQuotePrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 20, + parent: [Circular], + startColumn: 1, + startLine: 20, + text: '> ', + type: 'blockQuotePrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 14, + endLine: 20, + parent: [Circular], + startColumn: 3, + startLine: 20, + text: 'Block quote', + type: 'data', + }, + ], + endColumn: 14, + endLine: 20, + parent: [Circular], + startColumn: 3, + startLine: 20, + text: 'Block quote', + type: 'paragraph', + }, + ], + endColumn: 14, + endLine: 20, + parent: [Circular], + startColumn: 3, + startLine: 20, + text: 'Block quote', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 21, + parent: [Circular], + startColumn: 14, + startLine: 20, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 2, + endLine: 21, + parent: [Circular], + startColumn: 1, + startLine: 21, + text: '>', + type: 'blockQuoteMarker', + }, + { + children: [], + endColumn: 3, + endLine: 21, + parent: [Circular], + startColumn: 2, + startLine: 21, + text: ' ', + type: 'blockQuotePrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 21, + parent: [Circular], + startColumn: 1, + startLine: 21, + text: '> ', + type: 'blockQuotePrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 21, + parent: [Circular], + startColumn: 3, + startLine: 21, + text: '>', + type: 'blockQuoteMarker', + }, + { + children: [], + endColumn: 5, + endLine: 21, + parent: [Circular], + startColumn: 4, + startLine: 21, + text: ' ', + type: 'blockQuotePrefixWhitespace', + }, + ], + endColumn: 5, + endLine: 21, + parent: [Circular], + startColumn: 3, + startLine: 21, + text: '> ', + type: 'blockQuotePrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 5, + startLine: 21, + text: 'Nested', + type: 'data', + }, + ], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 5, + startLine: 21, + text: 'Nested', + type: 'paragraph', + }, + ], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 5, + startLine: 21, + text: 'Nested', + type: 'content', + }, + ], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 3, + startLine: 21, + text: '> Nested', + type: 'blockQuote', + }, + ], + endColumn: 11, + endLine: 21, + parent: null, + startColumn: 1, + startLine: 20, + text: `> Block quote␊ + > > Nested`, + type: 'blockQuote', + }, + { + children: [], + endColumn: 1, + endLine: 22, + parent: null, + startColumn: 11, + startLine: 21, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 23, + parent: null, + startColumn: 1, + startLine: 22, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 23, + parent: [Circular], + startColumn: 1, + startLine: 23, + text: '-', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 3, + endLine: 23, + parent: [Circular], + startColumn: 2, + startLine: 23, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 23, + parent: [Circular], + startColumn: 1, + startLine: 23, + text: '- ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 12, + endLine: 23, + parent: [Circular], + startColumn: 3, + startLine: 23, + text: 'Unordered', + type: 'data', + }, + ], + endColumn: 12, + endLine: 23, + parent: [Circular], + startColumn: 3, + startLine: 23, + text: 'Unordered', + type: 'paragraph', + }, + ], + endColumn: 12, + endLine: 23, + parent: [Circular], + startColumn: 3, + startLine: 23, + text: 'Unordered', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 24, + parent: [Circular], + startColumn: 12, + startLine: 23, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 2, + endLine: 24, + parent: [Circular], + startColumn: 1, + startLine: 24, + text: '-', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 3, + endLine: 24, + parent: [Circular], + startColumn: 2, + startLine: 24, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 24, + parent: [Circular], + startColumn: 1, + startLine: 24, + text: '- ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 7, + endLine: 24, + parent: [Circular], + startColumn: 3, + startLine: 24, + text: 'List', + type: 'data', + }, + ], + endColumn: 7, + endLine: 24, + parent: [Circular], + startColumn: 3, + startLine: 24, + text: 'List', + type: 'paragraph', + }, + ], + endColumn: 7, + endLine: 24, + parent: [Circular], + startColumn: 3, + startLine: 24, + text: 'List', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 25, + parent: [Circular], + startColumn: 7, + startLine: 24, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 3, + endLine: 25, + parent: [Circular], + startColumn: 1, + startLine: 25, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 25, + parent: [Circular], + startColumn: 3, + startLine: 25, + text: '-', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 5, + endLine: 25, + parent: [Circular], + startColumn: 4, + startLine: 25, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 5, + endLine: 25, + parent: [Circular], + startColumn: 3, + startLine: 25, + text: '- ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 10, + endLine: 25, + parent: [Circular], + startColumn: 5, + startLine: 25, + text: 'Items', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 26, + parent: [Circular], + startColumn: 10, + startLine: 25, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 3, + endLine: 26, + parent: [Circular], + startColumn: 1, + startLine: 26, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 5, + endLine: 26, + parent: [Circular], + startColumn: 3, + startLine: 26, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 13, + endLine: 26, + parent: [Circular], + startColumn: 5, + startLine: 26, + text: 'Indented', + type: 'data', + }, + ], + endColumn: 13, + endLine: 26, + parent: [Circular], + startColumn: 5, + startLine: 25, + text: `Items␊ + Indented`, + type: 'paragraph', + }, + ], + endColumn: 13, + endLine: 26, + parent: [Circular], + startColumn: 5, + startLine: 25, + text: `Items␊ + Indented`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 27, + parent: [Circular], + startColumn: 13, + startLine: 26, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 28, + parent: [Circular], + startColumn: 1, + startLine: 27, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [], + endColumn: 3, + endLine: 28, + parent: [Circular], + startColumn: 1, + startLine: 28, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 5, + endLine: 28, + parent: [Circular], + startColumn: 3, + startLine: 28, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 5, + startLine: 28, + text: 'Content', + type: 'data', + }, + ], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 5, + startLine: 28, + text: 'Content', + type: 'paragraph', + }, + ], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 5, + startLine: 28, + text: 'Content', + type: 'content', + }, + ], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 3, + startLine: 25, + text: `- Items␊ + Indented␊ + ␊ + Content`, + type: 'listUnordered', + }, + ], + endColumn: 12, + endLine: 28, + parent: null, + startColumn: 1, + startLine: 23, + text: `- Unordered␊ + - List␊ + - Items␊ + Indented␊ + ␊ + Content`, + type: 'listUnordered', + }, + { + children: [], + endColumn: 1, + endLine: 29, + parent: null, + startColumn: 12, + startLine: 28, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 30, + parent: null, + startColumn: 1, + startLine: 29, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 30, + parent: [Circular], + startColumn: 1, + startLine: 30, + text: '1', + type: 'listItemValue', + }, + { + children: [], + endColumn: 3, + endLine: 30, + parent: [Circular], + startColumn: 2, + startLine: 30, + text: '.', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 4, + endLine: 30, + parent: [Circular], + startColumn: 3, + startLine: 30, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 4, + endLine: 30, + parent: [Circular], + startColumn: 1, + startLine: 30, + text: '1. ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 11, + endLine: 30, + parent: [Circular], + startColumn: 4, + startLine: 30, + text: 'Ordered', + type: 'data', + }, + ], + endColumn: 11, + endLine: 30, + parent: [Circular], + startColumn: 4, + startLine: 30, + text: 'Ordered', + type: 'paragraph', + }, + ], + endColumn: 11, + endLine: 30, + parent: [Circular], + startColumn: 4, + startLine: 30, + text: 'Ordered', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 31, + parent: [Circular], + startColumn: 11, + startLine: 30, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 2, + endLine: 31, + parent: [Circular], + startColumn: 1, + startLine: 31, + text: '2', + type: 'listItemValue', + }, + { + children: [], + endColumn: 3, + endLine: 31, + parent: [Circular], + startColumn: 2, + startLine: 31, + text: '.', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 4, + endLine: 31, + parent: [Circular], + startColumn: 3, + startLine: 31, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 4, + endLine: 31, + parent: [Circular], + startColumn: 1, + startLine: 31, + text: '2. ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 8, + endLine: 31, + parent: [Circular], + startColumn: 4, + startLine: 31, + text: 'List', + type: 'data', + }, + ], + endColumn: 8, + endLine: 31, + parent: [Circular], + startColumn: 4, + startLine: 31, + text: 'List', + type: 'paragraph', + }, + ], + endColumn: 8, + endLine: 31, + parent: [Circular], + startColumn: 4, + startLine: 31, + text: 'List', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 32, + parent: [Circular], + startColumn: 8, + startLine: 31, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 4, + endLine: 32, + parent: [Circular], + startColumn: 1, + startLine: 32, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 5, + endLine: 32, + parent: [Circular], + startColumn: 4, + startLine: 32, + text: '1', + type: 'listItemValue', + }, + { + children: [], + endColumn: 6, + endLine: 32, + parent: [Circular], + startColumn: 5, + startLine: 32, + text: '.', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 7, + endLine: 32, + parent: [Circular], + startColumn: 6, + startLine: 32, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 7, + endLine: 32, + parent: [Circular], + startColumn: 4, + startLine: 32, + text: '1. ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 12, + endLine: 32, + parent: [Circular], + startColumn: 7, + startLine: 32, + text: 'Items', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 33, + parent: [Circular], + startColumn: 12, + startLine: 32, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 4, + endLine: 33, + parent: [Circular], + startColumn: 1, + startLine: 33, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 7, + endLine: 33, + parent: [Circular], + startColumn: 4, + startLine: 33, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 15, + endLine: 33, + parent: [Circular], + startColumn: 7, + startLine: 33, + text: 'Indented', + type: 'data', + }, + ], + endColumn: 15, + endLine: 33, + parent: [Circular], + startColumn: 7, + startLine: 32, + text: `Items␊ + Indented`, + type: 'paragraph', + }, + ], + endColumn: 15, + endLine: 33, + parent: [Circular], + startColumn: 7, + startLine: 32, + text: `Items␊ + Indented`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 34, + parent: [Circular], + startColumn: 15, + startLine: 33, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 35, + parent: [Circular], + startColumn: 1, + startLine: 34, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [], + endColumn: 4, + endLine: 35, + parent: [Circular], + startColumn: 1, + startLine: 35, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 7, + endLine: 35, + parent: [Circular], + startColumn: 4, + startLine: 35, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 7, + startLine: 35, + text: 'Content', + type: 'data', + }, + ], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 7, + startLine: 35, + text: 'Content', + type: 'paragraph', + }, + ], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 7, + startLine: 35, + text: 'Content', + type: 'content', + }, + ], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 4, + startLine: 32, + text: `1. Items␊ + Indented␊ + ␊ + Content`, + type: 'listOrdered', + }, + ], + endColumn: 14, + endLine: 35, + parent: null, + startColumn: 1, + startLine: 30, + text: `1. Ordered␊ + 2. List␊ + 1. Items␊ + Indented␊ + ␊ + Content`, + type: 'listOrdered', + }, + { + children: [], + endColumn: 1, + endLine: 36, + parent: null, + startColumn: 14, + startLine: 35, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 37, + parent: null, + startColumn: 1, + startLine: 36, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 37, + parent: [Circular], + startColumn: 1, + startLine: 37, + text: '```', + type: 'codeFencedFenceSequence', + }, + { + children: [ + { + children: [], + endColumn: 12, + endLine: 37, + parent: [Circular], + startColumn: 4, + startLine: 37, + text: 'markdown', + type: 'data', + }, + ], + endColumn: 12, + endLine: 37, + parent: [Circular], + startColumn: 4, + startLine: 37, + text: 'markdown', + type: 'codeFencedFenceInfo', + }, + { + children: [], + endColumn: 13, + endLine: 37, + parent: [Circular], + startColumn: 12, + startLine: 37, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 20, + endLine: 37, + parent: [Circular], + startColumn: 13, + startLine: 37, + text: 'options', + type: 'data', + }, + ], + endColumn: 20, + endLine: 37, + parent: [Circular], + startColumn: 13, + startLine: 37, + text: 'options', + type: 'codeFencedFenceMeta', + }, + ], + endColumn: 20, + endLine: 37, + parent: [Circular], + startColumn: 1, + startLine: 37, + text: '```markdown options', + type: 'codeFencedFence', + }, + { + children: [], + endColumn: 1, + endLine: 38, + parent: [Circular], + startColumn: 20, + startLine: 37, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 18, + endLine: 38, + parent: [Circular], + startColumn: 1, + startLine: 38, + text: 'Fenced code block', + type: 'codeFlowValue', + }, + { + children: [], + endColumn: 1, + endLine: 39, + parent: [Circular], + startColumn: 18, + startLine: 38, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 4, + endLine: 39, + parent: [Circular], + startColumn: 1, + startLine: 39, + text: '```', + type: 'codeFencedFenceSequence', + }, + ], + endColumn: 4, + endLine: 39, + parent: [Circular], + startColumn: 1, + startLine: 39, + text: '```', + type: 'codeFencedFence', + }, + ], + endColumn: 4, + endLine: 39, + parent: null, + startColumn: 1, + startLine: 37, + text: `\`\`\`markdown options␊ + Fenced code block␊ + \`\`\``, + type: 'codeFenced', + }, + { + children: [], + endColumn: 1, + endLine: 40, + parent: null, + startColumn: 4, + startLine: 39, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 41, + parent: null, + startColumn: 1, + startLine: 40, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 5, + endLine: 41, + parent: [Circular], + startColumn: 1, + startLine: 41, + text: ' ', + type: 'linePrefix', + }, + { + children: [], + endColumn: 24, + endLine: 41, + parent: [Circular], + startColumn: 5, + startLine: 41, + text: 'Indented code block', + type: 'codeFlowValue', + }, + ], + endColumn: 24, + endLine: 41, + parent: null, + startColumn: 1, + startLine: 41, + text: ' Indented code block', + type: 'codeIndented', + }, + { + children: [], + endColumn: 1, + endLine: 42, + parent: null, + startColumn: 24, + startLine: 41, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 43, + parent: null, + startColumn: 1, + startLine: 42, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 43, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: '

', + type: 'htmlTextData', + }, + ], + endColumn: 4, + endLine: 43, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: '

', + type: 'htmlText', + }, + { + children: [], + endColumn: 1, + endLine: 44, + parent: [Circular], + startColumn: 4, + startLine: 43, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 11, + endLine: 44, + parent: [Circular], + startColumn: 1, + startLine: 44, + text: 'HTML block', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 45, + parent: [Circular], + startColumn: 11, + startLine: 44, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 45, + text: '

', + type: 'htmlTextData', + }, + ], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 45, + text: '

', + type: 'htmlText', + }, + ], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: `

␊ + HTML block␊ +

`, + type: 'paragraph', + }, + ], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: `

␊ + HTML block␊ +

`, + type: 'content', + }, + ], + endColumn: 5, + endLine: 45, + parent: null, + startColumn: 1, + startLine: 43, + text: `

␊ + HTML block␊ +

`, + type: 'htmlFlow', + }, + { + children: [], + endColumn: 1, + endLine: 46, + parent: null, + startColumn: 5, + startLine: 45, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 47, + parent: null, + startColumn: 1, + startLine: 46, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 47, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 3, + endLine: 47, + parent: [Circular], + startColumn: 2, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 8, + endLine: 47, + parent: [Circular], + startColumn: 3, + startLine: 47, + text: 'Table', + type: 'data', + }, + ], + endColumn: 8, + endLine: 47, + parent: [Circular], + startColumn: 3, + startLine: 47, + text: 'Table', + type: 'tableContent', + }, + { + children: [], + endColumn: 9, + endLine: 47, + parent: [Circular], + startColumn: 8, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + ], + endColumn: 9, + endLine: 47, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: '| Table ', + type: 'tableHeader', + }, + { + children: [ + { + children: [], + endColumn: 10, + endLine: 47, + parent: [Circular], + startColumn: 9, + startLine: 47, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 11, + endLine: 47, + parent: [Circular], + startColumn: 10, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 18, + endLine: 47, + parent: [Circular], + startColumn: 11, + startLine: 47, + text: 'Heading', + type: 'data', + }, + ], + endColumn: 18, + endLine: 47, + parent: [Circular], + startColumn: 11, + startLine: 47, + text: 'Heading', + type: 'tableContent', + }, + { + children: [], + endColumn: 19, + endLine: 47, + parent: [Circular], + startColumn: 18, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 20, + endLine: 47, + parent: [Circular], + startColumn: 19, + startLine: 47, + text: '|', + type: 'tableCellDivider', + }, + ], + endColumn: 20, + endLine: 47, + parent: [Circular], + startColumn: 9, + startLine: 47, + text: '| Heading |', + type: 'tableHeader', + }, + ], + endColumn: 20, + endLine: 47, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: '| Table | Heading |', + type: 'tableRow', + }, + { + children: [], + endColumn: 1, + endLine: 48, + parent: [Circular], + startColumn: 20, + startLine: 47, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 48, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 3, + endLine: 48, + parent: [Circular], + startColumn: 2, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 8, + endLine: 48, + parent: [Circular], + startColumn: 3, + startLine: 48, + text: '-----', + type: 'tableDelimiterFiller', + }, + ], + endColumn: 8, + endLine: 48, + parent: [Circular], + startColumn: 3, + startLine: 48, + text: '-----', + type: 'tableContent', + }, + { + children: [], + endColumn: 9, + endLine: 48, + parent: [Circular], + startColumn: 8, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + ], + endColumn: 9, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 48, + text: '| ----- ', + type: 'tableDelimiter', + }, + { + children: [ + { + children: [], + endColumn: 10, + endLine: 48, + parent: [Circular], + startColumn: 9, + startLine: 48, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 11, + endLine: 48, + parent: [Circular], + startColumn: 10, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 18, + endLine: 48, + parent: [Circular], + startColumn: 11, + startLine: 48, + text: '-------', + type: 'tableDelimiterFiller', + }, + ], + endColumn: 18, + endLine: 48, + parent: [Circular], + startColumn: 11, + startLine: 48, + text: '-------', + type: 'tableContent', + }, + { + children: [], + endColumn: 19, + endLine: 48, + parent: [Circular], + startColumn: 18, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 19, + startLine: 48, + text: '|', + type: 'tableCellDivider', + }, + ], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 9, + startLine: 48, + text: '| ------- |', + type: 'tableDelimiter', + }, + ], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 48, + text: '| ----- | ------- |', + type: 'tableDelimiterRow', + }, + ], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: `| Table | Heading |␊ + | ----- | ------- |`, + type: 'tableHead', + }, + { + children: [], + endColumn: 1, + endLine: 49, + parent: [Circular], + startColumn: 20, + startLine: 48, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 3, + endLine: 49, + parent: [Circular], + startColumn: 2, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 8, + endLine: 49, + parent: [Circular], + startColumn: 3, + startLine: 49, + text: 'Table', + type: 'data', + }, + ], + endColumn: 8, + endLine: 49, + parent: [Circular], + startColumn: 3, + startLine: 49, + text: 'Table', + type: 'tableContent', + }, + { + children: [], + endColumn: 9, + endLine: 49, + parent: [Circular], + startColumn: 8, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + ], + endColumn: 9, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '| Table ', + type: 'tableData', + }, + { + children: [ + { + children: [], + endColumn: 10, + endLine: 49, + parent: [Circular], + startColumn: 9, + startLine: 49, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 11, + endLine: 49, + parent: [Circular], + startColumn: 10, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 15, + endLine: 49, + parent: [Circular], + startColumn: 11, + startLine: 49, + text: 'Cell', + type: 'data', + }, + ], + endColumn: 15, + endLine: 49, + parent: [Circular], + startColumn: 11, + startLine: 49, + text: 'Cell', + type: 'tableContent', + }, + { + children: [], + endColumn: 19, + endLine: 49, + parent: [Circular], + startColumn: 15, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 19, + startLine: 49, + text: '|', + type: 'tableCellDivider', + }, + ], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 9, + startLine: 49, + text: '| Cell |', + type: 'tableData', + }, + ], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '| Table | Cell |', + type: 'tableRow', + }, + ], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '| Table | Cell |', + type: 'tableBody', + }, + ], + endColumn: 20, + endLine: 49, + parent: null, + startColumn: 1, + startLine: 47, + text: `| Table | Heading |␊ + | ----- | ------- |␊ + | Table | Cell |`, + type: 'table', + }, + { + children: [], + endColumn: 1, + endLine: 50, + parent: null, + startColumn: 20, + startLine: 49, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 51, + parent: null, + startColumn: 1, + startLine: 50, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 35, + endLine: 51, + parent: [Circular], + startColumn: 1, + startLine: 51, + text: '', + type: 'htmlFlowData', + }, + ], + endColumn: 35, + endLine: 51, + parent: null, + startColumn: 1, + startLine: 51, + text: '', + type: 'htmlFlow', + }, + { + children: [], + endColumn: 1, + endLine: 52, + parent: null, + startColumn: 35, + startLine: 51, + text: `␊ + `, + type: 'lineEnding', + }, + ] diff --git a/test/snapshots/markdownlint-test-custom-rules.mjs.snap b/test/snapshots/markdownlint-test-custom-rules.mjs.snap new file mode 100644 index 00000000..80ba4e61 Binary files /dev/null and b/test/snapshots/markdownlint-test-custom-rules.mjs.snap differ diff --git a/test/snapshots/markdownlint-test-exports.mjs.md b/test/snapshots/markdownlint-test-exports.mjs.md new file mode 100644 index 00000000..a29305c2 --- /dev/null +++ b/test/snapshots/markdownlint-test-exports.mjs.md @@ -0,0 +1,117 @@ +# Snapshot report for `test/markdownlint-test-exports.mjs` + +The actual snapshot is saved in `markdownlint-test-exports.mjs.snap`. + +Generated by [AVA](https://avajs.dev). + +## exported names + +> Snapshot 1 + + { + markdownlint: [ + 'applyFix', + 'applyFixes', + 'getVersion', + 'resolveModule', + ], + 'markdownlint/async': [ + 'lint', + 'readConfig', + ], + 'markdownlint/helpers': [ + 'addError', + 'addErrorContext', + 'addErrorDetailIf', + 'allPunctuation', + 'allPunctuationNoQuestion', + 'clearHtmlCommentText', + 'cloneIfArray', + 'cloneIfUrl', + 'convertToResultVersion0', + 'convertToResultVersion1', + 'convertToResultVersion2', + 'default', + 'ellipsify', + 'endOfLineGemojiCodeRe', + 'endOfLineHtmlEntityRe', + 'escapeForRegExp', + 'expandTildePath', + 'formatLintResults', + 'frontMatterHasTitle', + 'frontMatterRe', + 'getHtmlAttributeRe', + 'getPreferredLineEnding', + 'getReferenceLinkImageData', + 'hasOverlap', + 'inlineCommentStartRe', + 'isBlankLine', + 'isEmptyString', + 'isNumber', + 'isObject', + 'isString', + 'isUrl', + 'newLineRe', + 'nextLinesRe', + ], + 'markdownlint/promise': [ + 'extendConfig', + 'lint', + 'readConfig', + ], + 'markdownlint/style/all': [ + 'comment', + 'default', + ], + 'markdownlint/style/cirosantilli': [ + 'comment', + 'default', + 'MD003', + 'MD004', + 'MD007', + 'MD030', + 'MD033', + 'MD035', + ], + 'markdownlint/style/prettier': [ + 'comment', + 'blanks-around-fences', + 'blanks-around-headings', + 'blanks-around-lists', + 'code-fence-style', + 'emphasis-style', + 'heading-start-left', + 'heading-style', + 'hr-style', + 'line-length', + 'list-indent', + 'list-marker-space', + 'no-blanks-blockquote', + 'no-hard-tabs', + 'no-missing-space-atx', + 'no-missing-space-closed-atx', + 'no-multiple-blanks', + 'no-multiple-space-atx', + 'no-multiple-space-blockquote', + 'no-multiple-space-closed-atx', + 'no-trailing-spaces', + 'ol-prefix', + 'strong-style', + 'ul-indent', + ], + 'markdownlint/style/relaxed': [ + 'comment', + 'default', + 'whitespace', + 'line_length', + 'ul-indent', + 'no-inline-html', + 'no-bare-urls', + 'fenced-code-language', + 'first-line-h1', + ], + 'markdownlint/sync': [ + 'lint', + 'readConfig', + ], + } diff --git a/test/snapshots/markdownlint-test-exports.mjs.snap b/test/snapshots/markdownlint-test-exports.mjs.snap new file mode 100644 index 00000000..124c0ee3 Binary files /dev/null and b/test/snapshots/markdownlint-test-exports.mjs.snap differ diff --git a/test/snapshots/markdownlint-test-micromark.mjs.md b/test/snapshots/markdownlint-test-micromark.mjs.md new file mode 100644 index 00000000..d1f7db0f --- /dev/null +++ b/test/snapshots/markdownlint-test-micromark.mjs.md @@ -0,0 +1,3542 @@ +# Snapshot report for `test/markdownlint-test-micromark.mjs` + +The actual snapshot is saved in `markdownlint-test-micromark.mjs.snap`. + +Generated by [AVA](https://avajs.dev). + +## parse + +> Unexpected tokens + + [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 22, + endLine: 1, + parent: [Circular], + startColumn: 1, + startLine: 1, + text: 'Every Markdown Syntax', + type: 'data', + }, + ], + endColumn: 22, + endLine: 1, + parent: [Circular], + startColumn: 1, + startLine: 1, + text: 'Every Markdown Syntax', + type: 'setextHeadingText', + }, + { + children: [], + endColumn: 1, + endLine: 2, + parent: [Circular], + startColumn: 22, + startLine: 1, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 22, + endLine: 2, + parent: [Circular], + startColumn: 1, + startLine: 2, + text: '=====================', + type: 'setextHeadingLineSequence', + }, + ], + endColumn: 22, + endLine: 2, + parent: [Circular], + startColumn: 1, + startLine: 2, + text: '=====================', + type: 'setextHeadingLine', + }, + ], + endColumn: 22, + endLine: 2, + parent: null, + startColumn: 1, + startLine: 1, + text: `Every Markdown Syntax␊ + =====================`, + type: 'setextHeading', + }, + { + children: [], + endColumn: 1, + endLine: 3, + parent: null, + startColumn: 22, + startLine: 2, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 4, + parent: null, + startColumn: 1, + startLine: 3, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 3, + endLine: 4, + parent: [Circular], + startColumn: 1, + startLine: 4, + text: '##', + type: 'atxHeadingSequence', + }, + { + children: [], + endColumn: 4, + endLine: 4, + parent: [Circular], + startColumn: 3, + startLine: 4, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 23, + endLine: 4, + parent: [Circular], + startColumn: 4, + startLine: 4, + text: 'Level 2 ATX Heading', + type: 'data', + }, + ], + endColumn: 23, + endLine: 4, + parent: [Circular], + startColumn: 4, + startLine: 4, + text: 'Level 2 ATX Heading', + type: 'atxHeadingText', + }, + ], + endColumn: 23, + endLine: 4, + parent: null, + startColumn: 1, + startLine: 4, + text: '## Level 2 ATX Heading', + type: 'atxHeading', + }, + { + children: [], + endColumn: 1, + endLine: 5, + parent: null, + startColumn: 23, + startLine: 4, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 6, + parent: null, + startColumn: 1, + startLine: 5, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 4, + endLine: 6, + parent: [Circular], + startColumn: 1, + startLine: 6, + text: '###', + type: 'atxHeadingSequence', + }, + { + children: [], + endColumn: 5, + endLine: 6, + parent: [Circular], + startColumn: 4, + startLine: 6, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 31, + endLine: 6, + parent: [Circular], + startColumn: 5, + startLine: 6, + text: 'Level 3 Closed ATX Heading', + type: 'data', + }, + ], + endColumn: 31, + endLine: 6, + parent: [Circular], + startColumn: 5, + startLine: 6, + text: 'Level 3 Closed ATX Heading', + type: 'atxHeadingText', + }, + { + children: [], + endColumn: 32, + endLine: 6, + parent: [Circular], + startColumn: 31, + startLine: 6, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 35, + endLine: 6, + parent: [Circular], + startColumn: 32, + startLine: 6, + text: '###', + type: 'atxHeadingSequence', + }, + ], + endColumn: 35, + endLine: 6, + parent: null, + startColumn: 1, + startLine: 6, + text: '### Level 3 Closed ATX Heading ###', + type: 'atxHeading', + }, + { + children: [], + endColumn: 1, + endLine: 7, + parent: null, + startColumn: 35, + startLine: 6, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 8, + parent: null, + startColumn: 1, + startLine: 7, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 4, + endLine: 8, + parent: [Circular], + startColumn: 1, + startLine: 8, + text: '---', + type: 'thematicBreakSequence', + }, + ], + endColumn: 4, + endLine: 8, + parent: null, + startColumn: 1, + startLine: 8, + text: '---', + type: 'thematicBreak', + }, + { + children: [], + endColumn: 1, + endLine: 9, + parent: null, + startColumn: 4, + startLine: 8, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 10, + parent: null, + startColumn: 1, + startLine: 9, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 6, + endLine: 10, + parent: [Circular], + startColumn: 1, + startLine: 10, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 7, + endLine: 10, + parent: [Circular], + startColumn: 6, + startLine: 10, + text: '*', + type: 'emphasisSequence', + }, + { + children: [ + { + children: [], + endColumn: 17, + endLine: 10, + parent: [Circular], + startColumn: 7, + startLine: 10, + text: 'emphasized', + type: 'data', + }, + ], + endColumn: 17, + endLine: 10, + parent: [Circular], + startColumn: 7, + startLine: 10, + text: 'emphasized', + type: 'emphasisText', + }, + { + children: [], + endColumn: 18, + endLine: 10, + parent: [Circular], + startColumn: 17, + startLine: 10, + text: '*', + type: 'emphasisSequence', + }, + ], + endColumn: 18, + endLine: 10, + parent: [Circular], + startColumn: 6, + startLine: 10, + text: '*emphasized*', + type: 'emphasis', + }, + { + children: [], + endColumn: 19, + endLine: 10, + parent: [Circular], + startColumn: 18, + startLine: 10, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 21, + endLine: 10, + parent: [Circular], + startColumn: 19, + startLine: 10, + text: '**', + type: 'strongSequence', + }, + { + children: [ + { + children: [], + endColumn: 27, + endLine: 10, + parent: [Circular], + startColumn: 21, + startLine: 10, + text: 'strong', + type: 'data', + }, + ], + endColumn: 27, + endLine: 10, + parent: [Circular], + startColumn: 21, + startLine: 10, + text: 'strong', + type: 'strongText', + }, + { + children: [], + endColumn: 29, + endLine: 10, + parent: [Circular], + startColumn: 27, + startLine: 10, + text: '**', + type: 'strongSequence', + }, + ], + endColumn: 29, + endLine: 10, + parent: [Circular], + startColumn: 19, + startLine: 10, + text: '**strong**', + type: 'strong', + }, + { + children: [], + endColumn: 30, + endLine: 10, + parent: [Circular], + startColumn: 29, + startLine: 10, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 31, + endLine: 10, + parent: [Circular], + startColumn: 30, + startLine: 10, + text: '_', + type: 'emphasisSequence', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 33, + endLine: 10, + parent: [Circular], + startColumn: 31, + startLine: 10, + text: '__', + type: 'strongSequence', + }, + { + children: [ + { + children: [], + endColumn: 50, + endLine: 10, + parent: [Circular], + startColumn: 33, + startLine: 10, + text: 'emphasized+strong', + type: 'data', + }, + ], + endColumn: 50, + endLine: 10, + parent: [Circular], + startColumn: 33, + startLine: 10, + text: 'emphasized+strong', + type: 'strongText', + }, + { + children: [], + endColumn: 52, + endLine: 10, + parent: [Circular], + startColumn: 50, + startLine: 10, + text: '__', + type: 'strongSequence', + }, + ], + endColumn: 52, + endLine: 10, + parent: [Circular], + startColumn: 31, + startLine: 10, + text: '__emphasized+strong__', + type: 'strong', + }, + ], + endColumn: 52, + endLine: 10, + parent: [Circular], + startColumn: 31, + startLine: 10, + text: '__emphasized+strong__', + type: 'emphasisText', + }, + { + children: [], + endColumn: 53, + endLine: 10, + parent: [Circular], + startColumn: 52, + startLine: 10, + text: '_', + type: 'emphasisSequence', + }, + ], + endColumn: 53, + endLine: 10, + parent: [Circular], + startColumn: 30, + startLine: 10, + text: '___emphasized+strong___', + type: 'emphasis', + }, + { + children: [], + endColumn: 54, + endLine: 10, + parent: [Circular], + startColumn: 53, + startLine: 10, + text: '.', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 11, + parent: [Circular], + startColumn: 54, + startLine: 10, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 6, + endLine: 11, + parent: [Circular], + startColumn: 1, + startLine: 11, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 7, + endLine: 11, + parent: [Circular], + startColumn: 6, + startLine: 11, + text: '`', + type: 'codeTextSequence', + }, + { + children: [], + endColumn: 11, + endLine: 11, + parent: [Circular], + startColumn: 7, + startLine: 11, + text: 'code', + type: 'codeTextData', + }, + { + children: [], + endColumn: 12, + endLine: 11, + parent: [Circular], + startColumn: 11, + startLine: 11, + text: '`', + type: 'codeTextSequence', + }, + ], + endColumn: 12, + endLine: 11, + parent: [Circular], + startColumn: 6, + startLine: 11, + text: '`code`', + type: 'codeText', + }, + { + children: [], + endColumn: 13, + endLine: 11, + parent: [Circular], + startColumn: 12, + startLine: 11, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 21, + endLine: 11, + parent: [Circular], + startColumn: 13, + startLine: 11, + text: '', + type: 'htmlTextData', + }, + ], + endColumn: 21, + endLine: 11, + parent: [Circular], + startColumn: 13, + startLine: 11, + text: '', + type: 'htmlText', + }, + { + children: [], + endColumn: 25, + endLine: 11, + parent: [Circular], + startColumn: 21, + startLine: 11, + text: 'html', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 34, + endLine: 11, + parent: [Circular], + startColumn: 25, + startLine: 11, + text: '', + type: 'htmlTextData', + }, + ], + endColumn: 34, + endLine: 11, + parent: [Circular], + startColumn: 25, + startLine: 11, + text: '', + type: 'htmlText', + }, + { + children: [], + endColumn: 35, + endLine: 11, + parent: [Circular], + startColumn: 34, + startLine: 11, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 36, + endLine: 11, + parent: [Circular], + startColumn: 35, + startLine: 11, + text: '<', + type: 'autolinkMarker', + }, + { + children: [], + endColumn: 60, + endLine: 11, + parent: [Circular], + startColumn: 36, + startLine: 11, + text: 'https://example.com/page', + type: 'autolinkProtocol', + }, + { + children: [], + endColumn: 61, + endLine: 11, + parent: [Circular], + startColumn: 60, + startLine: 11, + text: '>', + type: 'autolinkMarker', + }, + ], + endColumn: 61, + endLine: 11, + parent: [Circular], + startColumn: 35, + startLine: 11, + text: '', + type: 'autolink', + }, + { + children: [], + endColumn: 62, + endLine: 11, + parent: [Circular], + startColumn: 61, + startLine: 11, + text: '.', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 12, + parent: [Circular], + startColumn: 62, + startLine: 11, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 6, + endLine: 12, + parent: [Circular], + startColumn: 1, + startLine: 12, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 7, + endLine: 12, + parent: [Circular], + startColumn: 6, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 11, + endLine: 12, + parent: [Circular], + startColumn: 7, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 11, + endLine: 12, + parent: [Circular], + startColumn: 7, + startLine: 12, + text: 'link', + type: 'labelText', + }, + { + children: [], + endColumn: 12, + endLine: 12, + parent: [Circular], + startColumn: 11, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 12, + endLine: 12, + parent: [Circular], + startColumn: 6, + startLine: 12, + text: '[link]', + type: 'label', + }, + { + children: [ + { + children: [], + endColumn: 13, + endLine: 12, + parent: [Circular], + startColumn: 12, + startLine: 12, + text: '(', + type: 'resourceMarker', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'data', + }, + ], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'resourceDestinationString', + }, + ], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'resourceDestinationRaw', + }, + ], + endColumn: 37, + endLine: 12, + parent: [Circular], + startColumn: 13, + startLine: 12, + text: 'https://example.com/page', + type: 'resourceDestination', + }, + { + children: [], + endColumn: 38, + endLine: 12, + parent: [Circular], + startColumn: 37, + startLine: 12, + text: ')', + type: 'resourceMarker', + }, + ], + endColumn: 38, + endLine: 12, + parent: [Circular], + startColumn: 12, + startLine: 12, + text: '(https://example.com/page)', + type: 'resource', + }, + ], + endColumn: 38, + endLine: 12, + parent: [Circular], + startColumn: 6, + startLine: 12, + text: '[link](https://example.com/page)', + type: 'link', + }, + { + children: [], + endColumn: 39, + endLine: 12, + parent: [Circular], + startColumn: 38, + startLine: 12, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 40, + endLine: 12, + parent: [Circular], + startColumn: 39, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 44, + endLine: 12, + parent: [Circular], + startColumn: 40, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 44, + endLine: 12, + parent: [Circular], + startColumn: 40, + startLine: 12, + text: 'link', + type: 'labelText', + }, + { + children: [], + endColumn: 45, + endLine: 12, + parent: [Circular], + startColumn: 44, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 45, + endLine: 12, + parent: [Circular], + startColumn: 39, + startLine: 12, + text: '[link]', + type: 'label', + }, + { + children: [ + { + children: [], + endColumn: 46, + endLine: 12, + parent: [Circular], + startColumn: 45, + startLine: 12, + text: '[', + type: 'referenceMarker', + }, + { + children: [], + endColumn: 47, + endLine: 12, + parent: [Circular], + startColumn: 46, + startLine: 12, + text: ']', + type: 'referenceMarker', + }, + ], + endColumn: 47, + endLine: 12, + parent: [Circular], + startColumn: 45, + startLine: 12, + text: '[]', + type: 'reference', + }, + ], + endColumn: 47, + endLine: 12, + parent: [Circular], + startColumn: 39, + startLine: 12, + text: '[link][]', + type: 'link', + }, + { + children: [], + endColumn: 48, + endLine: 12, + parent: [Circular], + startColumn: 47, + startLine: 12, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 49, + endLine: 12, + parent: [Circular], + startColumn: 48, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 53, + endLine: 12, + parent: [Circular], + startColumn: 49, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 53, + endLine: 12, + parent: [Circular], + startColumn: 49, + startLine: 12, + text: 'link', + type: 'labelText', + }, + { + children: [], + endColumn: 54, + endLine: 12, + parent: [Circular], + startColumn: 53, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 54, + endLine: 12, + parent: [Circular], + startColumn: 48, + startLine: 12, + text: '[link]', + type: 'label', + }, + ], + endColumn: 54, + endLine: 12, + parent: [Circular], + startColumn: 48, + startLine: 12, + text: '[link]', + type: 'link', + }, + { + children: [], + endColumn: 55, + endLine: 12, + parent: [Circular], + startColumn: 54, + startLine: 12, + text: ' ', + type: 'data', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 56, + endLine: 12, + parent: [Circular], + startColumn: 55, + startLine: 12, + text: '!', + type: 'labelImageMarker', + }, + { + children: [], + endColumn: 57, + endLine: 12, + parent: [Circular], + startColumn: 56, + startLine: 12, + text: '[', + type: 'labelMarker', + }, + { + children: [ + { + children: [], + endColumn: 62, + endLine: 12, + parent: [Circular], + startColumn: 57, + startLine: 12, + text: 'image', + type: 'data', + }, + ], + endColumn: 62, + endLine: 12, + parent: [Circular], + startColumn: 57, + startLine: 12, + text: 'image', + type: 'labelText', + }, + { + children: [], + endColumn: 63, + endLine: 12, + parent: [Circular], + startColumn: 62, + startLine: 12, + text: ']', + type: 'labelMarker', + }, + ], + endColumn: 63, + endLine: 12, + parent: [Circular], + startColumn: 55, + startLine: 12, + text: '![image]', + type: 'label', + }, + { + children: [ + { + children: [], + endColumn: 64, + endLine: 12, + parent: [Circular], + startColumn: 63, + startLine: 12, + text: '[', + type: 'referenceMarker', + }, + { + children: [ + { + children: [], + endColumn: 68, + endLine: 12, + parent: [Circular], + startColumn: 64, + startLine: 12, + text: 'link', + type: 'data', + }, + ], + endColumn: 68, + endLine: 12, + parent: [Circular], + startColumn: 64, + startLine: 12, + text: 'link', + type: 'referenceString', + }, + { + children: [], + endColumn: 69, + endLine: 12, + parent: [Circular], + startColumn: 68, + startLine: 12, + text: ']', + type: 'referenceMarker', + }, + ], + endColumn: 69, + endLine: 12, + parent: [Circular], + startColumn: 63, + startLine: 12, + text: '[link]', + type: 'reference', + }, + ], + endColumn: 69, + endLine: 12, + parent: [Circular], + startColumn: 55, + startLine: 12, + text: '![image][link]', + type: 'image', + }, + { + children: [], + endColumn: 70, + endLine: 12, + parent: [Circular], + startColumn: 69, + startLine: 12, + text: '.', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 13, + parent: [Circular], + startColumn: 70, + startLine: 12, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 6, + endLine: 13, + parent: [Circular], + startColumn: 1, + startLine: 13, + text: 'Text ', + type: 'data', + }, + { + children: [ + { + children: [], + endColumn: 30, + endLine: 13, + parent: [Circular], + startColumn: 6, + startLine: 13, + text: 'https://example.com/page', + type: 'literalAutolinkHttp', + }, + ], + endColumn: 30, + endLine: 13, + parent: [Circular], + startColumn: 6, + startLine: 13, + text: 'https://example.com/page', + type: 'literalAutolink', + }, + { + children: [], + endColumn: 31, + endLine: 13, + parent: [Circular], + startColumn: 30, + startLine: 13, + text: '.', + type: 'data', + }, + ], + endColumn: 31, + endLine: 13, + parent: [Circular], + startColumn: 1, + startLine: 10, + text: `Text *emphasized* **strong** ___emphasized+strong___.␊ + Text \`code\` html .␊ + Text [link](https://example.com/page) [link][] [link] ![image][link].␊ + Text https://example.com/page.`, + type: 'paragraph', + }, + ], + endColumn: 31, + endLine: 13, + parent: null, + startColumn: 1, + startLine: 10, + text: `Text *emphasized* **strong** ___emphasized+strong___.␊ + Text \`code\` html .␊ + Text [link](https://example.com/page) [link][] [link] ![image][link].␊ + Text https://example.com/page.`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 14, + parent: null, + startColumn: 31, + startLine: 13, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 15, + parent: null, + startColumn: 1, + startLine: 14, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 5, + endLine: 15, + parent: [Circular], + startColumn: 1, + startLine: 15, + text: 'Hard', + type: 'data', + }, + { + children: [], + endColumn: 7, + endLine: 15, + parent: [Circular], + startColumn: 5, + startLine: 15, + text: ' ', + type: 'hardBreakTrailing', + }, + { + children: [], + endColumn: 1, + endLine: 16, + parent: [Circular], + startColumn: 7, + startLine: 15, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 11, + endLine: 16, + parent: [Circular], + startColumn: 1, + startLine: 16, + text: 'line break', + type: 'data', + }, + ], + endColumn: 11, + endLine: 16, + parent: [Circular], + startColumn: 1, + startLine: 15, + text: `Hard ␊ + line break`, + type: 'paragraph', + }, + ], + endColumn: 11, + endLine: 16, + parent: null, + startColumn: 1, + startLine: 15, + text: `Hard ␊ + line break`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 17, + parent: null, + startColumn: 11, + startLine: 16, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 18, + parent: null, + startColumn: 1, + startLine: 17, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 18, + parent: [Circular], + startColumn: 1, + startLine: 18, + text: '[', + type: 'definitionLabelMarker', + }, + { + children: [ + { + children: [], + endColumn: 6, + endLine: 18, + parent: [Circular], + startColumn: 2, + startLine: 18, + text: 'link', + type: 'data', + }, + ], + endColumn: 6, + endLine: 18, + parent: [Circular], + startColumn: 2, + startLine: 18, + text: 'link', + type: 'definitionLabelString', + }, + { + children: [], + endColumn: 7, + endLine: 18, + parent: [Circular], + startColumn: 6, + startLine: 18, + text: ']', + type: 'definitionLabelMarker', + }, + ], + endColumn: 7, + endLine: 18, + parent: [Circular], + startColumn: 1, + startLine: 18, + text: '[link]', + type: 'definitionLabel', + }, + { + children: [], + endColumn: 8, + endLine: 18, + parent: [Circular], + startColumn: 7, + startLine: 18, + text: ':', + type: 'definitionMarker', + }, + { + children: [], + endColumn: 9, + endLine: 18, + parent: [Circular], + startColumn: 8, + startLine: 18, + text: ' ', + type: 'lineSuffix', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'data', + }, + ], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'definitionDestinationString', + }, + ], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'definitionDestinationRaw', + }, + ], + endColumn: 33, + endLine: 18, + parent: [Circular], + startColumn: 9, + startLine: 18, + text: 'https://example.com/page', + type: 'definitionDestination', + }, + { + children: [], + endColumn: 34, + endLine: 18, + parent: [Circular], + startColumn: 33, + startLine: 18, + text: ' ', + type: 'lineSuffix', + }, + { + children: [ + { + children: [], + endColumn: 35, + endLine: 18, + parent: [Circular], + startColumn: 34, + startLine: 18, + text: '"', + type: 'definitionTitleMarker', + }, + { + children: [ + { + children: [], + endColumn: 40, + endLine: 18, + parent: [Circular], + startColumn: 35, + startLine: 18, + text: 'Title', + type: 'data', + }, + ], + endColumn: 40, + endLine: 18, + parent: [Circular], + startColumn: 35, + startLine: 18, + text: 'Title', + type: 'definitionTitleString', + }, + { + children: [], + endColumn: 41, + endLine: 18, + parent: [Circular], + startColumn: 40, + startLine: 18, + text: '"', + type: 'definitionTitleMarker', + }, + ], + endColumn: 41, + endLine: 18, + parent: [Circular], + startColumn: 34, + startLine: 18, + text: '"Title"', + type: 'definitionTitle', + }, + ], + endColumn: 41, + endLine: 18, + parent: [Circular], + startColumn: 1, + startLine: 18, + text: '[link]: https://example.com/page "Title"', + type: 'definition', + }, + ], + endColumn: 41, + endLine: 18, + parent: null, + startColumn: 1, + startLine: 18, + text: '[link]: https://example.com/page "Title"', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 19, + parent: null, + startColumn: 41, + startLine: 18, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 20, + parent: null, + startColumn: 1, + startLine: 19, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 20, + parent: [Circular], + startColumn: 1, + startLine: 20, + text: '>', + type: 'blockQuoteMarker', + }, + { + children: [], + endColumn: 3, + endLine: 20, + parent: [Circular], + startColumn: 2, + startLine: 20, + text: ' ', + type: 'blockQuotePrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 20, + parent: [Circular], + startColumn: 1, + startLine: 20, + text: '> ', + type: 'blockQuotePrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 14, + endLine: 20, + parent: [Circular], + startColumn: 3, + startLine: 20, + text: 'Block quote', + type: 'data', + }, + ], + endColumn: 14, + endLine: 20, + parent: [Circular], + startColumn: 3, + startLine: 20, + text: 'Block quote', + type: 'paragraph', + }, + ], + endColumn: 14, + endLine: 20, + parent: [Circular], + startColumn: 3, + startLine: 20, + text: 'Block quote', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 21, + parent: [Circular], + startColumn: 14, + startLine: 20, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 2, + endLine: 21, + parent: [Circular], + startColumn: 1, + startLine: 21, + text: '>', + type: 'blockQuoteMarker', + }, + { + children: [], + endColumn: 3, + endLine: 21, + parent: [Circular], + startColumn: 2, + startLine: 21, + text: ' ', + type: 'blockQuotePrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 21, + parent: [Circular], + startColumn: 1, + startLine: 21, + text: '> ', + type: 'blockQuotePrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 21, + parent: [Circular], + startColumn: 3, + startLine: 21, + text: '>', + type: 'blockQuoteMarker', + }, + { + children: [], + endColumn: 5, + endLine: 21, + parent: [Circular], + startColumn: 4, + startLine: 21, + text: ' ', + type: 'blockQuotePrefixWhitespace', + }, + ], + endColumn: 5, + endLine: 21, + parent: [Circular], + startColumn: 3, + startLine: 21, + text: '> ', + type: 'blockQuotePrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 5, + startLine: 21, + text: 'Nested', + type: 'data', + }, + ], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 5, + startLine: 21, + text: 'Nested', + type: 'paragraph', + }, + ], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 5, + startLine: 21, + text: 'Nested', + type: 'content', + }, + ], + endColumn: 11, + endLine: 21, + parent: [Circular], + startColumn: 3, + startLine: 21, + text: '> Nested', + type: 'blockQuote', + }, + ], + endColumn: 11, + endLine: 21, + parent: null, + startColumn: 1, + startLine: 20, + text: `> Block quote␊ + > > Nested`, + type: 'blockQuote', + }, + { + children: [], + endColumn: 1, + endLine: 22, + parent: null, + startColumn: 11, + startLine: 21, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 23, + parent: null, + startColumn: 1, + startLine: 22, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 23, + parent: [Circular], + startColumn: 1, + startLine: 23, + text: '-', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 3, + endLine: 23, + parent: [Circular], + startColumn: 2, + startLine: 23, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 23, + parent: [Circular], + startColumn: 1, + startLine: 23, + text: '- ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 12, + endLine: 23, + parent: [Circular], + startColumn: 3, + startLine: 23, + text: 'Unordered', + type: 'data', + }, + ], + endColumn: 12, + endLine: 23, + parent: [Circular], + startColumn: 3, + startLine: 23, + text: 'Unordered', + type: 'paragraph', + }, + ], + endColumn: 12, + endLine: 23, + parent: [Circular], + startColumn: 3, + startLine: 23, + text: 'Unordered', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 24, + parent: [Circular], + startColumn: 12, + startLine: 23, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 2, + endLine: 24, + parent: [Circular], + startColumn: 1, + startLine: 24, + text: '-', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 3, + endLine: 24, + parent: [Circular], + startColumn: 2, + startLine: 24, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 3, + endLine: 24, + parent: [Circular], + startColumn: 1, + startLine: 24, + text: '- ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 7, + endLine: 24, + parent: [Circular], + startColumn: 3, + startLine: 24, + text: 'List', + type: 'data', + }, + ], + endColumn: 7, + endLine: 24, + parent: [Circular], + startColumn: 3, + startLine: 24, + text: 'List', + type: 'paragraph', + }, + ], + endColumn: 7, + endLine: 24, + parent: [Circular], + startColumn: 3, + startLine: 24, + text: 'List', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 25, + parent: [Circular], + startColumn: 7, + startLine: 24, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 3, + endLine: 25, + parent: [Circular], + startColumn: 1, + startLine: 25, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 25, + parent: [Circular], + startColumn: 3, + startLine: 25, + text: '-', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 5, + endLine: 25, + parent: [Circular], + startColumn: 4, + startLine: 25, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 5, + endLine: 25, + parent: [Circular], + startColumn: 3, + startLine: 25, + text: '- ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 10, + endLine: 25, + parent: [Circular], + startColumn: 5, + startLine: 25, + text: 'Items', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 26, + parent: [Circular], + startColumn: 10, + startLine: 25, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 3, + endLine: 26, + parent: [Circular], + startColumn: 1, + startLine: 26, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 5, + endLine: 26, + parent: [Circular], + startColumn: 3, + startLine: 26, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 13, + endLine: 26, + parent: [Circular], + startColumn: 5, + startLine: 26, + text: 'Indented', + type: 'data', + }, + ], + endColumn: 13, + endLine: 26, + parent: [Circular], + startColumn: 5, + startLine: 25, + text: `Items␊ + Indented`, + type: 'paragraph', + }, + ], + endColumn: 13, + endLine: 26, + parent: [Circular], + startColumn: 5, + startLine: 25, + text: `Items␊ + Indented`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 27, + parent: [Circular], + startColumn: 13, + startLine: 26, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 28, + parent: [Circular], + startColumn: 1, + startLine: 27, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [], + endColumn: 3, + endLine: 28, + parent: [Circular], + startColumn: 1, + startLine: 28, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 5, + endLine: 28, + parent: [Circular], + startColumn: 3, + startLine: 28, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 5, + startLine: 28, + text: 'Content', + type: 'data', + }, + ], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 5, + startLine: 28, + text: 'Content', + type: 'paragraph', + }, + ], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 5, + startLine: 28, + text: 'Content', + type: 'content', + }, + ], + endColumn: 12, + endLine: 28, + parent: [Circular], + startColumn: 3, + startLine: 25, + text: `- Items␊ + Indented␊ + ␊ + Content`, + type: 'listUnordered', + }, + ], + endColumn: 12, + endLine: 28, + parent: null, + startColumn: 1, + startLine: 23, + text: `- Unordered␊ + - List␊ + - Items␊ + Indented␊ + ␊ + Content`, + type: 'listUnordered', + }, + { + children: [], + endColumn: 1, + endLine: 29, + parent: null, + startColumn: 12, + startLine: 28, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 30, + parent: null, + startColumn: 1, + startLine: 29, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 30, + parent: [Circular], + startColumn: 1, + startLine: 30, + text: '1', + type: 'listItemValue', + }, + { + children: [], + endColumn: 3, + endLine: 30, + parent: [Circular], + startColumn: 2, + startLine: 30, + text: '.', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 4, + endLine: 30, + parent: [Circular], + startColumn: 3, + startLine: 30, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 4, + endLine: 30, + parent: [Circular], + startColumn: 1, + startLine: 30, + text: '1. ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 11, + endLine: 30, + parent: [Circular], + startColumn: 4, + startLine: 30, + text: 'Ordered', + type: 'data', + }, + ], + endColumn: 11, + endLine: 30, + parent: [Circular], + startColumn: 4, + startLine: 30, + text: 'Ordered', + type: 'paragraph', + }, + ], + endColumn: 11, + endLine: 30, + parent: [Circular], + startColumn: 4, + startLine: 30, + text: 'Ordered', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 31, + parent: [Circular], + startColumn: 11, + startLine: 30, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 2, + endLine: 31, + parent: [Circular], + startColumn: 1, + startLine: 31, + text: '2', + type: 'listItemValue', + }, + { + children: [], + endColumn: 3, + endLine: 31, + parent: [Circular], + startColumn: 2, + startLine: 31, + text: '.', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 4, + endLine: 31, + parent: [Circular], + startColumn: 3, + startLine: 31, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 4, + endLine: 31, + parent: [Circular], + startColumn: 1, + startLine: 31, + text: '2. ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 8, + endLine: 31, + parent: [Circular], + startColumn: 4, + startLine: 31, + text: 'List', + type: 'data', + }, + ], + endColumn: 8, + endLine: 31, + parent: [Circular], + startColumn: 4, + startLine: 31, + text: 'List', + type: 'paragraph', + }, + ], + endColumn: 8, + endLine: 31, + parent: [Circular], + startColumn: 4, + startLine: 31, + text: 'List', + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 32, + parent: [Circular], + startColumn: 8, + startLine: 31, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 4, + endLine: 32, + parent: [Circular], + startColumn: 1, + startLine: 32, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 5, + endLine: 32, + parent: [Circular], + startColumn: 4, + startLine: 32, + text: '1', + type: 'listItemValue', + }, + { + children: [], + endColumn: 6, + endLine: 32, + parent: [Circular], + startColumn: 5, + startLine: 32, + text: '.', + type: 'listItemMarker', + }, + { + children: [], + endColumn: 7, + endLine: 32, + parent: [Circular], + startColumn: 6, + startLine: 32, + text: ' ', + type: 'listItemPrefixWhitespace', + }, + ], + endColumn: 7, + endLine: 32, + parent: [Circular], + startColumn: 4, + startLine: 32, + text: '1. ', + type: 'listItemPrefix', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 12, + endLine: 32, + parent: [Circular], + startColumn: 7, + startLine: 32, + text: 'Items', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 33, + parent: [Circular], + startColumn: 12, + startLine: 32, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 4, + endLine: 33, + parent: [Circular], + startColumn: 1, + startLine: 33, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 7, + endLine: 33, + parent: [Circular], + startColumn: 4, + startLine: 33, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 15, + endLine: 33, + parent: [Circular], + startColumn: 7, + startLine: 33, + text: 'Indented', + type: 'data', + }, + ], + endColumn: 15, + endLine: 33, + parent: [Circular], + startColumn: 7, + startLine: 32, + text: `Items␊ + Indented`, + type: 'paragraph', + }, + ], + endColumn: 15, + endLine: 33, + parent: [Circular], + startColumn: 7, + startLine: 32, + text: `Items␊ + Indented`, + type: 'content', + }, + { + children: [], + endColumn: 1, + endLine: 34, + parent: [Circular], + startColumn: 15, + startLine: 33, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 35, + parent: [Circular], + startColumn: 1, + startLine: 34, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [], + endColumn: 4, + endLine: 35, + parent: [Circular], + startColumn: 1, + startLine: 35, + text: ' ', + type: 'listItemIndent', + }, + { + children: [], + endColumn: 7, + endLine: 35, + parent: [Circular], + startColumn: 4, + startLine: 35, + text: ' ', + type: 'listItemIndent', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 7, + startLine: 35, + text: 'Content', + type: 'data', + }, + ], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 7, + startLine: 35, + text: 'Content', + type: 'paragraph', + }, + ], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 7, + startLine: 35, + text: 'Content', + type: 'content', + }, + ], + endColumn: 14, + endLine: 35, + parent: [Circular], + startColumn: 4, + startLine: 32, + text: `1. Items␊ + Indented␊ + ␊ + Content`, + type: 'listOrdered', + }, + ], + endColumn: 14, + endLine: 35, + parent: null, + startColumn: 1, + startLine: 30, + text: `1. Ordered␊ + 2. List␊ + 1. Items␊ + Indented␊ + ␊ + Content`, + type: 'listOrdered', + }, + { + children: [], + endColumn: 1, + endLine: 36, + parent: null, + startColumn: 14, + startLine: 35, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 37, + parent: null, + startColumn: 1, + startLine: 36, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 37, + parent: [Circular], + startColumn: 1, + startLine: 37, + text: '```', + type: 'codeFencedFenceSequence', + }, + { + children: [ + { + children: [], + endColumn: 12, + endLine: 37, + parent: [Circular], + startColumn: 4, + startLine: 37, + text: 'markdown', + type: 'data', + }, + ], + endColumn: 12, + endLine: 37, + parent: [Circular], + startColumn: 4, + startLine: 37, + text: 'markdown', + type: 'codeFencedFenceInfo', + }, + { + children: [], + endColumn: 13, + endLine: 37, + parent: [Circular], + startColumn: 12, + startLine: 37, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 20, + endLine: 37, + parent: [Circular], + startColumn: 13, + startLine: 37, + text: 'options', + type: 'data', + }, + ], + endColumn: 20, + endLine: 37, + parent: [Circular], + startColumn: 13, + startLine: 37, + text: 'options', + type: 'codeFencedFenceMeta', + }, + ], + endColumn: 20, + endLine: 37, + parent: [Circular], + startColumn: 1, + startLine: 37, + text: '```markdown options', + type: 'codeFencedFence', + }, + { + children: [], + endColumn: 1, + endLine: 38, + parent: [Circular], + startColumn: 20, + startLine: 37, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 18, + endLine: 38, + parent: [Circular], + startColumn: 1, + startLine: 38, + text: 'Fenced code block', + type: 'codeFlowValue', + }, + { + children: [], + endColumn: 1, + endLine: 39, + parent: [Circular], + startColumn: 18, + startLine: 38, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 4, + endLine: 39, + parent: [Circular], + startColumn: 1, + startLine: 39, + text: '```', + type: 'codeFencedFenceSequence', + }, + ], + endColumn: 4, + endLine: 39, + parent: [Circular], + startColumn: 1, + startLine: 39, + text: '```', + type: 'codeFencedFence', + }, + ], + endColumn: 4, + endLine: 39, + parent: null, + startColumn: 1, + startLine: 37, + text: `\`\`\`markdown options␊ + Fenced code block␊ + \`\`\``, + type: 'codeFenced', + }, + { + children: [], + endColumn: 1, + endLine: 40, + parent: null, + startColumn: 4, + startLine: 39, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 41, + parent: null, + startColumn: 1, + startLine: 40, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 5, + endLine: 41, + parent: [Circular], + startColumn: 1, + startLine: 41, + text: ' ', + type: 'linePrefix', + }, + { + children: [], + endColumn: 24, + endLine: 41, + parent: [Circular], + startColumn: 5, + startLine: 41, + text: 'Indented code block', + type: 'codeFlowValue', + }, + ], + endColumn: 24, + endLine: 41, + parent: null, + startColumn: 1, + startLine: 41, + text: ' Indented code block', + type: 'codeIndented', + }, + { + children: [], + endColumn: 1, + endLine: 42, + parent: null, + startColumn: 24, + startLine: 41, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 43, + parent: null, + startColumn: 1, + startLine: 42, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 4, + endLine: 43, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: '

', + type: 'htmlTextData', + }, + ], + endColumn: 4, + endLine: 43, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: '

', + type: 'htmlText', + }, + { + children: [], + endColumn: 1, + endLine: 44, + parent: [Circular], + startColumn: 4, + startLine: 43, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 11, + endLine: 44, + parent: [Circular], + startColumn: 1, + startLine: 44, + text: 'HTML block', + type: 'data', + }, + { + children: [], + endColumn: 1, + endLine: 45, + parent: [Circular], + startColumn: 11, + startLine: 44, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 45, + text: '

', + type: 'htmlTextData', + }, + ], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 45, + text: '

', + type: 'htmlText', + }, + ], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: `

␊ + HTML block␊ +

`, + type: 'paragraph', + }, + ], + endColumn: 5, + endLine: 45, + parent: [Circular], + startColumn: 1, + startLine: 43, + text: `

␊ + HTML block␊ +

`, + type: 'content', + }, + ], + endColumn: 5, + endLine: 45, + parent: null, + startColumn: 1, + startLine: 43, + text: `

␊ + HTML block␊ +

`, + type: 'htmlFlow', + }, + { + children: [], + endColumn: 1, + endLine: 46, + parent: null, + startColumn: 5, + startLine: 45, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 47, + parent: null, + startColumn: 1, + startLine: 46, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 47, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 3, + endLine: 47, + parent: [Circular], + startColumn: 2, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 8, + endLine: 47, + parent: [Circular], + startColumn: 3, + startLine: 47, + text: 'Table', + type: 'data', + }, + ], + endColumn: 8, + endLine: 47, + parent: [Circular], + startColumn: 3, + startLine: 47, + text: 'Table', + type: 'tableContent', + }, + { + children: [], + endColumn: 9, + endLine: 47, + parent: [Circular], + startColumn: 8, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + ], + endColumn: 9, + endLine: 47, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: '| Table ', + type: 'tableHeader', + }, + { + children: [ + { + children: [], + endColumn: 10, + endLine: 47, + parent: [Circular], + startColumn: 9, + startLine: 47, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 11, + endLine: 47, + parent: [Circular], + startColumn: 10, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 18, + endLine: 47, + parent: [Circular], + startColumn: 11, + startLine: 47, + text: 'Heading', + type: 'data', + }, + ], + endColumn: 18, + endLine: 47, + parent: [Circular], + startColumn: 11, + startLine: 47, + text: 'Heading', + type: 'tableContent', + }, + { + children: [], + endColumn: 19, + endLine: 47, + parent: [Circular], + startColumn: 18, + startLine: 47, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 20, + endLine: 47, + parent: [Circular], + startColumn: 19, + startLine: 47, + text: '|', + type: 'tableCellDivider', + }, + ], + endColumn: 20, + endLine: 47, + parent: [Circular], + startColumn: 9, + startLine: 47, + text: '| Heading |', + type: 'tableHeader', + }, + ], + endColumn: 20, + endLine: 47, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: '| Table | Heading |', + type: 'tableRow', + }, + { + children: [], + endColumn: 1, + endLine: 48, + parent: [Circular], + startColumn: 20, + startLine: 47, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 48, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 3, + endLine: 48, + parent: [Circular], + startColumn: 2, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 8, + endLine: 48, + parent: [Circular], + startColumn: 3, + startLine: 48, + text: '-----', + type: 'tableDelimiterFiller', + }, + ], + endColumn: 8, + endLine: 48, + parent: [Circular], + startColumn: 3, + startLine: 48, + text: '-----', + type: 'tableContent', + }, + { + children: [], + endColumn: 9, + endLine: 48, + parent: [Circular], + startColumn: 8, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + ], + endColumn: 9, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 48, + text: '| ----- ', + type: 'tableDelimiter', + }, + { + children: [ + { + children: [], + endColumn: 10, + endLine: 48, + parent: [Circular], + startColumn: 9, + startLine: 48, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 11, + endLine: 48, + parent: [Circular], + startColumn: 10, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 18, + endLine: 48, + parent: [Circular], + startColumn: 11, + startLine: 48, + text: '-------', + type: 'tableDelimiterFiller', + }, + ], + endColumn: 18, + endLine: 48, + parent: [Circular], + startColumn: 11, + startLine: 48, + text: '-------', + type: 'tableContent', + }, + { + children: [], + endColumn: 19, + endLine: 48, + parent: [Circular], + startColumn: 18, + startLine: 48, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 19, + startLine: 48, + text: '|', + type: 'tableCellDivider', + }, + ], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 9, + startLine: 48, + text: '| ------- |', + type: 'tableDelimiter', + }, + ], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 48, + text: '| ----- | ------- |', + type: 'tableDelimiterRow', + }, + ], + endColumn: 20, + endLine: 48, + parent: [Circular], + startColumn: 1, + startLine: 47, + text: `| Table | Heading |␊ + | ----- | ------- |`, + type: 'tableHead', + }, + { + children: [], + endColumn: 1, + endLine: 49, + parent: [Circular], + startColumn: 20, + startLine: 48, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [ + { + children: [ + { + children: [ + { + children: [], + endColumn: 2, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 3, + endLine: 49, + parent: [Circular], + startColumn: 2, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 8, + endLine: 49, + parent: [Circular], + startColumn: 3, + startLine: 49, + text: 'Table', + type: 'data', + }, + ], + endColumn: 8, + endLine: 49, + parent: [Circular], + startColumn: 3, + startLine: 49, + text: 'Table', + type: 'tableContent', + }, + { + children: [], + endColumn: 9, + endLine: 49, + parent: [Circular], + startColumn: 8, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + ], + endColumn: 9, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '| Table ', + type: 'tableData', + }, + { + children: [ + { + children: [], + endColumn: 10, + endLine: 49, + parent: [Circular], + startColumn: 9, + startLine: 49, + text: '|', + type: 'tableCellDivider', + }, + { + children: [], + endColumn: 11, + endLine: 49, + parent: [Circular], + startColumn: 10, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + { + children: [ + { + children: [], + endColumn: 15, + endLine: 49, + parent: [Circular], + startColumn: 11, + startLine: 49, + text: 'Cell', + type: 'data', + }, + ], + endColumn: 15, + endLine: 49, + parent: [Circular], + startColumn: 11, + startLine: 49, + text: 'Cell', + type: 'tableContent', + }, + { + children: [], + endColumn: 19, + endLine: 49, + parent: [Circular], + startColumn: 15, + startLine: 49, + text: ' ', + type: 'whitespace', + }, + { + children: [], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 19, + startLine: 49, + text: '|', + type: 'tableCellDivider', + }, + ], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 9, + startLine: 49, + text: '| Cell |', + type: 'tableData', + }, + ], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '| Table | Cell |', + type: 'tableRow', + }, + ], + endColumn: 20, + endLine: 49, + parent: [Circular], + startColumn: 1, + startLine: 49, + text: '| Table | Cell |', + type: 'tableBody', + }, + ], + endColumn: 20, + endLine: 49, + parent: null, + startColumn: 1, + startLine: 47, + text: `| Table | Heading |␊ + | ----- | ------- |␊ + | Table | Cell |`, + type: 'table', + }, + { + children: [], + endColumn: 1, + endLine: 50, + parent: null, + startColumn: 20, + startLine: 49, + text: `␊ + `, + type: 'lineEnding', + }, + { + children: [], + endColumn: 1, + endLine: 51, + parent: null, + startColumn: 1, + startLine: 50, + text: `␊ + `, + type: 'lineEndingBlank', + }, + { + children: [ + { + children: [], + endColumn: 35, + endLine: 51, + parent: [Circular], + startColumn: 1, + startLine: 51, + text: '', + type: 'htmlFlowData', + }, + ], + endColumn: 35, + endLine: 51, + parent: null, + startColumn: 1, + startLine: 51, + text: '', + type: 'htmlFlow', + }, + { + children: [], + endColumn: 1, + endLine: 52, + parent: null, + startColumn: 35, + startLine: 51, + text: `␊ + `, + type: 'lineEnding', + }, + ] diff --git a/test/snapshots/markdownlint-test-micromark.mjs.snap b/test/snapshots/markdownlint-test-micromark.mjs.snap new file mode 100644 index 00000000..eeda3422 Binary files /dev/null and b/test/snapshots/markdownlint-test-micromark.mjs.snap differ diff --git a/test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.md b/test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.md new file mode 100644 index 00000000..be86a19c --- /dev/null +++ b/test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.md @@ -0,0 +1,20 @@ +# Snapshot report for `test/markdownlint-test-repos-dotnet-docs.mjs` + +The actual snapshot is saved in `markdownlint-test-repos-dotnet-docs.mjs.snap`. + +Generated by [AVA](https://avajs.dev). + +## https://github.com/dotnet/docs + +> Expected linting violations + + `test-repos/dotnet-docs/README.md:21:383 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]␊ + test-repos/dotnet-docs/README.md:39:451 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]␊ + test-repos/dotnet-docs/SECURITY.md:21:1 error MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]␊ + test-repos/dotnet-docs/SECURITY.md:22:1 error MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]␊ + test-repos/dotnet-docs/SECURITY.md:23:1 error MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]␊ + test-repos/dotnet-docs/SECURITY.md:24:1 error MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]␊ + test-repos/dotnet-docs/SECURITY.md:25:1 error MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]␊ + test-repos/dotnet-docs/SECURITY.md:26:1 error MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]␊ + test-repos/dotnet-docs/SECURITY.md:27:1 error MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]␊ + test-repos/dotnet-docs/SECURITY.md:17:252 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]` diff --git a/test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.snap b/test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.snap new file mode 100644 index 00000000..7f95115b Binary files /dev/null and b/test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.snap differ diff --git a/test/snapshots/markdownlint-test-repos-mdn-content.mjs.md b/test/snapshots/markdownlint-test-repos-mdn-content.mjs.md new file mode 100644 index 00000000..ce511ed6 --- /dev/null +++ b/test/snapshots/markdownlint-test-repos-mdn-content.mjs.md @@ -0,0 +1,11 @@ +# Snapshot report for `test/markdownlint-test-repos-mdn-content.mjs` + +The actual snapshot is saved in `markdownlint-test-repos-mdn-content.mjs.snap`. + +Generated by [AVA](https://avajs.dev). + +## https://github.com/mdn/content + +> Expected linting violations + + '' diff --git a/test/snapshots/markdownlint-test-repos-mdn-content.mjs.snap b/test/snapshots/markdownlint-test-repos-mdn-content.mjs.snap new file mode 100644 index 00000000..24d00423 Binary files /dev/null and b/test/snapshots/markdownlint-test-repos-mdn-content.mjs.snap differ diff --git a/test/snapshots/markdownlint-test-repos-small.mjs.md b/test/snapshots/markdownlint-test-repos-small.mjs.md new file mode 100644 index 00000000..93530931 --- /dev/null +++ b/test/snapshots/markdownlint-test-repos-small.mjs.md @@ -0,0 +1,683 @@ +# Snapshot report for `test/markdownlint-test-repos-small.mjs` + +The actual snapshot is saved in `markdownlint-test-repos-small.mjs.snap`. + +Generated by [AVA](https://avajs.dev). + +## https://github.com/apache/airflow + +> Expected linting violations + + `test-repos/apache-airflow/clients/python/CHANGELOG.md:41 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v3.1.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:77 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v3.0.2"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:95 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v3.0.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:147 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.10.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:167 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.9.1"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:174 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.9.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:193 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.8.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:216 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.7.3"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:227 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.7.2"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:243 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.7.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:266 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.6.2"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:282 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.6.1"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:298 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.6.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:321 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.5.1"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:337 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.5.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:357 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.3.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:375 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.2.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:396 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.1.0"]␊ + test-repos/apache-airflow/clients/python/CHANGELOG.md:417 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "v2.0.0"]␊ + test-repos/apache-airflow/clients/python/README.md:22 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Overview"]␊ + test-repos/apache-airflow/clients/python/README.md:135 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Trying the API"]␊ + test-repos/apache-airflow/clients/python/README.md:176 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Authentication"]␊ + test-repos/apache-airflow/clients/python/README.md:186 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Errors"]␊ + test-repos/apache-airflow/clients/python/README.md:350:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:350:43 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:351:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:351:60 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:352:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:352:128 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:353:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:353:171 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:354:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:354:194 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:355:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:355:186 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:356:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:356:104 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:357:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:357:136 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:358:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:358:125 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:359:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:359:121 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:360:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:360:159 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:361:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:361:96 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:362:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:362:182 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:363:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:363:174 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:364:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:364:141 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:365:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:365:141 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:366:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:366:121 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:367:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:367:153 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:368:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:368:125 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:369:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:369:117 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:370:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:370:137 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:371:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:371:145 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:372:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:372:98 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:373:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:373:150 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:374:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:374:131 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:375:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:375:169 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:376:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:376:151 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:377:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:377:139 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:378:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:378:126 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:379:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:379:147 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:380:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:380:127 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:381:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:381:132 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:382:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:382:102 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:383:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:383:90 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:384:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:384:122 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:385:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:385:99 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:386:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:386:84 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:387:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:387:98 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:388:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:388:92 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:389:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:389:143 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:390:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:390:123 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:391:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:391:142 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:392:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:392:141 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:393:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:393:129 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:394:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:394:119 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:395:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:395:158 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:396:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:396:191 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:397:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:397:238 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:398:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:398:137 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:399:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:399:129 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:400:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:400:129 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:401:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:401:113 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:402:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:402:157 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:403:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:403:143 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:404:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:404:132 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:405:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:405:129 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:406:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:406:117 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:407:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:407:179 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:408:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:408:150 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:409:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:409:135 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:410:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:410:84 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:411:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:411:85 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:412:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:412:89 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:413:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:413:108 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:414:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:414:102 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:415:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:415:95 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:416:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:416:111 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:417:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:417:99 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:418:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:418:90 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:419:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:419:107 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:420:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:420:91 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:421:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:421:114 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:422:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:422:111 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:423:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:423:104 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:424:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:424:183 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:425:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:425:171 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:426:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:426:216 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:427:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:427:240 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:428:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:428:276 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:429:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:429:218 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:430:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:430:183 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:431:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:431:235 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:432:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:432:273 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:433:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:433:207 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:434:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:434:243 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:435:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:435:176 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:436:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:436:200 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:437:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:437:191 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:438:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:438:229 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:439:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:439:223 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:440:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:440:261 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:441:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:441:182 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:442:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:442:119 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:443:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:443:138 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:444:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:444:126 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:445:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:445:114 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:446:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:446:134 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:447:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:447:115 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:448:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:448:104 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:449:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:449:180 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:450:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:450:176 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:451:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:451:181 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/clients/python/README.md:452:1 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe]␊ + test-repos/apache-airflow/clients/python/README.md:452:192 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe]␊ + test-repos/apache-airflow/dev/MANUALLY_BUILDING_IMAGES.md:76:32 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/apache-airflow/dev/MANUALLY_GENERATING_IMAGE_CACHE_AND_CONSTRAINTS.md:114:32 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/apache-airflow/dev/PROJECT_GUIDELINES.md:42:3 error MD059/descriptive-link-text Link text should be descriptive [Context: "[Link]"]␊ + test-repos/apache-airflow/generated/README.md:23:43 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/apache-airflow/providers/amazon/tests/system/amazon/CONTRIBUTING.md:30 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Scope"]␊ + test-repos/apache-airflow/providers/amazon/tests/system/amazon/CONTRIBUTING.md:38 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Tenants"]␊ + test-repos/apache-airflow/providers/amazon/tests/system/amazon/CONTRIBUTING.md:143 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Conventions"]␊ + test-repos/apache-airflow/providers/apache/beam/src/airflow/providers/apache/beam/README.md:61 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Provider classes summary"]␊ + test-repos/apache-airflow/providers/common/sql/src/airflow/providers/common/sql/README_API.md:61 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Verifying other providers to u..."]␊ + test-repos/apache-airflow/providers/common/sql/src/airflow/providers/common/sql/README_API.md:71 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "External usage, tracking API c..."]␊ + test-repos/apache-airflow/providers/common/sql/src/airflow/providers/common/sql/README_API.md:81 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Possible future work"]␊ + test-repos/apache-airflow/providers/google/tests/system/google/README.md:77:4 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/apache-airflow/scripts/in_container/quarantine_issue_header.md:29 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Status update"]␊ + test-repos/apache-airflow/scripts/in_container/quarantine_issue_header.md:33 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "List of Quarantined issues"]` + +## https://github.com/electron/electron + +> Expected linting violations + + `test-repos/electron-electron/docs/api/structures/notification-action.md:10:163 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/api/structures/notification-action.md:10:431 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/breaking-changes.md:2356:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/electron-electron/docs/breaking-changes.md:2356:12 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]␊ + test-repos/electron-electron/docs/breaking-changes.md:2356:12 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/electron-electron/docs/breaking-changes.md:2356:33 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]␊ + test-repos/electron-electron/docs/breaking-changes.md:2356:33 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/electron-electron/docs/breaking-changes.md:2356:47 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:12:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:13:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:14:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:15:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:16:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:17:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:18:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:19:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:20:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:21:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:22:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:23:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:24:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/electron-timelines.md:25:10 error MD060/table-column-style Table column style [Table pipe has extra space to the right for style "compact"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:32:208 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:33:182 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:34:45 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:34:56 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:34:66 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:34:368 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:35:49 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:35:60 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:35:70 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/esm.md:35:369 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:30:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:30:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:31:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:31:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:32:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:32:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:33:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:33:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:34:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:34:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:35:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:35:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:36:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/examples.md:36:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/electron-electron/docs/tutorial/menus.md:203:32 error MD052/reference-links-images Reference links and images should use a label that is defined [Missing link or image reference definition: "sharemenu"] [Context: "[share menu][ShareMenu]"]` + +## https://github.com/eslint/eslint + +> Expected linting violations + + `test-repos/eslint-eslint/docs/src/extend/custom-rule-tutorial.md:502:58 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/eslint-eslint/docs/src/extend/custom-rules.md:142:65 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/eslint-eslint/docs/src/integrate/integration-tutorial.md:278:2 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]` + +## https://github.com/mkdocs/mkdocs + +> Expected linting violations + + '' + +## https://github.com/mochajs/mocha + +> Expected linting violations + + `test-repos/mochajs-mocha/.github/CODE_OF_CONDUCT.md:63:59 error MD034/no-bare-urls Bare URL used [Context: "report@lists.openjsf.org"]␊ + test-repos/mochajs-mocha/.github/CONTRIBUTING.md:42:110 error MD051/link-fragments Link fragments should be valid [Context: "[⚽️ About Project Goals](#⚽️-about-project-goals)"]␊ + test-repos/mochajs-mocha/docs/changelogs/CHANGELOG_V3_older.md:207:127 error MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊ + test-repos/mochajs-mocha/docs/index.md:34:3 error MD051/link-fragments Link fragments should be valid [Context: "[global variable leak detection](#-check-leaks)"]␊ + test-repos/mochajs-mocha/docs/index.md:35:3 error MD051/link-fragments Link fragments should be valid [Context: "[optionally run tests that match a regexp](#-grep-regexp-g-regexp)"]␊ + test-repos/mochajs-mocha/docs/index.md:36:3 error MD051/link-fragments Link fragments should be valid [Context: "[auto-exit to prevent "hanging" with an active loop](#-exit)"]␊ + test-repos/mochajs-mocha/docs/index.md:38:3 error MD051/link-fragments Link fragments should be valid [Context: "[config file support](#-config-path)"]␊ + test-repos/mochajs-mocha/docs/index.md:39:3 error MD051/link-fragments Link fragments should be valid [Context: "[node debugger support](#-inspect-inspect-brk-inspect)"]␊ + test-repos/mochajs-mocha/docs/index.md:41:3 error MD051/link-fragments Link fragments should be valid [Context: "[source-map support](#-enable-source-maps)"]␊ + test-repos/mochajs-mocha/docs/index.md:47:3 error MD051/link-fragments Link fragments should be valid [Context: "[arbitrary transpiler support (coffee-script etc)](#-compilers)"]␊ + test-repos/mochajs-mocha/docs/index.md:1268:32 error MD051/link-fragments Link fragments should be valid [Context: "[\`--parallel\`](#-parallel-p)"]␊ + test-repos/mochajs-mocha/docs/index.md:1286:66 error MD051/link-fragments Link fragments should be valid [Context: "[\`--node-option\`](#-node-option-name-n-name)"]␊ + test-repos/mochajs-mocha/docs/index.md:1307:80 error MD051/link-fragments Link fragments should be valid [Context: "[\`--node-option\`](#-node-option-name-n-name)"]␊ + test-repos/mochajs-mocha/docs/index.md:1313:140 error MD051/link-fragments Link fragments should be valid [Context: "[\`--parallel\`](#-parallel-p)"]␊ + test-repos/mochajs-mocha/docs/index.md:1338:8 error MD051/link-fragments Link fragments should be valid [Context: "[\`--grep\`](#-grep-regexp-g-regexp)"]␊ + test-repos/mochajs-mocha/docs/index.md:1338:46 error MD051/link-fragments Link fragments should be valid [Context: "[\`--fgrep\`](#-fgrep-string-f-string)"]␊ + test-repos/mochajs-mocha/docs/index.md:1349:3 error MD051/link-fragments Link fragments should be valid [Context: "[\`--file\`](#-file-file)"]␊ + test-repos/mochajs-mocha/docs/index.md:1350:3 error MD051/link-fragments Link fragments should be valid [Context: "[\`--sort\`](#-sort-s)"]␊ + test-repos/mochajs-mocha/docs/index.md:1356:253 error MD051/link-fragments Link fragments should be valid [Context: "[globally](#-timeout-ms-t-ms)"]␊ + test-repos/mochajs-mocha/docs/index.md:1417:58 error MD051/link-fragments Link fragments should be valid [Context: "[\`--parallel\`](#-parallel-p)"]␊ + test-repos/mochajs-mocha/docs/index.md:1424:115 error MD051/link-fragments Link fragments should be valid [Context: "[\`--timeout\`](#-timeout-ms-t-ms)"]␊ + test-repos/mochajs-mocha/docs/index.md:1434:69 error MD051/link-fragments Link fragments should be valid [Context: "[job count](#-jobs-count-j-count)"]␊ + test-repos/mochajs-mocha/docs/index.md:1448:54 error MD051/link-fragments Link fragments should be valid [Context: "[\`--require\`](#-require-module-r-module)"]␊ + test-repos/mochajs-mocha/docs/index.md:1658:112 error MD051/link-fragments Link fragments should be valid [Context: "[\`--parallel\`](#-parallel-p)"]␊ + test-repos/mochajs-mocha/docs/index.md:2138:3 error MD051/link-fragments Link fragments should be valid [Context: "[Watch mode](#-watch-w)"]␊ + test-repos/mochajs-mocha/docs/index.md:2437:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "caniuse-notifications"] [Context: "[caniuse-notifications]: https..."]␊ + test-repos/mochajs-mocha/docs/index.md:2438:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "caniuse-promises"] [Context: "[caniuse-promises]: https://ca..."]␊ + test-repos/mochajs-mocha/docs/index.md:2469:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "mocha-website"] [Context: "[mocha-website]: https://mocha..."]␊ + test-repos/mochajs-mocha/docs/index.md:2236:124 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/mochajs-mocha/docs/index.md:2308:81 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/mochajs-mocha/PROJECT_CHARTER.md:51:153 error MD051/link-fragments Link fragments should be valid [Context: "[§2: Scope](#%c2%a72-scope)"]␊ + test-repos/mochajs-mocha/PROJECT_CHARTER.md:56:93 error MD051/link-fragments Link fragments should be valid [Context: "[§2: Scope](#%c2%a72-scope)"]␊ + test-repos/mochajs-mocha/README.md:39:46 error MD045/no-alt-text Images should have alternate text (alt text)` + +## https://github.com/pi-hole/docs + +> Expected linting violations + + '' + +## https://github.com/v8/v8.dev + +> Expected linting violations + + `test-repos/v8-v8-dev/src/blog/adaptor-frame.md:75:80 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/adaptor-frame.md:77:143 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/adaptor-frame.md:89:183 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/adaptor-frame.md:232:288 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/explicit-compile-hints.md:22:67 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/extras/understanding-ecmascript-part-2-extra.md:13 error MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]␊ + test-repos/v8-v8-dev/src/blog/fast-for-in.md:271 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Internal method | Hand..."]␊ + test-repos/v8-v8-dev/src/blog/fast-for-in.md:277 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| \`[[OwnPropertyKeys]]\` | \`own..."]␊ + test-repos/v8-v8-dev/src/blog/fast-for-in.md:351 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Position | Name ..."]␊ + test-repos/v8-v8-dev/src/blog/fast-for-in.md:369 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| 17 | \`ForInFilter\` ..."]␊ + test-repos/v8-v8-dev/src/blog/fast-super.md:27 error MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]␊ + test-repos/v8-v8-dev/src/blog/high-performance-cpp-gc.md:29:413 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/jspi-ot.md:13:53 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/jspi-ot.md:13:118 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/jspi-ot.md:23:25 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/jspi-ot.md:38:91 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/lazy-unlinking.md:183 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Benchmark | Kind ..."]␊ + test-repos/v8-v8-dev/src/blog/lazy-unlinking.md:188 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| youtube.com | Average size ..."]␊ + test-repos/v8-v8-dev/src/blog/maglev.md:143 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Benchmark | Energy Consump..."]␊ + test-repos/v8-v8-dev/src/blog/maglev.md:146 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Speedometer | -10% ..."]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:84:67 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:85:67 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:86:67 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:87:67 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:133:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:134:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:135:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:136:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:137:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:138:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:156:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:157:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:158:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:159:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:160:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:161:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:162:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:163:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:164:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:165:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:166:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:167:64 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:187:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:188:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:189:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:190:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:191:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:192:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:193:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:194:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:195:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:196:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:197:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:198:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:199:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:200:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:201:66 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:82 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| C++ ..."]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:88 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| \`\`\` ..."]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:131 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| C++ ..."]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:139 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| \`\`\` ..."]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:185 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| C++ ..."]␊ + test-repos/v8-v8-dev/src/blog/oilpan-pointer-compression.md:202 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| \`\`\` ..."]␊ + test-repos/v8-v8-dev/src/blog/optimizing-v8-memory.md:35:290 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:192:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:193:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:194:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:195:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:196:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:197:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:198:76 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:215:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:216:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:217:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:218:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:219:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:220:74 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:330:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:331:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:332:79 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:333:81 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:334:81 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:335:81 error MD055/table-pipe-style Table pipe style [Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:198:74 error MD056/table-column-count Table column count [Expected: 3; Actual: 4; Too many cells, extra data will be missing]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:333:79 error MD056/table-column-count Table column count [Expected: 3; Actual: 4; Too many cells, extra data will be missing]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:334:79 error MD056/table-column-count Table column count [Expected: 3; Actual: 4; Too many cells, extra data will be missing]␊ + test-repos/v8-v8-dev/src/blog/pointer-compression.md:335:79 error MD056/table-column-count Table column count [Expected: 3; Actual: 4; Too many cells, extra data will be missing]␊ + test-repos/v8-v8-dev/src/blog/react-cliff.md:81 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| representation ..."]␊ + test-repos/v8-v8-dev/src/blog/react-cliff.md:87 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| 64-bit IEEE-754 floating-poi..."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:41 error MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "> 3. Return \`? HasOwnProperty(..."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:55 error MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "> 5. Return \`true\`."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:91 error MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "> 1. Return \`! OrdinaryGetOwnP..."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:177 error MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "> 10. Return \`NormalCompletion..."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:191 error MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "> 7. Return \`NormalCompletion(..."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:113 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Name | Description ..."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:117 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| \`[[Target]]\` | Used for dire..."]␊ + test-repos/v8-v8-dev/src/blog/understanding-ecmascript-part-1.md:102:52 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/v8-nodejs.md:29:153 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:46 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| || Des..."]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:53 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| ^^ | GC | -7%..."]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:47:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:48:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:49:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:50:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:51:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:52:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-80.md:53:15 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/blog/v8-release-86.md:16:371 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/wasm-decompile.md:153:61 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/wasm-decompile.md:153:206 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/blog/wasm-decompile.md:153:413 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/docs/become-committer.md:34:141 error MD034/no-bare-urls Bare URL used [Context: "v8-committers@chromium.org"]␊ + test-repos/v8-v8-dev/src/docs/become-committer.md:44:326 error MD034/no-bare-urls Bare URL used [Context: "v8-committers@chromium.org"]␊ + test-repos/v8-v8-dev/src/docs/blink-layout-tests.md:11:78 error MD059/descriptive-link-text Link text should be descriptive [Context: "[more]"]␊ + test-repos/v8-v8-dev/src/docs/contribute.md:23:19 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/docs/cross-compile-arm.md:21:93 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/docs/design-review-guidelines.md:41:227 error MD034/no-bare-urls Bare URL used [Context: "v8-eng-review-owners@googlegro..."]␊ + test-repos/v8-v8-dev/src/docs/design-review-guidelines.md:78:50 error MD034/no-bare-urls Bare URL used [Context: "v8-dev@googlegroups.com"]␊ + test-repos/v8-v8-dev/src/docs/design-review-guidelines.md:80:27 error MD034/no-bare-urls Bare URL used [Context: "v8-eng-review-owners@googlegro..."]␊ + test-repos/v8-v8-dev/src/docs/design-review-guidelines.md:126:2 error MD059/descriptive-link-text Link text should be descriptive [Context: "[Here]"]␊ + test-repos/v8-v8-dev/src/docs/feature-launch-process.md:7:79 error MD034/no-bare-urls Bare URL used [Context: "syg@chromium.org"]␊ + test-repos/v8-v8-dev/src/docs/feature-launch-process.md:7:100 error MD034/no-bare-urls Bare URL used [Context: "v8-dev@googlegroups.com"]␊ + test-repos/v8-v8-dev/src/docs/feature-launch-process.md:9:40 error MD034/no-bare-urls Bare URL used [Context: "gdeepti@chromium.org"]␊ + test-repos/v8-v8-dev/src/docs/feature-launch-process.md:9:65 error MD034/no-bare-urls Bare URL used [Context: "v8-dev@googlegroups.com"]␊ + test-repos/v8-v8-dev/src/docs/hidden-classes.md:133:120 error MD059/descriptive-link-text Link text should be descriptive [Context: "[link]"]␊ + test-repos/v8-v8-dev/src/docs/official-support.md:19:15 error MD034/no-bare-urls Bare URL used [Context: "v8-dev@googlegroups.com"]␊ + test-repos/v8-v8-dev/src/docs/respectful-code.md:36 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Term | Suggested altern..."]␊ + test-repos/v8-v8-dev/src/docs/respectful-code.md:45 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| redline | priority line, l..."]␊ + test-repos/v8-v8-dev/src/docs/torque.md:527:341 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/docs/trace.md:5:287 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/v8-v8-dev/src/feature-support.md:11:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/feature-support.md:19:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/feature-support.md:27:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/_intl-locale.md:36:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/array-flat-flatmap.md:77:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/at-method.md:39:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/atomics.md:203:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/atomics.md:211:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/bigint.md:267:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/class-fields.md:194:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/class-fields.md:202:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/class-fields.md:210:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/class-static-initializer-blocks.md:104:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/dynamic-import.md:143:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/error-cause.md:70:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/explicit-resource-management.md:214:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/finding-in-arrays.md:59:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/function-tostring.md:33:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/globalthis.md:43:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/import-assertions.md:84:29 error MD034/no-bare-urls Bare URL used [Context: "https://chromestatus.com/featu..."]␊ + test-repos/v8-v8-dev/src/features/import-assertions.md:88:29 error MD034/no-bare-urls Bare URL used [Context: "https://github.com/babel/babel..."]␊ + test-repos/v8-v8-dev/src/features/import-attributes.md:59:30 error MD034/no-bare-urls Bare URL used [Context: "https://chromestatus.com/featu..."]␊ + test-repos/v8-v8-dev/src/features/import-attributes.md:61:31 error MD034/no-bare-urls Bare URL used [Context: "https://developer.apple.com/do..."]␊ + test-repos/v8-v8-dev/src/features/import-attributes.md:62:32 error MD034/no-bare-urls Bare URL used [Context: "https://nodejs.org/docs/latest..."]␊ + test-repos/v8-v8-dev/src/features/import-attributes.md:63:29 error MD034/no-bare-urls Bare URL used [Context: "https://babeljs.io/blog/2023/0..."]␊ + test-repos/v8-v8-dev/src/features/intl-displaynames.md:110:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-listformat.md:91:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-listformat.md:74 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| Type | Opti..."]␊ + test-repos/v8-v8-dev/src/features/intl-listformat.md:80 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| unit-narrow | \`{ t..."]␊ + test-repos/v8-v8-dev/src/features/intl-numberformat.md:16:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-numberformat.md:58:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-numberformat.md:104:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-numberformat.md:170:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-numberformat.md:234:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-pluralrules.md:126:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/intl-relativetimeformat.md:175:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/iterator-helpers.md:188:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/logical-assignment.md:92:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/modules.md:16:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/nullish-coalescing.md:155:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/numeric-separators.md:58:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/object-fromentries.md:20:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/object-fromentries.md:114:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/object-has-own.md:37:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/object-rest-spread.md:32:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/object-rest-spread.md:91:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/optional-catch-binding.md:37:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/optional-chaining.md:136:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/private-brand-checks.md:122:29 error MD034/no-bare-urls Bare URL used [Context: "https://bugs.chromium.org/p/v8..."]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:35:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:66:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:95:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:120:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:23 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| name ..."]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:28 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| [\`Promise.any\`](#promise.any..."]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:25:172 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/features/promise-combinators.md:28:172 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/v8-v8-dev/src/features/promise-finally.md:82:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/regexp-match-indices.md:134:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/regexp-v-flag.md:254:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/simd.md:217:197 error MD059/descriptive-link-text Link text should be descriptive [Context: "[link]"]␊ + test-repos/v8-v8-dev/src/features/stable-sort.md:76:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/stable-sort.md:84:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/string-matchall.md:92:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/string-replaceall.md:122:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/string-trimming.md:42:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/subsume-json.md:176:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/symbol-description.md:53:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/top-level-await.md:113:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/weak-references.md:232:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊ + test-repos/v8-v8-dev/src/features/well-formed-json-stringify.md:32:1 error MD033/no-inline-html Inline HTML [Element: feature-support]` + +## https://github.com/webhintio/hint + +> Expected linting violations + + `test-repos/webhintio-hint/packages/hint-apple-touch-icons/README.md:198:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "icon scaling"] [Context: "[icon scaling]: https://realfa..."]␊ + test-repos/webhintio-hint/packages/hint-apple-touch-icons/README.md:202:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "web app manifest spec"] [Context: "[web app manifest spec]: https..."]␊ + test-repos/webhintio-hint/packages/hint-axe/README.md:170:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "axe rules"] [Context: "[axe rules]: https://github.co..."]␊ + test-repos/webhintio-hint/packages/hint-compat-api/docs/html.md:153:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "global-attr"] [Context: "[global-attr]: https://develop..."]␊ + test-repos/webhintio-hint/packages/hint-compat-api/README.md:48:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "npm docs"] [Context: "[npm docs]: https://docs.npmjs..."]␊ + test-repos/webhintio-hint/packages/hint-detect-css-reflows/docs/composite.md:73:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "understanding-critical-path"] [Context: "[understanding-critical-path]:..."]␊ + test-repos/webhintio-hint/packages/hint-detect-css-reflows/docs/layout.md:73:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "understanding-critical-path"] [Context: "[understanding-critical-path]:..."]␊ + test-repos/webhintio-hint/packages/hint-detect-css-reflows/docs/paint.md:73:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "understanding-critical-path"] [Context: "[understanding-critical-path]:..."]␊ + test-repos/webhintio-hint/packages/hint-detect-css-reflows/README.md:96:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "understanding-critical-path"] [Context: "[understanding-critical-path]:..."]␊ + test-repos/webhintio-hint/packages/hint-doctype/README.md:130:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "npm docs"] [Context: "[npm docs]: https://docs.npmjs..."]␊ + test-repos/webhintio-hint/packages/hint-highest-available-document-mode/README.md:420:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "mod_mime"] [Context: "[mod_mime]: https://httpd.apac..."]␊ + test-repos/webhintio-hint/packages/hint-http-compression/README.md:1087:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "gzip is not enough"] [Context: "[gzip is not enough]: https://..."]␊ + test-repos/webhintio-hint/packages/hint-meta-viewport/README.md:268:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "mdn viewport meta tag"] [Context: "[mdn viewport meta tag]: https..."]␊ + test-repos/webhintio-hint/packages/hint-meta-viewport/README.md:271:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "ppk initial-scale"] [Context: "[ppk initial-scale]: https://w..."]␊ + test-repos/webhintio-hint/packages/hint-minified-js/README.md:102:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "npm documentation"] [Context: "[NPM documentation]:"]␊ + test-repos/webhintio-hint/packages/hint-no-p3p/README.md:157:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "support"] [Context: "[support]: https://en.wikipedi..."]␊ + test-repos/webhintio-hint/packages/hint-no-protocol-relative-urls/README.md:110:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "ie issue"] [Context: "[ie issue]: https://www.steves..."]␊ + test-repos/webhintio-hint/packages/hint-performance-budget/README.md:198:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "tcp handshake"] [Context: "[tcp handshake]: https://hpbn...."]␊ + test-repos/webhintio-hint/packages/hint-strict-transport-security/README.md:278:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "mod_mime"] [Context: "[mod_mime]: https://httpd.apac..."]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:21:41 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:21:50 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:22:25 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:22:35 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:22:39 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:22:48 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:23:25 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:23:35 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:23:39 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:23:49 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:24:40 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:24:49 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:25:40 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:25:49 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:26:40 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:26:49 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:27:40 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-typescript-config/docs/target.md:27:49 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]␊ + test-repos/webhintio-hint/packages/hint-x-content-type-options/README.md:181:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "fetch spec issue"] [Context: "[fetch spec issue]: https://gi..."]␊ + test-repos/webhintio-hint/packages/hint/docs/about/CONTRIBUTORS.md:10:370 error MD056/table-column-count Table column count [Expected: 3; Actual: 2; Too few cells, row will be missing data]␊ + test-repos/webhintio-hint/packages/hint/docs/about/GOVERNANCE.md:218:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "openjs foundation"] [Context: "[OpenJS Foundation]: https://o..."]␊ + test-repos/webhintio-hint/packages/hint/docs/about/GOVERNANCE.md:219:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "webhint org"] [Context: "[webhint org]: https://github...."]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/getting-started/architecture.md:78:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "typescript"] [Context: "[typescript]: https://www.type..."]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/getting-started/development-environment.md:120:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "npm"] [Context: "[npm]: https://www.npmjs.com/g..."]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/getting-started/development-environment.md:94:11 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/getting-started/development-environment.md:95:11 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/getting-started/development-environment.md:100:71 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/getting-started/development-environment.md:102:54 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/getting-started/development-environment.md:104:13 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/how-to/hint.md:150:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "custom hint"] [Context: "[custom hint]: ../guides/creat..."]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/how-to/hint.md:154:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "npx issue"] [Context: "[npx issue]: https://github.co..."]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/index.md:8:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/contributor-guide/index.md:8:7 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/concepts/hints.md:82:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/concepts/hints.md:82:7 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/concepts/hints.md:113:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/concepts/hints.md:113:7 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/configuring-webhint/summary.md:21:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/configuring-webhint/summary.md:21:7 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/local-server.md:58:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "jenkins"] [Context: "[jenkins]: https://jenkins.io"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/local-server.md:59:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "local-server"] [Context: "[local-server]: #test-a-local-..."]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/local-server.md:62:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "webhint github"] [Context: "[webhint github]: https://gith..."]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/local-server.md:63:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "webhint repo"] [Context: "[webhint repo]: https://github..."]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/local-server.md:64:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "webhint.io"] [Context: "[webhint.io]: https://webhint...."]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/local-server.md:65:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "webhintio repo"] [Context: "[webhintio repo]: https://gith..."]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:4:35 error MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:405:43 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:406:20 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:406:43 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:407:20 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:407:43 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:408:20 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:409:20 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:410:20 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:411:20 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/development-flow-integration/travis-and-azure.md:411:43 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/index.md:178:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "nodejsdownloadcurrent"] [Context: "[NodejsDownloadCurrent]: https..."]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/index.md:49:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/index.md:49:7 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/troubleshoot/summary.md:137:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "githubwebhintiohint308"] [Context: "[GithubWebhintioHint308]: http..."]␊ + test-repos/webhintio-hint/packages/hint/docs/user-guide/troubleshoot/summary.md:141:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "npmjspackageiltorb"] [Context: "[NpmjsPackageIltorb]: https://..."]␊ + test-repos/webhintio-hint/packages/parser-html/README.md:51:1 error MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "events"] [Context: "[events]: https://webhint.io/d..."]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:65:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:65:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:66:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:67:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:67:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:68:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:68:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:69:35 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:70:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:71:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:71:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:72:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:73:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:73:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:74:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:74:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:75:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:75:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:76:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:77:16 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:77:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]␊ + test-repos/webhintio-hint/packages/utils-compat-data/README.md:78:31 error MD060/table-column-style Table column style [Table pipe has extra space to the left for style "compact"]` + +## https://github.com/webpack/webpack.js.org + +> Expected linting violations + + '' diff --git a/test/snapshots/markdownlint-test-repos-small.mjs.snap b/test/snapshots/markdownlint-test-repos-small.mjs.snap new file mode 100644 index 00000000..30407cd8 Binary files /dev/null and b/test/snapshots/markdownlint-test-repos-small.mjs.snap differ diff --git a/test/snapshots/markdownlint-test-scenarios.mjs.md b/test/snapshots/markdownlint-test-scenarios.mjs.md new file mode 100644 index 00000000..393300c4 --- /dev/null +++ b/test/snapshots/markdownlint-test-scenarios.mjs.md @@ -0,0 +1,78342 @@ +# Snapshot report for `test/markdownlint-test-scenarios.mjs` + +The actual snapshot is saved in `markdownlint-test-scenarios.mjs.snap`. + +Generated by [AVA](https://avajs.dev). + +## 4-tabs-MD010.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 13, + ], + fixInfo: { + deleteCount: 13, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 1, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 2, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 35', + errorRange: [ + 35, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 35, + insertText: ' ', + }, + lineNumber: 3, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: ` text {MD010}␊ + text and text 2 {MD010}␊ + texts with trailing spaces {MD010} ␊ + ␊ + ␊ + `, + } + +## MD001-MD010.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h3; Actual: h4', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: dash', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '*', + }, + lineNumber: 10, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 0', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 23, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: (3); Actual: (4)', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 29, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 8, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 12, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 13, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + }, + lineNumber: 15, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 17, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: `## One␊ + ␊ + #### Two {MD001}␊ + ␊ + ### Three {MD003} ###␊ + ␊ + * Alpha␊ + * Bravo {MD005} {MD007}␊ + ␊ + * Charlie {MD004}␊ + ␊ + * Delta {MD007}␊ + * Echo {MD007}␊ + ␊ + Text {MD009}␊ + ␊ + Text text {MD010}␊ + ␊ + 1. One␊ + 2. Two␊ + 3. Three␊ + 4. Four␊ + 5. Five {MD005}␊ + 6. Six␊ + 7. Seven␊ + 8. Eight␊ + 9. Nine␊ + 10. Ten␊ + 11. Eleven {MD005}␊ + 12. Twelve␊ + ␊ + ␊ + `, + } + +## MD011-MD021.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: '(reversed)[link]', + errorRange: [ + 3, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 3, + insertText: '[reversed](link)', + }, + lineNumber: 5, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(reversed)[link]', + errorRange: [ + 11, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 11, + insertText: '[reversed](link)', + }, + lineNumber: 26, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: null, + fixInfo: { + deleteCount: -1, + }, + lineNumber: 7, + ruleDescription: 'Multiple consecutive blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md012.md', + ruleNames: [ + 'MD012', + 'no-multiple-blanks', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 99', + errorRange: [ + 81, + 19, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 40; Actual: 62', + errorRange: [ + 41, + 22, + ], + fixInfo: null, + lineNumber: 10, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: '$ command with no output {MD01...', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 12, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '##No space A {MD018}', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + editColumn: 3, + insertText: ' ', + }, + lineNumber: 14, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## Multiple spaces B {MD019}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 16, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '##No space C {MD020} ##', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 23, + editColumn: 1, + insertText: '## No space C {MD020} ##', + }, + lineNumber: 18, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## No space D {MD020}##', + errorDetail: null, + errorRange: [ + 21, + 3, + ], + fixInfo: { + deleteCount: 23, + editColumn: 1, + insertText: '## No space D {MD020} ##', + }, + lineNumber: 20, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Multiple spaces E {MD021} ...', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 22, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '... Multiple spaces F {MD021} ##', + errorDetail: null, + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 24, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + ], + fixed: `# Top level heading␊ + ␊ + ␊ + ␊ + A [reversed](link) example. {MD011}␊ + ␊ + 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789␊ + ␊ + ## 123456789 123456789 123456789 123456789 123456789 123456789␊ + ␊ + command with no output {MD014}␊ + ␊ + ## No space A {MD018}␊ + ␊ + ## Multiple spaces B {MD019}␊ + ␊ + ## No space C {MD020} ##␊ + ␊ + ## No space D {MD020} ##␊ + ␊ + ## Multiple spaces E {MD021} ##␊ + ␊ + ## Multiple spaces F {MD021} ##␊ + ␊ + *Another* [reversed](link) example. {MD011}␊ + ␊ + {MD012:7} {MD013:8} {MD013:10}␊ + ␊ + ␊ + `, + } + +## MD022-MD030.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '# Heading', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 2, + }, + lineNumber: 1, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: ' # Heading', + errorDetail: null, + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 1, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + { + errorContext: 'Heading', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 4, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'Heading', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 4, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \'.\'', + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 6, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: '> Multiple spaces {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 8, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > Multiple spaces, multiple...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 15, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > > Multiple spaces, multip...', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 17, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > > Multiple spaces, multip...', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 19, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Blank line inside blockquote', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md028.md', + ruleNames: [ + 'MD028', + 'no-blanks-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3; Style: 1/2/3', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '2', + }, + lineNumber: 13, + ruleDescription: 'Ordered list item prefix', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md029.md', + ruleNames: [ + 'MD029', + 'ol-prefix', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 13, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + Text␊ + ␊ + # Heading␊ + ␊ + ## Another heading {MD026}␊ + ␊ + > Multiple spaces {MD027}␊ + ␊ + > Blank line above␊ + ␊ + 1. Alpha␊ + 2. Beta {MD029} {MD030}␊ + ␊ + > > Multiple spaces, multiple blockquotes {MD027}␊ + > >␊ + > > > Multiple spaces, multiple blockquotes {MD027}␊ + > > >␊ + > > > Multiple spaces, multiple blockquotes {MD027}␊ + ␊ + {MD022:1} {MD023:1} {MD024:4} {MD025:4} {MD028:9}␊ + `, + } + +## MD030-warning-message.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 19, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 21, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: '-', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 4, + }, + lineNumber: 3, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1.', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 7, + }, + lineNumber: 6, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + ], + fixed: `#␊ + ␊ + -␊ + ␊ + (bare list item marker {MD032:3})␊ + ␊ + 1.␊ + ␊ + (bare list item marker {MD032:6})␊ + ␊ + -a␊ + (not a list item)␊ + ␊ + 1.a␊ + (not a list item)␊ + ␊ + - a␊ + ␊ + 1. a␊ + ␊ + - a {MD030}␊ + ␊ + 1. a {MD030}␊ + `, + } + +## MD031-MD040.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 4, + }, + lineNumber: 3, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '* List {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 4, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '* List {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 48, + }, + lineNumber: 47, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 7, + 5, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 6, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 6, + insertText: '', + }, + lineNumber: 8, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: 'Emphasis {MD036}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: '* i', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e *', + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* s', + errorDetail: null, + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e *', + errorDetail: null, + errorRange: [ + 22, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 22, + }, + lineNumber: 32, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e **', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '_ s', + errorDetail: null, + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 34, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '__ s', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e __', + errorDetail: null, + errorRange: [ + 26, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 26, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* i', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 62, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e *', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 63, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '` inside`', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` inside``', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 24, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code`', + errorDetail: null, + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` elements`', + errorDetail: null, + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 26, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` code``', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` ` embedded backtick``', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 28, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``embedded backtick` ``', + errorDetail: null, + errorRange: [ + 22, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 22, + }, + lineNumber: 29, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code {MD038} span`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 38, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`code span `', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 44, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '...``code span code span code ```', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 53, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '```` code {MD038} span code sp...', + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + }, + lineNumber: 55, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '[ inside ]', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ inside ]', + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ space]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 60, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[space ]', + errorDetail: null, + errorRange: [ + 32, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 32, + }, + lineNumber: 60, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ space ]', + errorDetail: null, + errorRange: [ + 47, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 47, + }, + lineNumber: 60, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ space ]', + errorDetail: null, + errorRange: [ + 53, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 53, + }, + lineNumber: 60, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + ], + fixed: `\`\`\`js␊ + debugger;␊ + \`\`\`␊ + ␊ + * List {MD032}␊ + ␊ + Inline
HTML {MD033}␊ + ␊ + Bare link {MD034}␊ + ␊ + ---␊ + ***␊ + ␊ + *Emphasis {MD036}*␊ + ␊ + Space *inside* emphasis {MD037}␊ + ␊ + Space \`inside\` code span {MD038}␊ + ␊ + Space [inside](link) text {MD039}␊ + ␊ + \`\`\`␊ + \`\`\`␊ + ␊ + space \`\`inside\`\` code {MD038}␊ + space \`inside\` of \`code\` elements {MD038}␊ + \`space\` inside \`of\` code \`elements\` {MD038}␊ + space \`\`inside\`\` of \`\`code\`\` elements {MD038}␊ + \`\` \` embedded backtick\`\` {MD038}␊ + \`\`embedded backtick\` \`\` {MD038}␊ + ␊ + some *space* in *some* emphasis {MD037}␊ + some *space* in *some* emphasis {MD037}␊ + some *space* in **some** emphasis {MD037}␊ + some _space_ in _some_ emphasis {MD037}␊ + some __space__ in __some__ emphasis {MD037}␊ + ␊ + Text␊ + text \`code {MD038}␊ + span\` text␊ + text.␊ + ␊ + Text␊ + text \`code␊ + span\` text {MD038}␊ + text.␊ + ␊ + * List {MD032}␊ + ␊ + ---␊ + ␊ + Text␊ + text \`\`\`code␊ + span code␊ + span code\`\`\` text {MD038}␊ + text␊ + text text \`\`\`\`code {MD038}␊ + span code␊ + span\`\`\`\` text␊ + text.␊ + ␊ + Text [space](link) text [space](link) text [space](link) text. {MD039}␊ + ␊ + Space *inside {MD037}␊ + multi-line* emphasis. {MD037}␊ + ␊ + {MD031:3} {MD035:11} {MD040:21}␊ + ␊ + ␊ + `, + } + +## MD041-MD050.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Not a heading {MD041}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 1, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + { + errorContext: '[empty]()', + errorDetail: null, + errorRange: [ + 4, + 9, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[empty](#)', + errorDetail: null, + errorRange: [ + 4, + 10, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[empty](<>)', + errorDetail: null, + errorRange: [ + 4, + 11, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[empty one]()', + errorDetail: null, + errorRange: [ + 25, + 13, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '# Heading', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 64, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: MARKDOWNLINT', + errorRange: [ + 29, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 29, + insertText: 'markdownlint', + }, + lineNumber: 9, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: Markdownlint', + errorRange: [ + 7, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 7, + insertText: 'markdownlint', + }, + lineNumber: 12, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: MarkDownLint', + errorRange: [ + 1, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 1, + insertText: 'markdownlint', + }, + lineNumber: 15, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 33, + 14, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 41, + 1, + ], + fixInfo: { + editColumn: 42, + insertText: `␊ + `, + }, + lineNumber: 64, + ruleDescription: 'Files should end with a single newline character', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', + ruleNames: [ + 'MD047', + 'single-trailing-newline', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + insertText: '*', + }, + lineNumber: 31, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 26, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 26, + insertText: '*', + }, + lineNumber: 31, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 49, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 49, + insertText: '*', + }, + lineNumber: 31, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 56, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 56, + insertText: '*', + }, + lineNumber: 31, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '*', + }, + lineNumber: 36, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '*', + }, + lineNumber: 37, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 28, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 28, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 40, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 40, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 47, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 47, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 54, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 54, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 56, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 56, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 68, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 68, + insertText: '*', + }, + lineNumber: 45, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + insertText: '__', + }, + lineNumber: 33, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 36, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 36, + insertText: '__', + }, + lineNumber: 33, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 62, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 62, + insertText: '__', + }, + lineNumber: 33, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 70, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 70, + insertText: '__', + }, + lineNumber: 33, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 8, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 8, + insertText: '__', + }, + lineNumber: 41, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 9, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 9, + insertText: '__', + }, + lineNumber: 42, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 14, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 14, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 22, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 22, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 43, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 43, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 51, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 51, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 59, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 59, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 62, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 62, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 75, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 75, + insertText: '__', + }, + lineNumber: 47, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + ], + fixed: `Not a heading {MD041}␊ + ␊ + An [empty]() link {MD042}␊ + ␊ + An [empty](#) link with fragment {MD042}␊ + ␊ + An [empty](<>) link with angle brackets {MD042}␊ + ␊ + This is a test file for the markdownlint package. {MD044}␊ + ␊ + This is a paragraph␊ + about markdownlint {MD044}␊ + that capitalizes the␊ + name wrong twice:␊ + markdownlint. {MD044}␊ + ␊ + A [normal](link) and an [empty one]() and a [fragment](#one). {MD042}␊ + ␊ + An image without alternate text ![](image.jpg) {MD045}␊ + ␊ + \`\`\`text␊ + Fenced code␊ + \`\`\`␊ + ␊ + Indented code {MD046}␊ + ␊ + ~~~text␊ + Fenced code {MD048:27}␊ + ~~~␊ + ␊ + Mixed *emphasis* on *this* line *with* multiple *issues* {MD049}␊ + ␊ + Mixed __strong emphasis__ on __this__ line __with__ multiple __issues__ {MD050}␊ + ␊ + Inconsistent␊ + emphasis *text {MD049}␊ + spanning* many {MD049}␊ + lines␊ + ␊ + Inconsistent␊ + strong __emphasis {MD050}␊ + spanning__ many {MD050}␊ + lines␊ + ␊ + Inconsistent *double* text *interleaved* text *double* *interleaved* emphasis. {MD049}␊ + ␊ + Inconsistent __double__ text __interleaved__ text __double__ __interleaved__ strong emphasis. {MD050}␊ + ␊ + ␊ + ␊ + Missing newline character {MD043} {MD047}␊ + `, + } + +## MD051-MD060.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[link with a missing](#fragment)', + errorDetail: null, + errorRange: [ + 3, + 32, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[link with a][undefined-label]', + errorDetail: 'Missing link or image reference definition: "undefined-label"', + errorRange: [ + 3, + 30, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[unused-label]: {MD053}', + errorDetail: 'Unused link or image reference definition: "unused-label"', + errorRange: [ + 1, + 23, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 10, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + ], + fixed: `# detailed-results-MD051-MD060␊ + ␊ + A [link with a missing](#fragment) {MD051}␊ + ␊ + A [link with a][defined-label]␊ + ␊ + A [link with a][undefined-label] {MD052}␊ + ␊ + [defined-label]: https://example.com␊ + `, + } + +## alternate_top_level_heading.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Another one {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `## A level 2 top level heading␊ + ␊ + ## Another one {MD025}␊ + ␊ + ␊ + `, + } + +## atx-heading-spacing-trailing-spaces.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '##Heading 1 {MD018}', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + editColumn: 3, + insertText: ' ', + }, + lineNumber: 5, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 2 {MD019}', + errorDetail: null, + errorRange: [ + 4, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 4, + }, + lineNumber: 7, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '##Heading 3 {MD020} ##', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 24, + editColumn: 1, + insertText: '## Heading 3 {MD020} ##', + }, + lineNumber: 9, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 4 {MD020}##', + errorDetail: null, + errorRange: [ + 20, + 3, + ], + fixInfo: { + deleteCount: 24, + editColumn: 1, + insertText: '## Heading 4 {MD020} ##', + }, + lineNumber: 11, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '##Heading 5 {MD020}##', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 23, + editColumn: 1, + insertText: '## Heading 5 {MD020} ##', + }, + lineNumber: 13, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 5 {MD021} ##', + errorDetail: null, + errorRange: [ + 4, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 4, + }, + lineNumber: 15, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 6 {MD021} ##', + errorDetail: null, + errorRange: [ + 22, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 22, + }, + lineNumber: 17, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 7 {MD021} ##', + errorDetail: null, + errorRange: [ + 4, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 4, + }, + lineNumber: 19, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 7 {MD021} ##', + errorDetail: null, + errorRange: [ + 25, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 25, + }, + lineNumber: 19, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + ], + fixed: `# atx-heading-spacing-trailing-spaces␊ + ␊ + ␊ + ␊ + ## Heading 1 {MD018} ␊ + ␊ + ## Heading 2 {MD019} ␊ + ␊ + ## Heading 3 {MD020} ##␊ + ␊ + ## Heading 4 {MD020} ##␊ + ␊ + ## Heading 5 {MD020} ##␊ + ␊ + ## Heading 5 {MD021} ## ␊ + ␊ + ## Heading 6 {MD021} ## ␊ + ␊ + ## Heading 7 {MD021} ## ␊ + `, + } + +## atx_closed_heading_spacing.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '#Heading 1 {MD020} #', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 20, + editColumn: 1, + insertText: '# Heading 1 {MD020} #', + }, + lineNumber: 1, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 2 {MD020}##', + errorDetail: null, + errorRange: [ + 20, + 3, + ], + fixInfo: { + deleteCount: 22, + editColumn: 1, + insertText: '## Heading 2 {MD020} ##', + }, + lineNumber: 3, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '##Heading 3 {MD020}##', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 21, + editColumn: 1, + insertText: '## Heading 3 {MD020} ##', + }, + lineNumber: 5, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 4 {MD021} ##', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 7, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 5 {MD021} ##', + errorDetail: null, + errorRange: [ + 22, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 22, + }, + lineNumber: 9, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 6 {MD021} ##', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 11, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 6 {MD021} ##', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 11, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 7 {MD021} ##', + errorDetail: null, + errorRange: [ + 4, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 4, + }, + lineNumber: 13, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 7 {MD021} ##', + errorDetail: null, + errorRange: [ + 24, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 24, + }, + lineNumber: 13, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1 {MD020} #␊ + ␊ + ## Heading 2 {MD020} ##␊ + ␊ + ## Heading 3 {MD020} ##␊ + ␊ + ## Heading 4 {MD021} ##␊ + ␊ + ## Heading 5 {MD021} ##␊ + ␊ + ## Heading 6 {MD021} ##␊ + ␊ + ## Heading 7 {MD021} ##␊ + ␊ + ## Heading 8\\#␊ + ␊ + ## Heading 9 \\#␊ + ␊ + ## Heading 10 \\#␊ + ␊ + ␊ + `, + } + +## atx_heading_spacing.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '#Heading 1 {MD018}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + editColumn: 2, + insertText: ' ', + }, + lineNumber: 1, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 2 {MD019}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 3, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 3 {MD019}', + errorDetail: null, + errorRange: [ + 4, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 4, + }, + lineNumber: 5, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1 {MD018}␊ + ␊ + ## Heading 2 {MD019}␊ + ␊ + ## Heading 3 {MD019}␊ + ␊ + ␊ + `, + } + +## backslashes-and-backticks.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + \\\\\`\\\\␊ + \\\\\`\\\\␊ + `, + } + +## bare-list-markers.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Bare List Markers␊ + ␊ + ## Ordered 1/1/1␊ + ␊ + 1.␊ + 1.␊ + 1.␊ + ␊ + ## Ordered 1/2/3␊ + ␊ + 1.␊ + 2.␊ + 3.␊ + ␊ + ## Unordered *␊ + ␊ + *␊ + *␊ + *␊ + ␊ + ## Unordered +␊ + ␊ + +␊ + +␊ + +␊ + ␊ + ## Unordered -␊ + ␊ + -␊ + -␊ + -␊ + ␊ + ␊ + `, + } + +## bare-urls-in-html.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'https://example.com/fail', + errorDetail: null, + errorRange: [ + 6, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 6, + insertText: '', + }, + lineNumber: 7, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/fail', + errorDetail: null, + errorRange: [ + 49, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 49, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/fail', + errorDetail: null, + errorRange: [ + 49, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 49, + insertText: '', + }, + lineNumber: 13, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/fail', + errorDetail: null, + errorRange: [ + 41, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 41, + insertText: '', + }, + lineNumber: 19, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/fail', + errorDetail: null, + errorRange: [ + 16, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 16, + insertText: '', + }, + lineNumber: 21, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/fail', + errorDetail: null, + errorRange: [ + 17, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 17, + insertText: '', + }, + lineNumber: 23, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + ], + fixed: `# Bare URLs in HTML␊ + ␊ +

␊ + https://example.com/pass␊ +

␊ + ␊ + Text text. {MD034}␊ + ␊ + Text https://example.com/pass text.␊ + ␊ + Text https://example.com/pass text text. {MD034}␊ + ␊ + Text https://example.com/pass text text https://example.com/pass text. {MD034}␊ + ␊ + Text text text https://example.com/pass text.␊ + ␊ + Text text text https://example.com/pass text.␊ + ␊ + Text text text text text. {MD034}␊ + ␊ + Text
text
text. {MD034}␊ + ␊ + Text
text
text. {MD034}␊ + ␊ + ␊ + `, + } + +## bare-urls.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 15, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 15, + insertText: '', + }, + lineNumber: 3, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/', + errorDetail: null, + errorRange: [ + 15, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 15, + insertText: '', + }, + lineNumber: 5, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/?query=str...', + errorDetail: null, + errorRange: [ + 15, + 38, + ], + fixInfo: { + deleteCount: 38, + editColumn: 15, + insertText: '', + }, + lineNumber: 7, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/info.htm', + errorDetail: null, + errorRange: [ + 15, + 28, + ], + fixInfo: { + deleteCount: 28, + editColumn: 15, + insertText: '', + }, + lineNumber: 9, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 7, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 7, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 11, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 11, + insertText: '', + }, + lineNumber: 13, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 25, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 25, + insertText: '', + }, + lineNumber: 29, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 26, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 26, + insertText: '', + }, + lineNumber: 31, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 1, + insertText: '', + }, + lineNumber: 73, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 1, + insertText: '', + }, + lineNumber: 78, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com#heading-', + errorDetail: null, + errorRange: [ + 27, + 28, + ], + fixInfo: { + deleteCount: 28, + editColumn: 27, + insertText: '', + }, + lineNumber: 88, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'user@example.com', + errorDetail: null, + errorRange: [ + 40, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 40, + insertText: '', + }, + lineNumber: 96, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 59, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 59, + insertText: '', + }, + lineNumber: 106, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + ], + fixed: `# Detailed Results Bare URLs␊ + ␊ + For more, see . {MD034}␊ + ␊ + For more, see . {MD034}␊ + ␊ + For more, see . {MD034}␊ + ␊ + For more, see . {MD034}␊ + ␊ + Visit , then refresh. {MD034}␊ + ␊ + The site () is down. {MD034}␊ + ␊ + ␊ + ␊ + Some documents use
to link.␊ + ␊ + Or to link.␊ + ␊ + Or repeat the URL https://example.com.␊ + ␊ + Or https://example.com/info.htm.␊ + ␊ + This is allowed to avoid embedding angle brackets in HTML Text https://example.com.␊ + ␊ + As is https://example.com/info.htm text.␊ + ␊ +
Another violation: . {MD034}
␊ + ␊ +
Another violation: . {MD034}
␊ + ␊ + This is not a bare [link]( https://example.com ).␊ + ␊ + Nor is [link](https://example.com/path-with(parens)).␊ + ␊ + Or .␊ + ␊ + URLs in HTML attributes are not bare:␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + ␊ + ␊ + URLs surrounded by HTML tags are not bare:␊ + ␊ + Not https://example.com bare.␊ + ␊ + Not
https://example.com
bare.␊ + ␊ +

␊ + Not bare due to being in an HTML block:␊ + https://example.com␊ + https://example.com␊ +

https://example.com
␊ +

␊ + ␊ +
␊ + https://example.com␊ +
␊ + ␊ +
␊ + https://example.com␊ + ␊ +
␊ + ␊ +
␊ + ␊ + {MD034}␊ +
␊ + ␊ +
␊ + ␊ + {MD034}␊ + ␊ +
␊ + ␊ + URLs in link and image text are not bare:␊ + ␊ + Text [link to https://example.com site](https://example.com) text.␊ + ␊ + Image ![for https://example.com site](https://example.com) text.␊ + ␊ + URLs may end with a dash: {MD034}␊ + ␊ + ... when explicit: ␊ + ␊ + ... when embedded: https://example.com#heading-␊ + ␊ + Links with spaces inside angle brackets are okay: [blue jay]()␊ + ␊ + Email addresses are treated similarly: {MD034}␊ + ␊ + Angle brackets work the same for email: ␊ + ␊ + Unusual email addresses are handled: ␊ + ␊ + ---␊ + ␊ + [is-a-valid]: https://example.com␊ + ␊ + Links bind to the innermost [link that [is-a-valid] link]() {MD034}␊ + ␊ + But not if the [link [is-not-a-valid] link](https://example.com)␊ + ␊ + Escaping both inner square brackets avoids confusion:␊ + [link \\[is-not-a-valid\\] link](https://example.com)␊ + `, + } + +## blanks-around-fences-in-lists.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 6, + }, + lineNumber: 5, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '2. ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 6, + }, + lineNumber: 6, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 9, + }, + lineNumber: 8, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '3. ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 9, + }, + lineNumber: 9, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 18, + }, + lineNumber: 17, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '- ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 18, + }, + lineNumber: 18, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 21, + }, + lineNumber: 20, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '- ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 21, + }, + lineNumber: 21, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 30, + }, + lineNumber: 29, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> 2. ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 30, + }, + lineNumber: 30, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 33, + }, + lineNumber: 32, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> 3. ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 33, + }, + lineNumber: 33, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 42, + }, + lineNumber: 41, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> - ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 42, + }, + lineNumber: 42, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 45, + }, + lineNumber: 44, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> - ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 45, + }, + lineNumber: 45, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 54, + }, + lineNumber: 53, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > 2. ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 54, + }, + lineNumber: 54, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 57, + }, + lineNumber: 56, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > 3. ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 57, + }, + lineNumber: 57, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 66, + }, + lineNumber: 65, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > - ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 66, + }, + lineNumber: 66, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 69, + }, + lineNumber: 68, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > - ```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 69, + }, + lineNumber: 69, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Fences In Lists␊ + ␊ + 1. \`\`\`text␊ + Text␊ + \`\`\`␊ + ␊ + 2. \`\`\`text␊ + Text␊ + \`\`\`␊ + ␊ + 3. \`\`\`text␊ + Text␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + - \`\`\`text␊ + Text␊ + \`\`\`␊ + ␊ + - \`\`\`text␊ + Text␊ + \`\`\`␊ + ␊ + - \`\`\`text␊ + Text␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + > 1. \`\`\`text␊ + > Text␊ + > \`\`\`␊ + >␊ + > 2. \`\`\`text␊ + > Text␊ + > \`\`\`␊ + >␊ + > 3. \`\`\`text␊ + > Text␊ + > \`\`\`␊ + ␊ + Text␊ + ␊ + > - \`\`\`text␊ + > Text␊ + > \`\`\`␊ + >␊ + > - \`\`\`text␊ + > Text␊ + > \`\`\`␊ + >␊ + > - \`\`\`text␊ + > Text␊ + > \`\`\`␊ + ␊ + Text␊ + ␊ + > > 1. \`\`\`text␊ + > > Text␊ + > > \`\`\`␊ + > >␊ + > > 2. \`\`\`text␊ + > > Text␊ + > > \`\`\`␊ + > >␊ + > > 3. \`\`\`text␊ + > > Text␊ + > > \`\`\`␊ + ␊ + Text␊ + ␊ + > > - \`\`\`text␊ + > > Text␊ + > > \`\`\`␊ + > >␊ + > > - \`\`\`text␊ + > > Text␊ + > > \`\`\`␊ + > >␊ + > > - \`\`\`text␊ + > > Text␊ + > > \`\`\`␊ + ␊ + {MD031:5} {MD031:6} {MD031:8} {MD031:9} {MD031:17} {MD031:18} {MD031:20}␊ + {MD031:21} {MD031:29} {MD031:30} {MD031:32} {MD031:33} {MD031:41} {MD031:42}␊ + {MD031:44} {MD031:45} {MD031:53} {MD031:54} {MD031:56} {MD031:57} {MD031:65}␊ + {MD031:66} {MD031:68} {MD031:69}␊ + `, + } + +## blanks-around-headings--1-1.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Elderberry {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 21, + }, + lineNumber: 19, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Headings␊ + ␊ + ## Apple␊ + ␊ + Text␊ + ## Banana␊ + ␊ + Text␊ + ␊ + ## Cherry␊ + ␊ + Text␊ + ␊ + ␊ + ## Durian ##␊ + ␊ + Text␊ + ␊ + Elderberry {MD022}␊ + ------------------␊ + ␊ + Text␊ + ␊ + ---␊ + ## Fig␊ + ␊ + ␊ + `, + } + +## blanks-around-headings-0-2.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Banana {MD022}', + errorDetail: 'Expected: 2; Actual: 1; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 9, + }, + lineNumber: 8, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Elderberry {MD022}', + errorDetail: 'Expected: 2; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + ␊ + `, + lineNumber: 23, + }, + lineNumber: 21, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Headings␊ + ␊ + ␊ + ## Apple␊ + ␊ + ␊ + Text␊ + ## Banana {MD022}␊ + ␊ + ␊ + Text␊ + ## Cherry␊ + ␊ + ␊ + Text␊ + ## Durian ##␊ + ␊ + ␊ + Text␊ + ␊ + ---␊ + Elderberry {MD022}␊ + ------------------␊ + ␊ + ␊ + Text␊ + ## Fig␊ + ␊ + ␊ + `, + } + +## blanks-around-headings-1--1.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Durian {MD022} ##', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 16, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Headings␊ + ␊ + ## Apple␊ + Text␊ + ␊ + ## Banana␊ + ␊ + Text␊ + ␊ + ## Cherry␊ + ␊ + ␊ + Text␊ + ␊ + ---␊ + ␊ + ## Durian {MD022} ##␊ + ␊ + Text␊ + ␊ + ---␊ + ␊ + Elderberry␊ + ------------------␊ + Text␊ + ␊ + ## Fig␊ + ␊ + ␊ + `, + } + +## blanks-around-headings-3-0.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Durian {MD022} ##', + errorDetail: 'Expected: 3; Actual: 2; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 19, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Elderberry {MD022}', + errorDetail: 'Expected: 3; Actual: 1; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + ␊ + `, + }, + lineNumber: 22, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Headings␊ + ␊ + ␊ + ␊ + ## Apple␊ + Text␊ + ␊ + ␊ + ␊ + ## Banana␊ + Text␊ + ␊ + ␊ + ␊ + ## Cherry␊ + Text␊ + ␊ + ␊ + ␊ + ## Durian {MD022} ##␊ + Text␊ + ␊ + ␊ + ␊ + Elderberry {MD022}␊ + ------------------␊ + Text␊ + ␊ + ␊ + ␊ + ## Fig␊ + ␊ + ␊ + `, + } + +## blanks-around-headings-arrays.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '# Apple - Top {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 5, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '## Banana - Top {MD022}', + errorDetail: 'Expected: 2; Actual: 1; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 18, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '## Banana - Bottom {MD022}', + errorDetail: 'Expected: 2; Actual: 1; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 25, + }, + lineNumber: 24, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '### Cherry - Top {MD022}', + errorDetail: 'Expected: 3; Actual: 2; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 35, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '### Cherry - Bottom {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 42, + }, + lineNumber: 41, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '#### Durian - Bottom {MD022} ####', + errorDetail: 'Expected: 3; Actual: 1; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + ␊ + `, + lineNumber: 55, + }, + lineNumber: 54, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '##### Elderberry - Top {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 61, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '###### Fig - Top {MD022} ######', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 74, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '###### Fig - Bottom {MD022} ######', + errorDetail: 'Expected: 4; Actual: 1; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + ␊ + ␊ + `, + lineNumber: 82, + }, + lineNumber: 81, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Grape - Top {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 89, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Honeycomb - Top {MD022}', + errorDetail: 'Expected: 2; Actual: 1; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 107, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Honeycomb - Bottom {MD022}', + errorDetail: 'Expected: 2; Actual: 1; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 116, + }, + lineNumber: 114, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Headings (Arrays)␊ + ␊ + # Apple - Good␊ + Text␊ + ␊ + # Apple - Top {MD022}␊ + Text␊ + ␊ + # Apple - Bottom␊ + ␊ + Text␊ + ␊ + ␊ + ## Banana - Good␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + ## Banana - Top {MD022}␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + ## Banana - Bottom {MD022}␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + ␊ + ### Cherry - Good␊ + ␊ + Text␊ + ␊ + ␊ + ␊ + ### Cherry - Top {MD022}␊ + ␊ + Text␊ + ␊ + ␊ + ␊ + ### Cherry - Bottom {MD022}␊ + ␊ + Text␊ + #### Durian - Good ####␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + #### Durian - Top ####␊ + ␊ + ␊ + ␊ + Text␊ + #### Durian - Bottom {MD022} ####␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + ##### Elderberry - Good␊ + ␊ + Text␊ + ␊ + ##### Elderberry - Top {MD022}␊ + ␊ + Text␊ + ␊ + ##### Elderberry - Bottom␊ + Text␊ + ␊ + ###### Fig - Good ######␊ + ␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + ###### Fig - Top {MD022} ######␊ + ␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + ###### Fig - Bottom {MD022} ######␊ + ␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + Grape - Good␊ + ============␊ + ␊ + ---␊ + ␊ + Grape - Top {MD022}␊ + ===================␊ + ␊ + Text␊ + ␊ + Grape - Bottom␊ + ==============␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + Honeycomb - Good␊ + ---------␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + Honeycomb - Top {MD022}␊ + -----------------------␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + Honeycomb - Bottom {MD022}␊ + --------------------------␊ + ␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## blanks-around-headings.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Banana {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 8, + }, + lineNumber: 7, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '## Durian {MD022} ##', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 13, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Elderberry {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 18, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Elderberry {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 20, + }, + lineNumber: 18, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Headings␊ + ␊ + ## Apple␊ + ␊ + Text␊ + ␊ + ## Banana {MD022}␊ + ␊ + Text␊ + ␊ + ## Cherry␊ + ␊ + Text␊ + ␊ + ## Durian {MD022} ##␊ + ␊ + Text␊ + ␊ + ---␊ + ␊ + Elderberry {MD022}␊ + ------------------␊ + ␊ + Text␊ + ␊ + ## Fig␊ + ␊ + ␊ + `, + } + +## blanks-around-tables.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 29, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 29, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: '| Header | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 8, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| Cell | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 20, + }, + lineNumber: 19, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '> | Header | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + }, + lineNumber: 25, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '> | Cell | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 28, + }, + lineNumber: 27, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '> | Cell | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 33, + }, + lineNumber: 32, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| Header | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 36, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| Cell | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 39, + }, + lineNumber: 38, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| Header | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 42, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| Cell | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 45, + }, + lineNumber: 44, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| Header | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 48, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| Cell | {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 51, + }, + lineNumber: 50, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + ], + fixed: `# Blanks Around Tables␊ + ␊ + | Header | Header |␊ + | ------ | ------ |␊ + | Cell | Cell |␊ + ␊ + Text␊ + ␊ + | Header | {MD058} |␊ + | ------ | ------- |␊ + | Cell | Cell |␊ + ␊ + | Header | Header |␊ + | ------ | ------ |␊ + | Cell | Cell |␊ + Part of table {MD055} {MD056}␊ + ␊ + | Header | Header |␊ + | ------ | ------- |␊ + | Cell | {MD058} |␊ + ␊ + > Blockquote␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > | Header | {MD058} |␊ + > | ------ | ------- |␊ + > | Cell | {MD058} |␊ + >␊ + Text␊ + ␊ + > | Header | Header |␊ + > | ------ | ------- |␊ + > | Cell | {MD058} |␊ + >␊ + > > Blockquote␊ + ␊ + - List Item␊ + ␊ + | Header | {MD058} |␊ + | ------ | ------- |␊ + | Cell | {MD058} |␊ + ␊ + - List Item␊ + ␊ + 1. List Item␊ + ␊ + | Header | {MD058} |␊ + | ------ | ------- |␊ + | Cell | {MD058} |␊ + ␊ + 1. List Item␊ + ␊ + :::directive␊ + ␊ + | Header | {MD058} |␊ + | ------ | ------- |␊ + | Cell | {MD058} |␊ + ␊ + :::␊ + `, + } + +## blanks-around.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Blanks Around␊ + ␊ + ---␊ + ␊ + ## MD022/blanks-around-headings␊ + ␊ + >␊ + ### Alpha␊ + > >␊ + ␊ + ␊ + ### Beta␊ + ␊ + ␊ + > Text␊ + >␊ + > ### Gamma␊ + > >␊ + > > Text␊ + ␊ + ---␊ + ␊ + ## MD031/blanks-around-fences␊ + ␊ + > >␊ + \`\`\`js␊ + console.log();␊ + \`\`\`␊ + >␊ + ␊ + ␊ + \`\`\`js␊ + console.log();␊ + \`\`\`␊ + ␊ + ␊ + > Text␊ + >␊ + > \`\`\`js␊ + > console.log();␊ + > \`\`\`␊ + > >␊ + > >Text␊ + ␊ + ---␊ + ␊ + ## MD032/blanks-around-lists␊ + ␊ + >␊ + - List item␊ + >>␊ + ␊ + ␊ + - List item␊ + ␊ + ␊ + > Text␊ + >␊ + > - List item␊ + >>␊ + >> Text␊ + `, + } + +## blockquote-headings.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '> # Quoted heading in list {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 23, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> # Quoted heading in list {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 24, + }, + lineNumber: 23, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > # Double-quoted heading in list {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 26, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > # Double-quoted heading in list {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 27, + }, + lineNumber: 26, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Quoted sub-heading in list {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 29, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Quoted sub-heading in list {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 30, + }, + lineNumber: 29, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Quoted indented sub-heading in list {MD022} {MD023} {MD027}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 33, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Quoted indented sub-heading in list {MD022} {MD023} {MD027}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 34, + }, + lineNumber: 33, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Heading One {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 41, + }, + lineNumber: 40, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Heading Two {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + }, + lineNumber: 46, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Heading Three {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + }, + lineNumber: 53, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Heading Three {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 54, + }, + lineNumber: 53, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > ### Heading Four {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + }, + lineNumber: 59, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > ### Heading Four {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 60, + }, + lineNumber: 59, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > ### Heading Five {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + }, + lineNumber: 65, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > ### Heading Five {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 66, + }, + lineNumber: 65, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > ### Heading Six {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + }, + lineNumber: 71, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> > ### Heading Six {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 72, + }, + lineNumber: 71, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '> ## Quoted indented sub-head...', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 17, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + { + errorContext: ' > ## Quoted indented sub-he...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 33, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + { + errorContext: 'Quoted heading {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'Double-quoted heading {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'Quoted heading in list {MD022}...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'Double-quoted heading in list ...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: '> ## Quoted indented sub-head...', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 17, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > ## Quoted indented sub-he...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 33, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + ## Sub-heading␊ + ␊ + > # Quoted heading {MD025}␊ + ␊ + Text␊ + ␊ + > > # Double-quoted heading {MD025}␊ + ␊ + Text␊ + ␊ + > ## Quoted sub-heading␊ + ␊ + Text␊ + ␊ + > ## Quoted indented sub-heading {MD023} {MD027}␊ + ␊ + Text␊ + ␊ + - Item␊ + item␊ + ␊ + > # Quoted heading in list {MD022} {MD025}␊ + ␊ + - Item␊ + item␊ + ␊ + > > # Double-quoted heading in list {MD022} {MD025}␊ + ␊ + - Item␊ + item␊ + ␊ + > ## Quoted sub-heading in list {MD022}␊ + ␊ + - Item␊ + - Item␊ + item␊ + ␊ + > ## Quoted indented sub-heading in list {MD022} {MD023} {MD027}␊ + ␊ + - Item␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > ## Heading One {MD022}␊ + >␊ + > Text␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > ## Heading Two {MD022}␊ + >␊ + > Text␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > ## Heading Three {MD022}␊ + >␊ + > Text␊ + ␊ + Text␊ + ␊ + > > Text␊ + > >␊ + > > ### Heading Four {MD022}␊ + > >␊ + > > Text␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > > ### Heading Five {MD022}␊ + > >␊ + > > Text␊ + ␊ + Text␊ + ␊ + > > Text␊ + > >␊ + > > ### Heading Six {MD022}␊ + >␊ + > Text␊ + ␊ + Text␊ + `, + } + +## blockquote-spaces-nested.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '> A {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 3, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > B {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 5, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> C {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 7, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> A {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 11, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > B {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 13, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > > C {MD027}', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 15, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > D {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 17, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> E {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 19, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> A {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 23, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '>> B {MD027}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 25, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '>>> C {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 27, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '>> D {MD027}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 29, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> E {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 31, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > Text {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 35, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > Text {MD027}', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 39, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > Text {MD027}', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 43, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > Text {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 47, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > > Text {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 51, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> > > > Text {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 55, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '>> >> Text {MD027}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 59, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > Text {MD027}', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 63, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > Text {MD027}', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 67, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > Text {MD027}', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 71, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > Text {MD027}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 75, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + ], + fixed: `# Nested blockquote␊ + ␊ + > A {MD027}␊ + >␊ + > > B {MD027}␊ + >␊ + > C {MD027}␊ + ␊ + Text␊ + ␊ + > A {MD027}␊ + >␊ + > > B {MD027}␊ + > >␊ + > > > C {MD027}␊ + > >␊ + > > D {MD027}␊ + >␊ + > E {MD027}␊ + ␊ + Text␊ + ␊ + > A {MD027}␊ + >␊ + >> B {MD027}␊ + >>␊ + >>> C {MD027}␊ + >>␊ + >> D {MD027}␊ + >␊ + > E {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > > > Text {MD027}␊ + ␊ + Text␊ + ␊ + >> >> Text {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + ␊ + Text␊ + ␊ + > > Text {MD027}␊ + `, + } + +## blockquote_blank_lines.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 12, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: null, + fixInfo: { + deleteCount: -1, + }, + lineNumber: 10, + ruleDescription: 'Multiple consecutive blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md012.md', + ruleNames: [ + 'MD012', + 'no-multiple-blanks', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Blank line inside blockquote', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md028.md', + ruleNames: [ + 'MD028', + 'no-blanks-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Blank line inside blockquote', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md028.md', + ruleNames: [ + 'MD028', + 'no-blanks-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 10, + ruleDescription: 'Blank line inside blockquote', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md028.md', + ruleNames: [ + 'MD028', + 'no-blanks-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Blank line inside blockquote', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md028.md', + ruleNames: [ + 'MD028', + 'no-blanks-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Blank line inside blockquote', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md028.md', + ruleNames: [ + 'MD028', + 'no-blanks-blockquote', + ], + severity: 'error', + }, + ], + fixed: `# blockquote_blank_lines␊ + ␊ + Some text␊ + ␊ + > a quote␊ + > same quote␊ + ␊ + > blank line above me␊ + ␊ + > two blank lines above me␊ + ␊ + > space above me␊ + ␊ + * List with embedded blockquote␊ + ␊ + > Test␊ + > Test␊ + ␊ + > Test␊ + ␊ + * Item 2␊ + ␊ + > Test. The blank line below should _not_ trigger MD028 as one blockquote is␊ + > inside the list, and the other is outside it.␊ + ␊ + > Test␊ + ␊ + Expected errors:␊ + ␊ + {MD028:7} {MD028:9} {MD028:10} {MD028:12} {MD028:19}␊ + {MD009:12} (trailing space is intentional)␊ + {MD012:10} (multiple blank lines are intentional)␊ + `, + } + +## blockquote_spaces.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '> Foo {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 6, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> Bar {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 7, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> *foo* {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 14, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> **bar** {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 15, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> "Baz" {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 16, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> `qux` {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 17, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> Foo {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 27, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> Bar {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 28, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > Text {MD027}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 33, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > Text {MD027}', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 37, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > Text {MD027}', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 41, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> ', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 47, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + ], + fixed: `# blockquote_spaces␊ + ␊ + Some text␊ + ␊ + > Hello world␊ + > Foo {MD027}␊ + > Bar {MD027}␊ + ␊ + This tests other things embedded in the blockquote:␊ + ␊ + - foo␊ + ␊ + > *Hello world*␊ + > *foo* {MD027}␊ + > **bar** {MD027}␊ + > "Baz" {MD027}␊ + > \`qux\` {MD027}␊ + > *foo* more text␊ + > **bar** more text␊ + > 'baz' more text␊ + > \`qux\` more text␊ + >␊ + > - foo␊ + ␊ + Test the first line being indented too much:␊ + ␊ + > Foo {MD027}␊ + > Bar {MD027}␊ + > Baz␊ + ␊ + Test spaces before the blockquote:␊ + ␊ + > Text {MD027}␊ + ␊ + Text␊ + ␊ + > Text {MD027}␊ + ␊ + Text␊ + ␊ + > Text {MD027}␊ + ␊ + Test nothing in the blockquote:␊ + ␊ + ␊ + ␊ + > ␊ + {MD027:-1}␊ + ␊ + ␊ + ␊ + > Blockquoted code blocks:␊ + >␊ + > Code␊ + > Code␊ + > Code␊ + >␊ + > \`\`\`text␊ + > Code␊ + > Code␊ + > Code␊ + > \`\`\`␊ + `, + } + +## break-all-the-rules.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h3; Actual: h4', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: plus', + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: '*', + }, + lineNumber: 8, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 8, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + }, + lineNumber: 14, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 14, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(name)[link]', + errorRange: [ + 1, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 1, + insertText: '[name](link)', + }, + lineNumber: 16, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: null, + fixInfo: { + deleteCount: -1, + }, + lineNumber: 18, + ruleDescription: 'Multiple consecutive blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md012.md', + ruleNames: [ + 'MD012', + 'no-multiple-blanks', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 97', + errorRange: [ + 81, + 17, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: '$ dollar {MD014}', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 23, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '#Heading 4 {MD018}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + editColumn: 2, + insertText: ' ', + }, + lineNumber: 25, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '# Heading 5 {MD019}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 27, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '#Heading 6 {MD020} #', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 20, + editColumn: 1, + insertText: '# Heading 6 {MD020} #', + }, + lineNumber: 29, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '# Heading 7 {MD021} {MD003} ...', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 31, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '... Heading 7 {MD021} {MD003} #', + errorDetail: null, + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 31, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 10 {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 86, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: ' # Heading 9 {MD023} {MD026}.', + errorDetail: null, + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 40, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + { + errorContext: 'Heading 8', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \'.\'', + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 40, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: '> {MD027}', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 42, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Blank line inside blockquote', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md028.md', + ruleNames: [ + 'MD028', + 'no-blanks-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3; Style: 1/2/3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '2', + }, + lineNumber: 47, + ruleDescription: 'Ordered list item prefix', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md029.md', + ruleNames: [ + 'MD029', + 'ol-prefix', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 2, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 8, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 51, + }, + lineNumber: 50, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '* list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 8, + }, + lineNumber: 7, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '+ list {MD004} {MD007} {MD030...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 8, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '* list {MD032} {MD046:49}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 51, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/page', + errorDetail: null, + errorRange: [ + 1, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 1, + insertText: '', + }, + lineNumber: 57, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: 'Section {MD036} Heading', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: 'h _', + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + }, + lineNumber: 67, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '`with `', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 69, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '[link with space ]', + errorDetail: null, + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + }, + lineNumber: 71, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + { + errorContext: '## Heading 1 {MD041:1}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 1, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + { + errorContext: '[empty link]()', + errorDetail: null, + errorRange: [ + 1, + 14, + ], + fixInfo: null, + lineNumber: 81, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: # Broken; Actual: # Heading 3 {MD003} {MD043}', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: markdownLint', + errorRange: [ + 1, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 1, + insertText: 'markdownlint', + }, + lineNumber: 83, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 1, + 14, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + editColumn: 12, + insertText: `␊ + `, + }, + lineNumber: 144, + ruleDescription: 'Files should end with a single newline character', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', + ruleNames: [ + 'MD047', + 'single-trailing-newline', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '_', + }, + lineNumber: 90, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + insertText: '_', + }, + lineNumber: 90, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 8, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 8, + insertText: '__', + }, + lineNumber: 94, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 14, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 14, + insertText: '__', + }, + lineNumber: 94, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: '[Missing link fragment](#missing)', + errorDetail: null, + errorRange: [ + 1, + 33, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Missing link][label]', + errorDetail: 'Missing link or image reference definition: "label"', + errorRange: [ + 1, + 21, + ], + fixInfo: null, + lineNumber: 98, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[unused]: link-destination', + errorDetail: 'Unused link or image reference definition: "unused"', + errorRange: [ + 1, + 26, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 100, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + { + errorContext: '[text][url]', + errorDetail: null, + errorRange: [ + 1, + 11, + ], + fixInfo: { + deleteCount: 11, + editColumn: 1, + insertText: '[text](https://example.com/page)', + }, + lineNumber: 103, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 110, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 116, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: '| table {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 119, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '| cell {MD058} |', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 122, + }, + lineNumber: 121, + ruleDescription: 'Tables should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md058.md', + ruleNames: [ + 'MD058', + 'blanks-around-tables', + ], + severity: 'error', + }, + { + errorContext: '[click here]', + errorDetail: null, + errorRange: [ + 2, + 10, + ], + fixInfo: null, + lineNumber: 124, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 110, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `## Heading 1 {MD041:1}␊ + ␊ + #### Heading 2 {MD001:3}␊ + ␊ + # Heading 3 {MD003} {MD043} #␊ + ␊ + * list {MD032}␊ + ␊ + * list {MD004} {MD007} {MD030} {MD032}␊ + ␊ + * list␊ + * list {MD007}␊ + * list {MD005}␊ + ␊ + {MD009} {MD010}␊ + ␊ + [name](link) {MD011}␊ + ␊ + {MD012:18}␊ + ␊ + long line long line long line long line long line long line long line long line long line {MD013}␊ + ␊ + dollar {MD014}␊ + ␊ + # Heading 4 {MD018}␊ + ␊ + # Heading 5 {MD019}␊ + ␊ + # Heading 6 {MD020} #␊ + ␊ + # Heading 7 {MD021} {MD003} #␊ + ␊ + # Heading 8␊ + ␊ + # Heading 8␊ + ␊ + {MD024:35}␊ + Note: Can not break MD025 and MD041 in the same file␊ + ␊ + # Heading 9 {MD023} {MD026}␊ + ␊ + > {MD027}␊ + ␊ + > {MD028:43}␊ + ␊ + 1. list␊ + 2. list {MD029}␊ + ␊ + \`\`\`js␊ + \`\`\`␊ + ␊ + * list {MD032} {MD046:49}␊ + ␊ + {MD031:50}␊ + ␊ +
{MD033}␊ + ␊ + {MD034}␊ + ␊ + ---␊ + ␊ + ***␊ + ␊ + {MD035:61}␊ + ␊ + _Section {MD036} Heading_␊ + ␊ + Emphasis _with_ space {MD037}␊ + ␊ + Code \`with\` space {MD038}␊ + ␊ + [link with space](link) {MD039}␊ + ␊ + \`\`\`␊ + code fence without language {MD040:73} {MD046:73}␊ + \`\`\`␊ + ␊ + ~~~js␊ + code fence with different style {MD048:77} {MD046:77}␊ + ~~~␊ + ␊ + [empty link]() {MD042}␊ + ␊ + markdownlint {MD044}␊ + ␊ + ![](image.jpg) {MD045}␊ + ␊ + ## Heading 10 {MD022}␊ + ␊ + Emphasis _with_ underscore style␊ + ␊ + Emphasis _with_ different style {MD049}␊ + ␊ + Strong __with__ underscore style␊ + ␊ + Strong __with__ different style {MD050}␊ + ␊ + [Missing link fragment](#missing) {MD051}␊ + ␊ + [Missing link][label] {MD052}␊ + ␊ + {MD053:100}␊ + ␊ + [text](https://example.com/page) {MD054}␊ + ␊ + ␊ + [url]: https://example.com/page␊ + ␊ + | table | header |␊ + |--------|--------|␊ + {MD055} | cell |␊ + ␊ + {MD060:-2}␊ + ␊ + | table | header |␊ + |---------|--------|␊ + | {MD056} |␊ + ␊ + Text␊ + ␊ + | table {MD058} |␊ + | ------- |␊ + | cell {MD058} |␊ + ␊ + > Blockquote␊ + ␊ + [click here](https://example.org) {MD059}␊ + ␊ + ␊ + ␊ + EOF {MD047}␊ + `, + } + +## bulleted_list_2_space_indent.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 7, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 8; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 8, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# bulleted_list_2_space_indent␊ + ␊ + This is a document where the lists are indented by 2 spaces, but the style is␊ + set to 4 space indents for lists:␊ + ␊ + * Test X␊ + * Test Y {MD007}␊ + * Test Z {MD007}␊ + ␊ + ␊ + `, + } + +## bulleted_list_4_space_indent.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 4, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 8', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 4, + editColumn: 1, + insertText: '', + }, + lineNumber: 5, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# bulleted_list_4_space_indent␊ + ␊ + * Test X␊ + * Test Y {MD007}␊ + * Test Z {MD007}␊ + `, + } + +## bulleted_list_not_at_beginning_of_line.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 15, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 16, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 17, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 18, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 19, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 20, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 21, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 30, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 31, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 41, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 42, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 43, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 55, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 57, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 59, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# Bulleted List Not at Beginning of Line␊ + ␊ + Text␊ + ␊ + * Item␊ + * Item␊ + * Item␊ + * Item␊ + * Item␊ + * Item␊ + * Item␊ + ␊ + Text␊ + ␊ + * Item {MD007}␊ + * Item {MD007}␊ + * Item {MD007}␊ + * Item {MD007}␊ + * Item {MD007}␊ + * Item {MD007}␊ + * Item {MD007}␊ + ␊ + Text␊ + ␊ + * Item␊ + * Item␊ + ␊ + Text␊ + ␊ + * Item {MD007}␊ + * Item {MD007}␊ + ␊ + Text␊ + ␊ + * Item␊ + * Item␊ + * Item␊ + ␊ + Text␊ + ␊ + * Item {MD007}␊ + * Item {MD007}␊ + * Item {MD007}␊ + ␊ + Text␊ + ␊ + * Item␊ + ␊ + * Item␊ + ␊ + * Item␊ + ␊ + Text␊ + ␊ + * Item {MD007}␊ + ␊ + * Item {MD007}␊ + ␊ + * Item {MD007}␊ + `, + } + +## byte-order-marker-utf8.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + Text␊ + `, + } + +## code-block-in-list.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Code Block in List␊ + ␊ + Text␊ + ␊ + \`\`\`js␊ + // Code␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + 1. Item␊ + ␊ + \`\`\`js␊ + // Code␊ + \`\`\`␊ + ␊ + 1. Item␊ + ␊ + \`\`\`js␊ + // Code␊ + \`\`\`␊ + `, + } + +## code-block-trailing-spaces.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 28, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 28, + }, + lineNumber: 5, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# code-block-trailing-spaces␊ + ␊ + Text␊ + ␊ + Two trailing spaces {MD009}␊ + ␊ + Text␊ + ␊ + Indented code block␊ + ␊ + Statement␊ + Indented statement␊ + ␊ + Statement␊ + Indented statement␊ + ␊ + Two trailing spaces ␊ + ␊ + Text␊ + ␊ + \`\`\`text␊ + Fenced code block␊ + ␊ + Statement␊ + Indented statement␊ + ␊ + Statement␊ + Indented statement␊ + ␊ + Two trailing spaces ␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## code-block-with-language-allowed.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 34, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 35, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 36, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 37, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 38, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 39, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 10', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: ' ', + }, + lineNumber: 41, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 45, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 46, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 47, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 48, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + \`\`\`js␊ + if (true) {␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + \`\`\`␊ + ␊ + \`\`\`js␊ + if (true) {␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + \`\`\`␊ + ␊ + if (true) {␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + ␊ + \`\`\` Text␊ + hello␊ + world␊ + }␊ + \`\`\`␊ + ␊ + if (true) { // {MD010}␊ + console.log("true"); // {MD010}␊ + if (false) { // {MD010}␊ + console.log("false"); // {MD010}␊ + } // {MD010}␊ + } // {MD010}␊ + ␊ + Line with hard tab. {MD010}␊ + ␊ + \`\`\`javascript␊ + if (true) {␊ + console.log("true"); // {MD010}␊ + if (false) { // {MD010}␊ + console.log("false"); // {MD010}␊ + } // {MD010}␊ + }␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## code-block-with-tabs-allowed.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 10', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: ' ', + }, + lineNumber: 35, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + \`\`\`js␊ + if (true) {␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + \`\`\`␊ + ␊ + \`\`\`js␊ + if (true) {␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + \`\`\`␊ + ␊ + if (true) { // {MD046}␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + ␊ + if (true) {␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + ␊ + Line with hard tab. {MD010}␊ + ␊ + ␊ + `, + } + +## code-block-with-tabs.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 14, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 15, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 16, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 17, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 28, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 29, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 30, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 31, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 32, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 33, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 10', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: ' ', + }, + lineNumber: 35, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + \`\`\`js␊ + if (true) {␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + \`\`\`␊ + ␊ + \`\`\`js␊ + if (true) {␊ + console.log("true"); // {MD010}␊ + if (false) { // {MD010}␊ + console.log("false"); // {MD010}␊ + } // {MD010}␊ + }␊ + \`\`\`␊ + ␊ + if (true) { // {MD046}␊ + console.log("true");␊ + if (false) {␊ + console.log("false");␊ + }␊ + }␊ + ␊ + if (true) { // {MD010}␊ + console.log("true"); // {MD010}␊ + if (false) { // {MD010}␊ + console.log("false"); // {MD010}␊ + } // {MD010}␊ + } // {MD010}␊ + ␊ + Line with hard tab. {MD010}␊ + `, + } + +## code-blocks-and-spans.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: code; Actual: Code', + errorRange: [ + 3, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 3, + insertText: 'code', + }, + lineNumber: 1, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: code; Actual: CODE', + errorRange: [ + 6, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 6, + insertText: 'code', + }, + lineNumber: 3, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: code; Actual: CODE', + errorRange: [ + 7, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 7, + insertText: 'code', + }, + lineNumber: 26, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: code; Actual: CODE', + errorRange: [ + 7, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 7, + insertText: 'code', + }, + lineNumber: 28, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + ], + fixed: `# code Blocks and Spans {MD044}␊ + ␊ + Text code text {MD044}␊ + ␊ + Text \`CODE\` text␊ + ␊ + \`\`\`lang␊ + CODE␊ + ␊ + CODE␊ + \`\`\`␊ + ␊ + \`CODE\` text \`CODE\`␊ + ␊ + CODE␊ + ␊ + CODE␊ + ␊ + Text \`CODE␊ + CODE\` text␊ + text text␊ + text \`CODE␊ + CODE CODE␊ + CODE\` text␊ + ␊ + Text \`code {MD044}␊ + ␊ + Text \`code {MD044}␊ + ␊ + ␊ + `, + } + +## code-blocks-prefixed-by-spaces.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 98', + errorRange: [ + 81, + 18, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 98', + errorRange: [ + 81, + 18, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 98', + errorRange: [ + 81, + 18, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# md013-code-blocks-spaces␊ + ␊ + Text text text text text text text text text text text text text text text text text text. {MD013}␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text.␊ + \`\`\`␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text.␊ + \`\`\`␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text.␊ + \`\`\`␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text.␊ + \`\`\`␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text. {MD046:21}␊ + \`\`\`␊ + ␊ + Text text text text text text text text text text text text text text text text text text. {MD013}␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text.␊ + \`\`\`␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text.␊ + \`\`\`␊ + ␊ + \`\`\`text␊ + Text text text text text text text text text text text text text text text text text text.␊ + \`\`\`␊ + ␊ + Text text text text text text text text text text text text text text text text text text. {MD013}␊ + ␊ + ␊ + `, + } + +## code-fences-in-blockquotes.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```markdown', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 4, + }, + lineNumber: 4, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 7, + }, + lineNumber: 6, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> ```markdown', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 10, + }, + lineNumber: 10, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 13, + }, + lineNumber: 12, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > ```markdown', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 15, + }, + lineNumber: 15, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '> > ```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `> >␊ + `, + lineNumber: 18, + }, + lineNumber: 17, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + ], + fixed: `# Detailed Results Code Fences in Blockquotes␊ + ␊ + Text␊ + ␊ + \`\`\`markdown␊ + Text␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > \`\`\`markdown␊ + > Text␊ + > \`\`\`␊ + >␊ + > Text␊ + > > Text␊ + > >␊ + > > \`\`\`markdown␊ + > > Text␊ + > > \`\`\`␊ + > >␊ + > > Text␊ + ␊ + {MD031:4} {MD031:6} {MD031:10} {MD031:12} {MD031:15} {MD031:17}␊ + `, + } + +## code-with-tabs-allowed.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 3, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 21, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: `# Code With Tabs Allowed␊ + ␊ + Text text {MD010}␊ + ␊ + Text \`code code\` text␊ + ␊ + Text \` code\` text␊ + ␊ + Text \`code \` text␊ + ␊ + Text \`code code␊ + code code␊ + code code\` text␊ + ␊ + console.log(" ");␊ + ␊ + \`\`\`js␊ + console.log(" ");␊ + \`\`\`␊ + ␊ + \`\`\`j s {MD010}␊ + console.log(" ");␊ + \`\`\`␊ + ␊ + console.log("");␊ + ␊ + ␊ + `, + } + +## code-with-tabs-blocked.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 3, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 11', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: ' ', + }, + lineNumber: 5, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 7', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: ' ', + }, + lineNumber: 7, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 11', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: ' ', + }, + lineNumber: 9, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 12, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 18', + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + insertText: ' ', + }, + lineNumber: 15, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 14', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + insertText: ' ', + }, + lineNumber: 18, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 21, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 14', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + insertText: ' ', + }, + lineNumber: 22, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 25, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: `# Code With Tabs Blocked␊ + ␊ + Text text {MD010}␊ + ␊ + Text \`code code\` text {MD010}␊ + ␊ + Text \` code\` text {MD010}␊ + ␊ + Text \`code \` text {MD010}␊ + ␊ + Text \`code code␊ + code code {MD010}␊ + code code\` text␊ + ␊ + console.log(" "); // {MD010}␊ + ␊ + \`\`\`js␊ + console.log(" "); // {MD010}␊ + \`\`\`␊ + ␊ + \`\`\`j s {MD010}␊ + console.log(" "); // {MD010}␊ + \`\`\`␊ + ␊ + console.log(""); // {MD010}␊ + ␊ + ␊ + `, + } + +## code_block_consistency.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 10, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# code_block_consistency␊ + ␊ + This is text.␊ + ␊ + This is a␊ + code block.␊ + ␊ + And here is more text␊ + ␊ + \`\`\`text␊ + and here is a different {MD046:10}␊ + code block␊ + \`\`\`␊ + `, + } + +## code_block_dollar.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '$ ls {MD014}', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 5, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ less foo {MD014}', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 6, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ cat bar {MD014}', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 8, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ mkdir test {MD014}', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 74, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ cd test {MD014}', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 75, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ ls test {MD014}', + errorDetail: null, + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 76, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: ' $ ls example {MD014}', + errorDetail: null, + errorRange: [ + 6, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 6, + }, + lineNumber: 80, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# Code Block Dollar␊ + ␊ + The following code block shouldn't have $ before the commands:␊ + ␊ + ls {MD014}␊ + less foo {MD014}␊ + ␊ + cat bar {MD014}␊ + ␊ + However the following code block shows output, and $ can be used to␊ + distinguish between command and output:␊ + ␊ + $ ls␊ + foo bar␊ + $ less foo␊ + Hello world␊ + ␊ + $ cat bar␊ + baz␊ + ␊ + The following code block uses variable names, and likewise shouldn't fire:␊ + ␊ + $foo = 'bar';␊ + $baz = 'qux';␊ + ␊ + The following code block doesn't have any dollar signs, and shouldn't fire:␊ + ␊ + ls foo␊ + cat bar␊ + ␊ + The following (fenced) code block doesn't have any content at all, and␊ + shouldn't fire: {MD046:34}␊ + ␊ + \`\`\`bash␊ + \`\`\`␊ + ␊ + Mixed content:␊ + ␊ + $ ls␊ + file.md other.md␊ + $ git branch␊ + $ cat stuff␊ + ␊ + output␊ + ␊ + More mixed content:␊ + ␊ + $ ls␊ + $ git branch␊ + $ cat stuff␊ + stuff here␊ + more stuff␊ + $ tail cat␊ + meow␊ + ␊ + Command with blank lines in output:␊ + ␊ + $ dig example.com␊ + ␊ + ; ...␊ + ;; ...␊ + ␊ + ;; ...␊ + ␊ + Some commands with no output:␊ + ␊ + $ mkdir test␊ + mkdir: created directory 'test'␊ + $ cd test␊ + $ ls test␊ + ␊ + All commands with no output:␊ + ␊ + mkdir test {MD014}␊ + cd test {MD014}␊ + ls test {MD014}␊ + ␊ + Space-prefixed command with no output:␊ + ␊ + ls example {MD014}␊ + `, + } + +## code_block_dollar_fence-empty.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + \`\`\`js␊ + ␊ + \`\`\`␊ + ␊ + \`\`\`css␊ + ␊ + ␊ + \`\`\`␊ + ␊ + \`\`\`spaces␊ + ␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## code_block_dollar_fence.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '$ code {MD014}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 4, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ code {MD014}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 10, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ code {MD014}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 16, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ code {MD014}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 17, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ code {MD014}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 23, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ code {MD014}', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 24, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: '$ npm install --save multimatc...', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 40, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + { + errorContext: ' $ ls example {MD014}', + errorDetail: null, + errorRange: [ + 2, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 2, + }, + lineNumber: 46, + ruleDescription: 'Dollar signs used before commands without showing output', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md', + ruleNames: [ + 'MD014', + 'commands-show-output', + ], + severity: 'error', + }, + ], + fixed: `# Code Block Dollar Fence␊ + ␊ + \`\`\`fence␊ + code {MD014}␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`fence␊ + code {MD014}␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`fence␊ + code {MD014}␊ + code {MD014}␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`fence␊ + code {MD014}␊ + code {MD014}␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`fence␊ + $ code␊ + code␊ + $ code␊ + code␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`sh␊ + ␊ + npm install --save multimatch {MD014}␊ + \`\`\`␊ + ␊ + Space-prefixed command with no output:␊ + ␊ + \`\`\`sh␊ + ls example {MD014}␊ + \`\`\`␊ + `, + } + +## code_block_fenced.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# code_block_fenced␊ + ␊ + This is text.␊ + ␊ + This is a {MD046}␊ + code block.␊ + ␊ + And here is more text␊ + ␊ + \`\`\`text␊ + This is a code block that won't trigger.␊ + \`\`\`␊ + ␊ + But we'll do another:␊ + ␊ + And this {MD046}␊ + will.␊ + ␊ + Final text is here␊ + ␊ + ␊ + `, + } + +## code_block_indented.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 10, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# code_block_indented␊ + ␊ + This is text.␊ + ␊ + This is a␊ + code block.␊ + ␊ + And here is more text␊ + ␊ + \`\`\`text␊ + This is {MD046:10} also a code block.␊ + \`\`\`␊ + ␊ + But we'll do another:␊ + ␊ + And this␊ + will.␊ + ␊ + One last one:␊ + ␊ + This is code␊ + ␊ + with an empty indented line.␊ + ␊ + ␊ + `, + } + +## code_fence_style_backtick.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + ], + fixed: `# code_fence_style_backtick␊ + ␊ + \`\`\`text␊ + This is a code block␊ + \`\`\`␊ + ␊ + ~~~text␊ + This is {MD048:7} a code block␊ + ~~~␊ + ␊ + \`\`\`text␊ + ~~~␊ + This is fine␊ + ~~~␊ + \`\`\`␊ + ␊ + ~~~text␊ + \`\`\`␊ + This is not {MD048:17}␊ + \`\`\`␊ + ~~~␊ + ␊ + ␊ + `, + } + +## code_fence_style_tilde.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: tilde; Actual: backtick', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: tilde; Actual: backtick', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + ], + fixed: `# code_fence_style_tilde␊ + ␊ + \`\`\`text␊ + This is {MD048:3} a code block␊ + \`\`\`␊ + ␊ + ~~~text␊ + This is a code block␊ + ~~~␊ + ␊ + \`\`\`text␊ + ~~~␊ + This is not fine {MD048:11}␊ + ~~~␊ + \`\`\`␊ + ␊ + ~~~text␊ + \`\`\`␊ + This is␊ + \`\`\`␊ + ~~~␊ + ␊ + ␊ + `, + } + +## configure-file-off-enable-inline.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 21, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'warning', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 33, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'warning', + }, + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 23, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 35, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + ], + fixed: `# Configure File Off Enable Inline␊ + ␊ + + List item␊ + ␊ + Text (text)[.]␊ + ␊ + ␊ + ␊ + + List item␊ + ␊ + Text (text)[.]␊ + ␊ + ␊ + ␊ + + List item␊ + ␊ + Text (text)[.]␊ + ␊ + ␊ + ␊ + - List item {MD004}␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + ␊ + ␊ + + List item␊ + ␊ + Text (text)[.]␊ + ␊ + ␊ + ␊ + - List item {MD004}␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + ␊ + `, + } + +## configure-file-with-severity-alias.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 9, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 37, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 11, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'warning', + }, + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 39, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'warning', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '` text`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'warning', + }, + { + errorContext: '` text`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'warning', + }, + ], + fixed: `# Configure File With Severity Alias␊ + ␊ + Text *text* {MD037}␊ + ␊ + Text \`text\` {MD038}␊ + ␊ + Text [ text](.)␊ + ␊ + - List item {MD004}␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + 2. List item␊ + ␊ + ␊ + ␊ + Text * text*␊ + ␊ + Text \` text\`␊ + ␊ + Text [ text](.)␊ + ␊ + + List item␊ + ␊ + Text (text)[.]␊ + ␊ + 2. List item␊ + ␊ + ␊ + ␊ + Text *text* {MD037}␊ + ␊ + Text \`text\` {MD038}␊ + ␊ + Text [ text](.)␊ + ␊ + - List item {MD004}␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + 2. List item␊ + ␊ + ␊ + `, + } + +## configure-file-with-severity-name.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 9, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 37, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 11, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'warning', + }, + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 39, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'warning', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '` text`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'warning', + }, + { + errorContext: '` text`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'warning', + }, + ], + fixed: `# Configure File With Severity Name␊ + ␊ + Text *text* {MD037}␊ + ␊ + Text \`text\` {MD038}␊ + ␊ + Text [ text](.)␊ + ␊ + - List item {MD004}␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + 2. List item␊ + ␊ + ␊ + ␊ + Text * text*␊ + ␊ + Text \` text\`␊ + ␊ + Text [ text](.)␊ + ␊ + + List item␊ + ␊ + Text (text)[.]␊ + ␊ + 2. List item␊ + ␊ + ␊ + ␊ + Text *text* {MD037}␊ + ␊ + Text \`text\` {MD038}␊ + ␊ + Text [ text](.)␊ + ␊ + - List item {MD004}␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + 2. List item␊ + ␊ + ␊ + `, + } + +## configure-file-with-severity-tag.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 11, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'warning', + }, + { + errorContext: null, + errorDetail: '(text)[.]', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[text](.)', + }, + lineNumber: 39, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'warning', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2; Style: 1/1/1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '1', + }, + lineNumber: 13, + ruleDescription: 'Ordered list item prefix', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md029.md', + ruleNames: [ + 'MD029', + 'ol-prefix', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2; Style: 1/1/1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '1', + }, + lineNumber: 41, + ruleDescription: 'Ordered list item prefix', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md029.md', + ruleNames: [ + 'MD029', + 'ol-prefix', + ], + severity: 'error', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '` text`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'warning', + }, + { + errorContext: '` text`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'warning', + }, + { + errorContext: '[ text]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 7, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'warning', + }, + { + errorContext: '[ text]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'warning', + }, + ], + fixed: `# Configure File With Severity Tag␊ + ␊ + Text *text* {MD037}␊ + ␊ + Text \`text\` {MD038}␊ + ␊ + Text [text](.) {MD039}␊ + ␊ + + List item␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + 1. List item {MD029}␊ + ␊ + ␊ + ␊ + Text * text*␊ + ␊ + Text \` text\`␊ + ␊ + Text [ text](.)␊ + ␊ + + List item␊ + ␊ + Text (text)[.]␊ + ␊ + 2. List item␊ + ␊ + ␊ + ␊ + Text *text* {MD037}␊ + ␊ + Text \`text\` {MD038}␊ + ␊ + Text [text](.) {MD039}␊ + ␊ + + List item␊ + ␊ + Text [text](.) {MD011}␊ + ␊ + 1. List item {MD029}␊ + ␊ + ␊ + `, + } + +## consecutive_blank_lines.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: null, + fixInfo: { + deleteCount: -1, + }, + lineNumber: 5, + ruleDescription: 'Multiple consecutive blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md012.md', + ruleNames: [ + 'MD012', + 'no-multiple-blanks', + ], + severity: 'error', + }, + ], + fixed: `# consecutive_blank_lines␊ + ␊ + Some text␊ + ␊ + Some text {MD012:5}␊ + ␊ + This is a code block␊ + ␊ + ␊ + with two blank lines in it␊ + ␊ + Some more text␊ + `, + } + +## consistent_bullet_styles_asterisk.md + +> Snapshot 1 + + { + errors: [], + fixed: `# consistent_bullet_styles_asterisk␊ + ␊ + * Item␊ + * Item␊ + * Item␊ + `, + } + +## consistent_bullet_styles_dash.md + +> Snapshot 1 + + { + errors: [], + fixed: `# consistent_bullet_styles_dash␊ + ␊ + - Item␊ + - Item␊ + - Item␊ + `, + } + +## consistent_bullet_styles_plus.md + +> Snapshot 1 + + { + errors: [], + fixed: `# consistent_bullet_styles_plus␊ + ␊ + + Item␊ + + Item␊ + + Item␊ + `, + } + +## custom-rules.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + Sample text.␊ + ␊ + Sample text.␊ + ␊ + Sample text.␊ + ␊ + Sample text.␊ + ␊ + ␊ + > Blockquote␊ + `, + } + +## default-spaces-MD010.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 13, + ], + fixInfo: { + deleteCount: 13, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 1, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 2, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 35', + errorRange: [ + 35, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 35, + insertText: ' ', + }, + lineNumber: 3, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: ` text {MD010}␊ + text and text 2 {MD010}␊ + texts with trailing spaces {MD010} ␊ + ␊ + ␊ + `, + } + +## descriptive-link-text-empty-config.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Descriptive Link Text Empty Config␊ + ␊ + [Learn more](https://example.com/images/about) about us.␊ + ␊ + [Click here](https://example.com/dir/file.txt).␊ + ␊ + Go to this [link](https://example.com/second).␊ + ␊ + ␊ + `, + } + +## descriptive-link-text-override.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[Go here]', + errorDetail: null, + errorRange: [ + 2, + 7, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[this]', + errorDetail: null, + errorRange: [ + 40, + 4, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + ], + fixed: `# Descriptive Link Text Override␊ + ␊ + [Go here](https://example.com/javascript/about) {MD059}␊ + ␊ + [Learn more](https://example.com/javascript/about).␊ + ␊ + [Click here](https://example.com/javascript/about).␊ + ␊ + To learn more, go [here!](https://example.com/site).␊ + ␊ + To learn more, go to this [link!](https://example.com/links).␊ + ␊ + If you need additional guidance, read [this](https://example.com/links). {MD059}␊ + ␊ + [link][url]␊ + ␊ + [url]: https://example.com␊ + ␊ + ␊ + `, + } + +## descriptive-link-text.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: link', + errorRange: [ + 2, + 6, + ], + fixInfo: null, + lineNumber: 40, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: '*', + }, + lineNumber: 37, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '*', + }, + lineNumber: 37, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: '[here]', + errorDetail: null, + errorRange: [ + 5, + 4, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[Click here]', + errorDetail: null, + errorRange: [ + 2, + 10, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[here!]', + errorDetail: null, + errorRange: [ + 26, + 5, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[more]', + errorDetail: null, + errorRange: [ + 8, + 4, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[click here!!!!]', + errorDetail: null, + errorRange: [ + 17, + 14, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[click-here!!!!]', + errorDetail: null, + errorRange: [ + 2, + 14, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[link]', + errorDetail: null, + errorRange: [ + 13, + 4, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[link]', + errorDetail: null, + errorRange: [ + 2, + 4, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[click here]', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[link]', + errorDetail: null, + errorRange: [ + 2, + 4, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 2, + 6, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[*link*]', + errorDetail: null, + errorRange: [ + 2, + 6, + ], + fixInfo: null, + lineNumber: 36, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[_link_]', + errorDetail: null, + errorRange: [ + 2, + 6, + ], + fixInfo: null, + lineNumber: 37, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[~~link~~]', + errorDetail: null, + errorRange: [ + 2, + 8, + ], + fixInfo: null, + lineNumber: 38, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + ], + fixed: `# Descriptive Link Text␊ + ␊ + [Learn about Javascript](https://example.com/javascript/about)␊ + ␊ + [About Javascript](https://example.com/file.txt)␊ + ␊ + Learn about [our mission](https://example.com/mission).␊ + ␊ + Go [here](https://example.com/descriptive-links) {MD059}␊ + ␊ + [Learn more](https://example.com/images/about) about us.␊ + ␊ + [Click here](https://example.com/dir/file.txt). {MD059}␊ + ␊ + [Read more](https://example.com/guide).␊ + ␊ + To get more support, go [here!](https://example.com/contact). {MD059}␊ + ␊ + Learn [more](https://example.com/contact). {MD059}␊ + ␊ + To learn more, [click here!!!!](https://example.com/about). {MD059}␊ + ␊ + [click-here!!!!](https://example.com/first). {MD059}␊ + ␊ + Go to this [link](https://example.com/second). {MD059}␊ + ␊ + [link][Example URL] {MD059}␊ + ␊ + [Example URL]: https://example.com␊ + ␊ + {MD059} [click␊ + here](https://example.com)␊ + ␊ + [link](destination) {MD059}␊ + [link](destination) {MD039} {MD059}␊ + [*link*](destination) {MD059}␊ + [*link*](destination) {MD049} {MD059}␊ + [~~link~~](destination) {MD059}␊ + [\`link\`](destination)␊ + [](destination) {MD033}␊ + `, + } + +## docfx-tab-syntax.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Docfx Tab Syntax␊ + ␊ + Examples copied from: ␊ + ␊ + ---␊ + ␊ + # [Tab Display Name](#tab/tab-id)␊ + ␊ + ---␊ + ␊ + # [Linux](#tab/linux)␊ + ␊ + Content for Linux...␊ + ␊ + # [Windows](#tab/windows)␊ + ␊ + Content for Windows...␊ + ␊ + ---␊ + ␊ + # [.NET](#tab/dotnet/linux)␊ + ␊ + .NET content for Linux...␊ + ␊ + # [.NET](#tab/dotnet/windows)␊ + ␊ + .NET content for Windows...␊ + ␊ + # [TypeScript](#tab/typescript/linux)␊ + ␊ + TypeScript content for Linux...␊ + ␊ + # [TypeScript](#tab/typescript/windows)␊ + ␊ + TypeScript content for Windows...␊ + ␊ + # [REST API](#tab/rest)␊ + ␊ + REST API content, independent of platform...␊ + `, + } + +## emoji-headings.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '##️⃣ Keycap Number Sign {MD018...', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + editColumn: 3, + insertText: ' ', + }, + lineNumber: 11, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + ], + fixed: `# Emoji Headings␊ + ␊ + #️⃣ Keycap Number Sign␊ + ␊ + ␊ + ␊ + # #️⃣ Keycap Number Sign␊ + ␊ + Text␊ + ␊ + ## ️⃣ Keycap Number Sign {MD018}␊ + ␊ + Text␊ + ␊ + # Keycap Number Sign #️⃣␊ + ␊ + Text␊ + ␊ + # Keycap Number Sign#️⃣␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## emphasis-markers.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '_', + }, + lineNumber: 5, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + insertText: '_', + }, + lineNumber: 5, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '_', + }, + lineNumber: 8, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: '_', + }, + lineNumber: 8, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '_', + }, + lineNumber: 12, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: '_', + }, + lineNumber: 12, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 9, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 9, + insertText: '**', + }, + lineNumber: 14, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 14, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 14, + insertText: '**', + }, + lineNumber: 14, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 7, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 7, + insertText: '**', + }, + lineNumber: 17, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 12, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 12, + insertText: '**', + }, + lineNumber: 17, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 7, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 7, + insertText: '**', + }, + lineNumber: 21, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 12, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 12, + insertText: '**', + }, + lineNumber: 21, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + ], + fixed: `# Emphasis Markers␊ + ␊ + Text to _set_ the **preferences**.␊ + ␊ + This is _bad_ {MD049}␊ + ␊ + This \`is␊ + also\` _bad_ {MD049}␊ + ␊ + This \`is␊ + also␊ + very\` _bad_ {MD049}␊ + ␊ + This is **bad** {MD050}␊ + ␊ + This \`is␊ + also\` **bad** {MD050}␊ + ␊ + This \`is␊ + also␊ + very\` **bad** {MD050}␊ + ␊ +

HTML __should__ *be* ignored

␊ + ␊ +

␊ + HTML __should__ *be* ignored␊ +

␊ + ␊ + ␊ + `, + } + +## emphasis-not-heading-in-blockquote.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '_', + }, + lineNumber: 11, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '_', + }, + lineNumber: 11, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '_', + }, + lineNumber: 15, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + insertText: '_', + }, + lineNumber: 15, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + > _Text_␊ + ␊ + Text␊ + ␊ + > _Text text text_␊ + ␊ + Text␊ + ␊ + > _Text_ {MD049}␊ + ␊ + Text␊ + ␊ + > _Text text text_ {MD049}␊ + ␊ + Text␊ + ␊ + > **Text**␊ + ␊ + Text␊ + ␊ + > **Text text text**␊ + `, + } + +## emphasis_instead_of_headings.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Section 1: the first section {...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: 'Section 1.1: another section {...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: 'Section 2: yet more sections {...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: 'Section 3: oh no more sections...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: 'Section 4: emphasis as heading...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 48, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: 'Section 5: emphasis as heading...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '*', + }, + lineNumber: 30, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 48, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 48, + insertText: '*', + }, + lineNumber: 30, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '**', + }, + lineNumber: 12, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 47, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 47, + insertText: '**', + }, + lineNumber: 12, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + ], + fixed: `# emphasis_instead_of_headings␊ + ␊ + **Section 1: the first section {MD036}**␊ + ␊ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor␊ + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis␊ + nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.␊ + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore␊ + eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt␊ + in culpa qui officia deserunt mollit anim id est laborum.␊ + ␊ + **Section 1.1: another section {MD036} {MD050}**␊ + ␊ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor␊ + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis␊ + nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.␊ + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore␊ + eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt␊ + in culpa qui officia deserunt mollit anim id est laborum.␊ + ␊ + *Section 2: yet more sections {MD036}*␊ + ␊ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor␊ + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis␊ + nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.␊ + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore␊ + eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt␊ + in culpa qui officia deserunt mollit anim id est laborum.␊ + ␊ + *Section 3: oh no more sections {MD036} {MD049}*␊ + ␊ + This is a normal paragraph␊ + **that just happens to have emphasized text in**␊ + even though the emphasized text is on its own line.␊ + ␊ + This is another **normal** paragraph with some text in it. This also should␊ + not trigger the rule.␊ + ␊ + **This is an entire paragraph that has been emphasized, and shouldn't be␊ + detected as a heading because it's on multiple lines**␊ + ␊ + **This also shouldn't be detected as a heading as it ends in punctuation.**␊ + ␊ + **This shouldn't be detected as a heading as it ends in full-width punctuation。**␊ + ␊ + **[This as well since it is a link](https://example.com)**␊ + ␊ + *Section 4: emphasis as heading {MD036}* ␊ + ␊ + Emphasis as heading followed by an HTML comment␊ + ␊ + __Section 5: emphasis as heading {MD036}__␊ + ␊ + Emphasis as heading following an HTML comment␊ + ␊ + *Section 6: emphasis as non-heading*␊ + ␊ + Embedded HTML comments are unusual and cause the emphasis to be ignored/allowed␊ + `, + } + +## emphasis_style_asterisk.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '*', + }, + lineNumber: 9, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '*', + }, + lineNumber: 9, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '*', + }, + lineNumber: 11, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '*', + }, + lineNumber: 11, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '*', + }, + lineNumber: 13, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + insertText: '*', + }, + lineNumber: 13, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + ], + fixed: `# Emphasis style asterisk␊ + ␊ + *This* is fine␊ + ␊ + This *is* fine␊ + ␊ + This is *fine*␊ + ␊ + *This* is not␊ + ␊ + This *is* not␊ + ␊ + This is *not*␊ + ␊ + {MD049:-2} {MD049:-4} {MD049:-6}␊ + ␊ + Internal emphasis is preserved:␊ + apple*banana*cherry, apple*banana*, *banana*cherry␊ + apple_banana_cherry, apple_banana_, _banana_cherry␊ + ␊ + ␊ + `, + } + +## emphasis_style_underscore.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '_', + }, + lineNumber: 9, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '_', + }, + lineNumber: 9, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '_', + }, + lineNumber: 11, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '_', + }, + lineNumber: 11, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '_', + }, + lineNumber: 13, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + insertText: '_', + }, + lineNumber: 13, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + ], + fixed: `# Emphasis style underscore␊ + ␊ + _This_ is fine␊ + ␊ + This _is_ fine␊ + ␊ + This is _fine_␊ + ␊ + _This_ is not␊ + ␊ + This _is_ not␊ + ␊ + This is _not_␊ + ␊ + {MD049:-2} {MD049:-4} {MD049:-6}␊ + ␊ + Internal emphasis is preserved:␊ + apple*banana*cherry, apple*banana*, *banana*cherry␊ + apple_banana_cherry, apple_banana_, _banana_cherry␊ + ␊ + ␊ + `, + } + +## empty-links.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[text]()', + errorDetail: null, + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text](<>)', + errorDetail: null, + errorRange: [ + 1, + 10, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]( <> )', + errorDetail: null, + errorRange: [ + 1, + 12, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text](<> "title")', + errorDetail: null, + errorRange: [ + 1, + 18, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]( <> "title" )', + errorDetail: null, + errorRange: [ + 1, + 20, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text](#)', + errorDetail: null, + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]( # )', + errorDetail: null, + errorRange: [ + 1, + 11, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text](# "title")', + errorDetail: null, + errorRange: [ + 1, + 17, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]( # "title" )', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text][frag]', + errorDetail: null, + errorRange: [ + 1, + 12, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text][ frag ]', + errorDetail: null, + errorRange: [ + 1, + 14, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[frag][]', + errorDetail: null, + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[frag]', + errorDetail: null, + errorRange: [ + 1, + 6, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]()', + errorDetail: null, + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 74, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]()', + errorDetail: null, + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 78, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]()', + errorDetail: null, + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 80, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]()', + errorDetail: null, + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 83, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[text]()', + errorDetail: null, + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + ## Empty links␊ + ␊ + [text]() {MD042}␊ + ␊ + [text](<>) {MD042}␊ + ␊ + [text]( <> ) {MD042}␊ + ␊ + [text](<> "title") {MD042}␊ + ␊ + [text]( <> "title" ) {MD042}␊ + ␊ + [text](#) {MD042}␊ + ␊ + [text]( # ) {MD042}␊ + ␊ + [text](# "title") {MD042}␊ + ␊ + [text]( # "title" ) {MD042}␊ + ␊ + [text][frag] {MD042}␊ + ␊ + [text][ frag ] {MD042}␊ + ␊ + [frag][] {MD042}␊ + ␊ + [frag] {MD042}␊ + ␊ + [frag]: #␊ + ␊ + ## Non-empty links␊ + ␊ + ### frag␊ + ␊ + [text](link)␊ + ␊ + [text]( link )␊ + ␊ + [text](link "title")␊ + ␊ + [text]( link "title" )␊ + ␊ + [text]()␊ + ␊ + [text]( )␊ + ␊ + [text]( "title")␊ + ␊ + [text]( "title" )␊ + ␊ + [text](#frag)␊ + ␊ + [text]( #frag )␊ + ␊ + [text](#frag "title")␊ + ␊ + [text]( #frag "title" )␊ + ␊ + [text][ref]␊ + ␊ + [text][ ref ]␊ + ␊ + [ref]: link␊ + ␊ + [text]␊ + ␊ + [text]: link␊ + ␊ + ## Inline of links with empty link (#308)␊ + ␊ + [text](link-1)␊ + [text]() {MD042}␊ + [text](link-3)␊ + ␊ + [text](link-1)␊ + [text]() {MD042}␊ + [text](link-3)␊ + [text]() {MD042}␊ + ␊ + [text](link-1)␊ + [text]() {MD042}␊ + [text](link-3)␊ + [text]() {MD042}␊ + [text](link-5)␊ + `, + } + +## empty_doc.md + +> Snapshot 1 + + { + errors: [], + fixed: '', + } + +## escaped-emphasis-markers.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + ## Single-character markers␊ + ␊ + None are valid emphasis without spaces.␊ + ␊ + Escaped asterisks \\* should \\* be ignored by MD037.␊ + ␊ + Escaped asterisks \\* should * be ignored by MD037.␊ + ␊ + Escaped asterisks * should \\* be ignored by MD037.␊ + ␊ + Escaped underscores \\_ should \\_ be ignored by MD037.␊ + ␊ + Escaped underscores \\_ should _ be ignored by MD037.␊ + ␊ + Escaped underscores _ should \\_ be ignored by MD037.␊ + ␊ + ## Double-character markers, start␊ + ␊ + All *could* be reported because they are valid single-character␊ + marker emphasis when no spaces are present.␊ + ␊ + Escaped asterisks \\** should ** be ignored by MD037.␊ + ␊ + Escaped asterisks *\\* should ** be ignored by MD037.␊ + ␊ + Escaped underscores \\__ should __ be ignored by MD037.␊ + ␊ + Escaped underscores _\\_ should __ be ignored by MD037.␊ + ␊ + ## Double-character markers, end␊ + ␊ + All should be reported, but are ignored because they look like␊ + the start of an embedded emphasis.␊ + ␊ + Escaped asterisks ** should \\** be ignored by MD037.␊ + ␊ + Escaped asterisks ** should *\\* be ignored by MD037.␊ + ␊ + Escaped underscores __ should \\__ be ignored by MD037.␊ + ␊ + Escaped underscores __ should _\\_ be ignored by MD037.␊ + `, + } + +## every-markdown-syntax.md + +> Snapshot 1 + + { + errors: [], + fixed: `Every Markdown Syntax␊ + =====================␊ + ␊ + ## Level 2 ATX Heading␊ + ␊ + ### Level 3 Closed ATX Heading ###␊ + ␊ + ---␊ + ␊ + Text *emphasized* **strong** ___emphasized+strong___.␊ + Text \`code\` html .␊ + Text [link](https://example.com/page) [link][] [link] ![image][link].␊ + Text https://example.com/page.␊ + ␊ + Hard ␊ + line break␊ + ␊ + [link]: https://example.com/page "Title"␊ + ␊ + > Block quote␊ + > > Nested␊ + ␊ + - Unordered␊ + - List␊ + - Items␊ + Indented␊ + ␊ + Content␊ + ␊ + 1. Ordered␊ + 2. List␊ + 1. Items␊ + Indented␊ + ␊ + Content␊ + ␊ + \`\`\`markdown options␊ + Fenced code block␊ + \`\`\`␊ + ␊ + Indented code block␊ + ␊ +

␊ + HTML block␊ +

␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Table | Cell |␊ + ␊ + ␊ + `, + } + +## fenced-code-in-list.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + - Item␊ + ␊ + \`\`\`javascript␊ + debugger;␊ + ␊ + ␊ + debugger;␊ + \`\`\`␊ + ␊ + text␊ + ␊ + - Item␊ + ␊ + - Subitem␊ + ␊ + \`\`\`javascript␊ + debugger;␊ + ␊ + ␊ + debugger;␊ + \`\`\`␊ + ␊ + text␊ + ␊ + - Subitem␊ + ␊ + - Item␊ + ␊ + - Subitem␊ + ␊ + \`\`\`javascript␊ + debugger; debugger; debugger; debugger; debugger; debugger; debugger; debugger; debugger; debugger;␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## fenced-code-unmatched.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + Text␊ + ␊ + \`\`\`code\`\`\`␊ + ␊ + Text␊ + ␊ + \`\`\`javascript␊ + var x = 5;␊ + \`\`\`␊ + ␊ + Text␊ + `, + } + +## fenced_code_blocks.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + ], + fixed: `# fenced_code_blocks␊ + ␊ + This is a GFM-style fenced code block:␊ + ␊ + \`\`\` bash␊ + #!/bin/bash␊ + ␊ + # Print something to stdout:␊ + echo "Hello"␊ + echo "World"␊ + \`\`\`␊ + ␊ + This is a kramdown-style fenced code block:␊ + ␊ + ~~~ bash␊ + #!/bin/bash␊ + ␊ + # Print something to stdout:␊ + echo "Hello"␊ + echo "World"␊ + ~~~␊ + ␊ + None of the above should trigger any heading related rules.␊ + ␊ + \`\`\`␊ + Code block without a language specifier␊ + \`\`\`␊ + ␊ + {MD040:25} {MD048:15}␊ + `, + } + +## fenced_code_blocks_in_lists.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: fenced; Actual: indented', + errorRange: null, + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# test doc␊ + ␊ + this is some text␊ + ␊ + * This is a list item␊ + ␊ + \`\`\`fenced␊ + this is a code block within the list item.␊ + \`\`\`␊ + ␊ + with more text here␊ + ␊ + * and another list item here␊ + ␊ + And another paragraph.␊ + ␊ + But this code block {MD046}␊ + ␊ + is *NOT* in a list and should error.␊ + ␊ + And in addition to that...␊ + ␊ + \`\`\`text␊ + This code block is both indented␊ + and fenced and should *also* error.␊ + \`\`\`␊ + ␊ + And finally:␊ + ␊ + \`\`\`text␊ + This is a code block␊ + ␊ + And this is a code block in a code block and should *not* error␊ + ␊ + More stuff here␊ + \`\`\`␊ + ␊ + all␊ + ␊ + {MD046:23}␊ + `, + } + +## fenced_code_with_nesting.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 4, + }, + lineNumber: 4, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 7, + }, + lineNumber: 6, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 8, + }, + lineNumber: 8, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 11, + }, + lineNumber: 10, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 12, + }, + lineNumber: 12, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 17, + }, + lineNumber: 16, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 18, + }, + lineNumber: 18, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 23, + }, + lineNumber: 22, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 24, + }, + lineNumber: 24, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 31, + }, + lineNumber: 30, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 32, + }, + lineNumber: 32, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 39, + }, + lineNumber: 38, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 40, + }, + lineNumber: 40, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 44, + }, + lineNumber: 43, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 45, + }, + lineNumber: 45, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 49, + }, + lineNumber: 48, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '````fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 50, + }, + lineNumber: 50, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '````', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 55, + }, + lineNumber: 54, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~~fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 56, + }, + lineNumber: 56, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~~', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 61, + }, + lineNumber: 60, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '````fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 62, + }, + lineNumber: 62, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '`````', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 67, + }, + lineNumber: 66, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~~fence', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 68, + }, + lineNumber: 68, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '~~~~~', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 73, + }, + lineNumber: 72, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: backtick; Actual: tilde', + errorRange: null, + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Code fence style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md048.md', + ruleNames: [ + 'MD048', + 'code-fence-style', + ], + severity: 'error', + }, + ], + fixed: `# heading␊ + ␊ + text {MD031:4}␊ + ␊ + \`\`\`fence␊ + code {MD031:6}␊ + \`\`\`␊ + ␊ + text {MD031:8} {MD048:8}␊ + ␊ + ~~~fence␊ + code␊ + ~~~␊ + ␊ + text {MD031:10} {MD031:12}␊ + ␊ + \`\`\`fence␊ + ~~~fence␊ + code␊ + ~~~␊ + \`\`\`␊ + ␊ + text {MD031:16} {MD031:18} {MD048:18}␊ + ␊ + ~~~fence␊ + \`\`\`fence␊ + code␊ + \`\`\`␊ + ~~~␊ + ␊ + text {MD031:22} {MD031:24}␊ + ␊ + \`\`\`fence␊ + ␊ + ~~~fence␊ + code␊ + ~~~␊ + ␊ + \`\`\`␊ + ␊ + text {MD031:30} {MD031:32} {MD048:32}␊ + ␊ + ~~~fence␊ + ␊ + \`\`\`fence␊ + code␊ + \`\`\`␊ + ␊ + ~~~␊ + ␊ + text {MD031:38} {MD031:40}␊ + ␊ + \`\`\`fence␊ + code␊ + ~~~␊ + \`\`\`␊ + ␊ + text {MD031:43} {MD031:45} {MD048:45}␊ + ␊ + ~~~fence␊ + code␊ + \`\`\`␊ + ~~~␊ + ␊ + text {MD031:48} {MD031:50}␊ + ␊ + \`\`\`\`fence␊ + \`\`\`fence␊ + code␊ + \`\`\`␊ + \`\`\`\`␊ + ␊ + text {MD031:54} {MD031:56} {MD048:56}␊ + ␊ + ~~~~fence␊ + ~~~fence␊ + code␊ + ~~~␊ + ~~~~␊ + ␊ + text {MD031:60} {MD031:62}␊ + ␊ + \`\`\`\`fence␊ + \`\`\`fence␊ + code␊ + \`\`\`␊ + \`\`\`\`\`␊ + ␊ + text {MD031:66} {MD031:68} {MD048:68}␊ + ␊ + ~~~~fence␊ + ~~~fence␊ + code␊ + ~~~␊ + ~~~~~␊ + ␊ + text {MD031:72}␊ + `, + } + +## fenced_code_without_blank_lines.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 12, + }, + lineNumber: 12, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 15, + }, + lineNumber: 14, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 20, + }, + lineNumber: 19, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 23, + }, + lineNumber: 23, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + editColumn: 4, + insertText: `␊ + `, + }, + lineNumber: 47, + ruleDescription: 'Files should end with a single newline character', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', + ruleNames: [ + 'MD047', + 'single-trailing-newline', + ], + severity: 'error', + }, + ], + fixed: `\`\`\`␊ + code at start of file␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`ruby␊ + code␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`␊ + code␊ + \`\`\`␊ + ␊ + text {MD031:12} {MD031:14}␊ + ␊ + \`\`\`␊ + code␊ + \`\`\`␊ + ␊ + text {MD031:19}␊ + ␊ + text {MD031:23}␊ + ␊ + \`\`\`␊ + code␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`js␊ + code␊ + code␊ + code␊ + \`\`\`␊ + ␊ + \`\`\`html␊ + \`\`\`␊ + ␊ + text␊ + ␊ + ␊ + ␊ + \`\`\`␊ + code at end of file without newline {MD047:47}␊ + \`\`\`␊ + `, + } + +## first-line-heading-allow-preamble-false.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Text {MD041}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 1, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + ], + fixed: `Text {MD041}␊ + ␊ + ␊ + ␊ + Text␊ + ␊ +

HTML

␊ + ␊ + Text␊ + ␊ + - List item␊ + ␊ + # Heading␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## first-line-heading-allow-preamble-h1.md + +> Snapshot 1 + + { + errors: [], + fixed: `Text␊ + ␊ + ␊ + ␊ + Text␊ + ␊ +

HTML

␊ + ␊ + Text␊ + ␊ + - List item␊ + ␊ +

Heading

␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## first-line-heading-allow-preamble-violation.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Heading {MD041}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + ], + fixed: `Text␊ + ␊ + ␊ + ␊ + Text␊ + ␊ +

HTML

␊ + ␊ + Text␊ + ␊ + - List item␊ + ␊ + ## Heading {MD041}␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## first-line-heading-allow-preamble.md + +> Snapshot 1 + + { + errors: [], + fixed: `Text␊ + ␊ + ␊ + ␊ + Text␊ + ␊ +

HTML

␊ + ␊ + Text␊ + ␊ + - List item␊ + ␊ + # Heading␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## first_heading_bad_atx.md + +> Snapshot 1 + + { + errors: [], + fixed: `## Heading␊ + ␊ + ␊ + `, + } + +## first_heading_bad_setext.md + +> Snapshot 1 + + { + errors: [], + fixed: `Heading␊ + -------␊ + ␊ + ␊ + `, + } + +## first_heading_good_atx.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + `, + } + +## first_heading_good_setext.md + +> Snapshot 1 + + { + errors: [], + fixed: `Heading␊ + =======␊ + `, + } + +## first_line_top_level_heading_atx.md + +> Snapshot 1 + + { + errors: [], + fixed: `# First line is a top level heading␊ + ␊ + This shouldn't trigger MD041␊ + `, + } + +## first_line_top_level_heading_setext.md + +> Snapshot 1 + + { + errors: [], + fixed: `First line top level heading␊ + ============================␊ + ␊ + This shouldn't trigger MD041␊ + `, + } + +## fix_102_extra_nodes_in_link_text.md + +> Snapshot 1 + + { + errors: [], + fixed: `# fix_102_extra_nodes_in_link_text␊ + ␊ + [test _test_ test](www.test.com)␊ + [test \`test\` test](www.test.com)␊ + [test *test* test](www.test.com)␊ + [test *test* *test* test](www.test.com)␊ + [test *test* *test* *test* test](www.test.com)␊ + [test **test** test](www.test.com)␊ + [test __test__ test](www.test.com)␊ + [this should not raise](www.shouldnotraise.com)␊ + ␊ + ␊ + `, + } + +## fixing-with-front-matter.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 23, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 23, + }, + lineNumber: 6, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: '# Fixing with Front Matter {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 6, + }, + lineNumber: 5, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '## Nested Heading {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 9, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 8, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 12, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 12, + }, + lineNumber: 8, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 12, + 1, + ], + fixInfo: { + editColumn: 13, + insertText: `␊ + `, + }, + lineNumber: 11, + ruleDescription: 'Files should end with a single newline character', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', + ruleNames: [ + 'MD047', + 'single-trailing-newline', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 7, + 6, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + ], + fixed: `---␊ + front: matter␊ + ignore: this␊ + ---␊ + # Fixing with Front Matter {MD022}␊ + ␊ + Text text text {MD009}␊ + ␊ + Text [link](url) text {MD039} {MD059}␊ + ␊ + ## Nested Heading {MD022}␊ + ␊ + Text {MD047}␊ + `, + } + +## front-matter-alt-title-h1.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Top level heading {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 4, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + alternate="Welcome to Jekyll!"␊ + ---␊ + # Top level heading {MD025}␊ + ␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ + ␊ + ␊ + `, + } + +## front-matter-alt-title-json.md + +> Snapshot 1 + + { + errors: [], + fixed: `{␊ + "date": "2017-01-26T22:17:00+02:00",␊ + "alternate": "My document title and heading"␊ + }␊ + ␊ + Some plain text here.␊ + ␊ + ␊ + `, + } + +## front-matter-alt-title-no-h1.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + alternate="Welcome to Jekyll!"␊ + ---␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ + ␊ + ␊ + `, + } + +## front-matter-alt-title-toml.md + +> Snapshot 1 + + { + errors: [], + fixed: `+++␊ + date = "2017-01-26T22:17:00+02:00"␊ + alternate = "My document title and heading"␊ + +++␊ + ␊ + Some plain text here.␊ + ␊ + ␊ + `, + } + +## front-matter-alternate.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + }, + lineNumber: 6, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: 'Text {MD041}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 4, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + front: matter␊ + ---␊ + Text {MD041}␊ + ␊ + Text {MD009}␊ + ␊ + ␊ + `, + } + +## front-matter-embedded.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 6', + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: ' ', + }, + lineNumber: 5, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: 'layout: post {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 4, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `Text text text␊ + ␊ + ---␊ + ␊ + layout: post {MD022}␊ + hard: tab {MD010}␊ + title: embedded␊ + ---␊ + ␊ + Text text text␊ + ␊ + ␊ + `, + } + +## front-matter-empty-title-no-h1.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Front matter from [Jekyll docu...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + layout: post␊ + title: "Welcome to Jekyll!"␊ + date: 2015-11-17 16:16:01 -0600␊ + categories: jekyll update␊ + ---␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). {MD041}␊ + ␊ + ␊ + `, + } + +## front-matter-empty.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Another {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + ---␊ + # Heading␊ + ␊ + # Another {MD025}␊ + `, + } + +## front-matter-no-crlf.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + front: matter␊ + ---`, + } + +## front-matter-no-title-h1.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + layout: post␊ + notitle: "Welcome to Jekyll!"␊ + date: 2015-11-17 16:16:01 -0600␊ + categories: jekyll update␊ + ---␊ + # Top level heading␊ + ␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ + ␊ + ␊ + `, + } + +## front-matter-no-title-no-h1.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Front matter from [Jekyll docu...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + layout: post␊ + notitle: "Welcome to Jekyll!"␊ + date: 2015-11-17 16:16:01 -0600␊ + categories: jekyll update␊ + ---␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). {MD041}␊ + ␊ + ␊ + `, + } + +## front-matter-title-h1.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Top level heading {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + layout: post␊ + title: "Welcome to Jekyll!"␊ + date: 2015-11-17 16:16:01 -0600␊ + categories: jekyll update␊ + ---␊ + # Top level heading {MD025}␊ + ␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ + ␊ + ␊ + `, + } + +## front-matter-title-h2.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + layout: post␊ + title: "Welcome to Jekyll!"␊ + date: 2015-11-17 16:16:01 -0600␊ + categories: jekyll update␊ + ---␊ + ## Secondary heading␊ + ␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ + ␊ + ␊ + `, + } + +## front-matter-title-json-spaces.md + +> Snapshot 1 + + { + errors: [], + fixed: `{␊ + "date": "2017-01-26T22:17:00+02:00",␊ + "title": "My document title and heading"␊ + } ␊ + ␊ + Some plain text here.␊ + `, + } + +## front-matter-title-json.md + +> Snapshot 1 + + { + errors: [], + fixed: `{␊ + "date": "2017-01-26T22:17:00+02:00",␊ + "title": "My document title and heading"␊ + }␊ + ␊ + Some plain text here.␊ + `, + } + +## front-matter-title-no-h1.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + layout: post␊ + title: "Welcome to Jekyll!"␊ + date: 2015-11-17 16:16:01 -0600␊ + categories: jekyll update␊ + ---␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ + ␊ + ␊ + `, + } + +## front-matter-title-pandoc-spaces.md + +> Snapshot 1 + + { + errors: [], + fixed: `+++ ␊ + title: "Welcome to pandoc!"␊ + date: 2015-11-17 16:16:01 -0600␊ + ... ␊ + ␊ + Some plain text here.␊ + `, + } + +## front-matter-title-pandoc.md + +> Snapshot 1 + + { + errors: [], + fixed: `+++␊ + title: "Welcome to pandoc!"␊ + date: 2015-11-17 16:16:01 -0600␊ + ...␊ + ␊ + Some plain text here.␊ + `, + } + +## front-matter-title-spaces.md + +> Snapshot 1 + + { + errors: [], + fixed: `--- ␊ + layout: post␊ + title: "Welcome to Jekyll!"␊ + date: 2015-11-17 16:16:01 -0600␊ + categories: jekyll update␊ + --- ␊ + ␊ + Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ + ␊ + ␊ + `, + } + +## front-matter-title-toml-spaces.md + +> Snapshot 1 + + { + errors: [], + fixed: `+++ ␊ + date = "2017-01-26T22:17:00+02:00"␊ + title = "My document title and heading"␊ + +++ ␊ + ␊ + Some plain text here.␊ + `, + } + +## front-matter-title-toml.md + +> Snapshot 1 + + { + errors: [], + fixed: `+++␊ + date = "2017-01-26T22:17:00+02:00"␊ + title = "My document title and heading"␊ + +++␊ + ␊ + Some plain text here.␊ + `, + } + +## front-matter-with-dashes.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 10, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: `---␊ + layout: post␊ + title: Title with ---␊ + tags: front matter␊ + ---␊ + ## Heading␊ + ␊ + ---␊ + ␊ + Hard tab {MD010}␊ + `, + } + +## front-matter-with-disable-next-line.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 10, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 20, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 22, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + ], + fixed: `---␊ + front: matter␊ + ---␊ + ␊ + # Front Matter with Disable-Next-Line␊ + ␊ + ␊ +
␊ + ␊ +
{MD033}␊ + ␊ + ␊ +
␊ + ␊ +
{MD033}␊ +
{MD033}␊ + ␊ +
␊ +
{MD033}␊ +
{MD033}␊ + ␊ +
{MD033}␊ +
{MD033}␊ +
␊ +
{MD033}␊ +
{MD033}␊ +
␊ +
{MD033}␊ +
{MD033}␊ +
␊ +
{MD033}␊ +
{MD033}␊ +
␊ +
{MD033}␊ +
{MD033}␊ + `, + } + +## front-matter-yaml-in-html-comment.md + +> Snapshot 1 + + { + errors: [], + fixed: `␊ + ␊ + # Front Matter YAML in HTML Comment␊ + ␊ + Text text text␊ + `, + } + +## front-matter.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + front: matter␊ + ---␊ + # Heading 1␊ + ␊ + ## Heading 2␊ + `, + } + +## github-footnote-syntax.md + +> Snapshot 1 + + { + errors: [], + fixed: `# GitHub Footnote Syntax␊ + ␊ + > Example from ␊ + ␊ + Here is a simple footnote[^1].␊ + ␊ + A footnote can also have multiple lines[^2].␊ + ␊ + You can also use words, to fit your writing style more closely[^note].␊ + ␊ + [^1]: My reference.␊ + [^2]: Every new line should be prefixed with 2 spaces.␊ + This allows you to have a footnote with multiple lines.␊ + [^note]:␊ + Named footnotes will still render with numbers instead of the text but allow easier identification and linking.␊ + This footnote also has been made with a different syntax using 4 spaces for new lines.␊ + ␊ + ␊ + `, + } + +## h1-as-top-level-heading.md + +> Snapshot 1 + + { + errors: [], + fixed: `

H1 as Top-Level Heading

␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## h1-image-as-top-level-heading.md + +> Snapshot 1 + + { + errors: [], + fixed: `

A kitten

␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## h2-as-top-level-heading.md + +> Snapshot 1 + + { + errors: [], + fixed: `

H2 as Top-Level Heading

␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## h3-as-top-level-heading.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '

H3 as Top-Level Heading {M...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 1, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + ], + fixed: `

H3 as Top-Level Heading {MD041}

␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## hard-line-breaks.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 5, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 5, + }, + lineNumber: 9, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 6, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 6, + }, + lineNumber: 24, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 4, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 4, + }, + lineNumber: 32, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 8, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 8, + }, + lineNumber: 36, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 39, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + }, + lineNumber: 41, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 1, + }, + lineNumber: 43, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + }, + lineNumber: 48, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 5, + }, + lineNumber: 54, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 11, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 11, + }, + lineNumber: 58, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 11, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 11, + }, + lineNumber: 61, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + }, + lineNumber: 62, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 11, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 11, + }, + lineNumber: 63, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + }, + lineNumber: 65, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 22, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 22, + }, + lineNumber: 67, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + }, + lineNumber: 71, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Hard Line Breaks␊ + ␊ + hard ␊ + break␊ + ␊ + hard\\␊ + break␊ + ␊ + hard␊ + break␊ + ␊ + hard ␊ + break␊ + ␊ + hard\\␊ + break␊ + ␊ + *hard ␊ + break*␊ + ␊ + *hard\\␊ + break*␊ + ␊ + \`code␊ + span\`␊ + ␊ + \`code\\␊ + span\`␊ + ␊ + not\\␊ + ␊ + not␊ + ␊ + ## not\\␊ + ␊ + ### not␊ + ␊ + - Item␊ + ␊ + - Item␊ + ␊ + - Item␊ + ␊ + - Item␊ + ␊ + Text text␊ + text \`code␊ + span code␊ + span\` text␊ + text␊ + ␊ + Text text␊ + text text␊ + text␊ + ␊ + Text text␊ + text \`code␊ + span\` text␊ + ␊ + Text text␊ + text \`code␊ + span code␊ + span\` text␊ + ␊ + Text text␊ + ␊ + Text \`code span\` text␊ + ␊ + Text text ␊ + \`code span\` ␊ + text text␊ + ␊ + {MD009:9}␊ + {MD009:24}␊ + {MD009:32}␊ + {MD009:36}␊ + {MD009:39}␊ + {MD009:41}␊ + {MD009:43}␊ + {MD009:48}␊ + {MD009:54}␊ + {MD009:58}␊ + {MD009:61}␊ + {MD009:62}␊ + {MD009:63}␊ + {MD009:65}␊ + {MD009:67}␊ + {MD009:71}␊ + ␊ + ␊ + `, + } + +## heading-duplicate-content-siblings-only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h4; Actual: h5', + errorRange: null, + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + { + errorContext: 'B', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'C', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'G', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'E', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'A', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'B', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'Heading duplicate content sibl...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'BB', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'BBB', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'Headings', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 100, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'A', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'A', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'Heading duplicate content sibl...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'AA', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'BB', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 78, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `# Heading duplicate content siblings only␊ + ␊ + # A␊ + ␊ + {MD025:3}␊ + ␊ + ## B␊ + ␊ + ### C␊ + ␊ + ## B␊ + ␊ + {MD024:11}␊ + ␊ + ### C␊ + ␊ + ## D␊ + ␊ + ### C␊ + ␊ + ### E␊ + ␊ + ### C␊ + ␊ + {MD024:23}␊ + ␊ + ##### F␊ + ␊ + {MD001:27}␊ + ␊ + #### G␊ + ␊ + ##### F␊ + ␊ + #### G␊ + ␊ + {MD024:35}␊ + ␊ + ### E␊ + ␊ + {MD024:39}␊ + ␊ + # A␊ + ␊ + {MD024:43} {MD025:43}␊ + ␊ + ## B␊ + ␊ + ### C␊ + ␊ + ## B␊ + ␊ + {MD024:51}␊ + ␊ + # Heading duplicate content siblings only␊ + ␊ + {MD024:55} {MD025:55}␊ + ␊ + AA␊ + ==␊ + ␊ + {MD025:59}␊ + ␊ + AA␊ + --␊ + ␊ + BB␊ + --␊ + ␊ + CC␊ + --␊ + ␊ + BB␊ + --␊ + ␊ + {MD024:73}␊ + ␊ + BB␊ + ==␊ + ␊ + {MD025:78}␊ + ␊ + BB␊ + --␊ + ␊ + ## AAA ##␊ + ␊ + ### BBB ###␊ + ␊ + ## BBB ##␊ + ␊ + ### BBB ###␊ + ␊ + ## BBB ##␊ + ␊ + {MD024:94}␊ + ␊ + ## Headings ␊ + ␊ + ## Headings ␊ + ␊ + {MD024:-2}␊ + ␊ + ␊ + `, + } + +## heading-multiple-top-level-preceding-blank-and-comment.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Heading 2 {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `␊ + ␊ + ␊ + # Heading 1␊ + ␊ + # Heading 2 {MD025}␊ + `, + } + +## heading-multiple-top-level-preceding-blank.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Heading 2 {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 4, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `␊ + # Heading 1␊ + ␊ + # Heading 2 {MD025}␊ + `, + } + +## heading-multiple-top-level-preceding-comment.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Heading 2 {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 4, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `␊ + # Heading 1␊ + ␊ + # Heading 2 {MD025}␊ + `, + } + +## heading_duplicate_content.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Heading 1', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + { + errorContext: 'Heading 2', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1␊ + ␊ + ## Heading 2␊ + ␊ + ## Heading 1␊ + ␊ + ### Heading 2␊ + ␊ + ## Heading 3␊ + ␊ + {MD024:5} {MD024:7}␊ + `, + } + +## heading_duplicate_content_different_nesting.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Change log␊ + ␊ + ## 2.0.0␊ + ␊ + ### Bug fixes␊ + ␊ + ### Features␊ + ␊ + ## 1.0.0␊ + ␊ + ### Bug fixes␊ + ␊ + ␊ + `, + } + +## heading_duplicate_content_no_different_nesting.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Bug fixes', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Multiple headings with the same content', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md024.md', + ruleNames: [ + 'MD024', + 'no-duplicate-heading', + ], + severity: 'error', + }, + ], + fixed: `# Change log␊ + ␊ + ## 2.0.0␊ + ␊ + ### Bug fixes␊ + ␊ + ### Features␊ + ␊ + ## 1.0.0␊ + ␊ + ### Bug fixes␊ + ␊ + {MD024:11}␊ + `, + } + +## heading_increment-alt_title_level3_bad.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h2; Actual: h3', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + ], + fixed: `---␊ + alternate = heading_increment-alt_title_level3_bad␊ + ---␊ + ␊ + ### level 3 {MD001}␊ + ␊ + ␊ + `, + } + +## heading_increment-title_level2_good.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + title: heading_increment-title_level2_good␊ + ---␊ + ␊ + ## level 2␊ + ␊ + ### level 3␊ + `, + } + +## heading_increment-title_level3_bad.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h2; Actual: h3', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + ], + fixed: `---␊ + title: heading_increment-title_level3_bad␊ + ---␊ + ␊ + ### level 3 {MD001}␊ + `, + } + +## heading_multiple_toplevel.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Heading 2 {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1␊ + ␊ + # Heading 2 {MD025}␊ + ␊ +

␊ + # Not heading␊ +

␊ + ␊ + ␊ + `, + } + +## heading_mutliple_h1_no_toplevel.md + +> Snapshot 1 + + { + errors: [], + fixed: `Some introductory text␊ + ␊ + # Heading 1␊ + ␊ + # Heading 2␊ + ␊ + ␊ + `, + } + +## heading_trailing_punctuation.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Punctuation: \' .\'', + errorRange: [ + 19, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 19, + }, + lineNumber: 3, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' ,\'', + errorRange: [ + 19, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 19, + }, + lineNumber: 5, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' ;\'', + errorRange: [ + 19, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 19, + }, + lineNumber: 7, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' :\'', + errorRange: [ + 19, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 19, + }, + lineNumber: 9, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' !\'', + errorRange: [ + 19, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 19, + }, + lineNumber: 11, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' 。\'', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + }, + lineNumber: 15, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' ,\'', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + }, + lineNumber: 17, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' ;\'', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + }, + lineNumber: 19, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' :\'', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + }, + lineNumber: 21, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' !\'', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + }, + lineNumber: 23, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' !\'', + errorRange: [ + 29, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 29, + }, + lineNumber: 29, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \' !\'', + errorRange: [ + 30, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 30, + }, + lineNumber: 31, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + ], + fixed: `# Heading Trailing Punctuation␊ + ␊ + ## Heading {MD026}␊ + ␊ + ## Heading {MD026}␊ + ␊ + ## Heading {MD026}␊ + ␊ + ## Heading {MD026}␊ + ␊ + ## Heading {MD026}␊ + ␊ + ## Heading?␊ + ␊ + ## Heading/Full-Width {MD026}␊ + ␊ + ## Heading/Full-Width {MD026}␊ + ␊ + ## Heading/Full-Width {MD026}␊ + ␊ + ## Heading/Full-Width {MD026}␊ + ␊ + ## Heading/Full-Width {MD026}␊ + ␊ + ## Heading/Full-Width?␊ + ␊ + ␊ + ␊ + ## Heading {MD026} alternate ##␊ + ␊ + Heading {MD026} alternate too␊ + -------------------------------␊ + `, + } + +## heading_trailing_punctuation_customized.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Punctuation: \'.\'', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 1, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \',\'', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 3, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \':\'', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 7, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \';\'', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 9, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \'?\'', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 11, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \']\'', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 13, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1 {MD026}␊ + ␊ + ## Heading 2 {MD026}␊ + ␊ + ## Heading 3!␊ + ␊ + ## Heading 4 {MD026}␊ + ␊ + ## Heading 5 {MD026}␊ + ␊ + ## Heading 6 {MD026}␊ + ␊ + ## Heading 7 {MD026}␊ + ␊ + The rule has been customized to allow exclamation point while disallowing␊ + everything else.␊ + ␊ + ␊ + `, + } + +## heading_trailing_punctuation_empty.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading Trailing Punctuation␊ + ␊ + ## Heading .␊ + ␊ + ## Heading ,␊ + ␊ + ## Heading ;␊ + ␊ + ## Heading :␊ + ␊ + ## Heading !␊ + ␊ + ## Heading ?␊ + ␊ + ␊ + `, + } + +## headings-with-emoji.md + +> Snapshot 1 + + { + errors: [], + fixed: `# headings-with-emoji␊ + ␊ + ## Known Issues :bug:␊ + ␊ + ## Love :heartpulse:␊ + ␊ + ## :tada:␊ + ␊ + ## :checkered_flag:␊ + ␊ + ## :clock930:␊ + ␊ + ## :t-rex:␊ + ␊ + ## Boba:bubble_tea:␊ + ␊ + ␊ + ␊ + ## Fix the :bug: ##␊ + ␊ + Another :heartpulse:␊ + --------------------␊ + ␊ + :eyes:␊ + ------␊ + `, + } + +## headings-with-html-entities.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Punctuation: \';\'', + errorRange: [ + 31, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 31, + }, + lineNumber: 24, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \';\'', + errorRange: [ + 34, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 34, + }, + lineNumber: 26, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Punctuation: \';\'', + errorRange: [ + 31, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 31, + }, + lineNumber: 28, + ruleDescription: 'Trailing punctuation in heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md', + ruleNames: [ + 'MD026', + 'no-trailing-punctuation', + ], + severity: 'error', + }, + ], + fixed: `# headings-with-html-entities␊ + ␊ + ␊ + ␊ + ## Copyright © 2000␊ + ␊ + ## Copyright 2001 ©␊ + ␊ + ## Copyright 2002©␊ + ␊ + ## Copyright 2003 ©␊ + ␊ + ## Copyright 2004 ©␊ + ␊ + ## Copyright 2004 ©␊ + ␊ + ## Copyright 2005 ©␊ + ␊ + ## Copyright 2006 © ##␊ + ␊ + Copyright 2007 ©␊ + ---------------------␊ + ␊ + ## Copyright 2008 {MD026} copy␊ + ␊ + ## Copyright 2009 {MD026} #x000A9␊ + ␊ + ## Copyright 2010 {MD026} #169␊ + `, + } + +## headings-with-invalid-spaces.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Non-breaking space {MD018}', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + editColumn: 3, + insertText: ' ', + }, + lineNumber: 7, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '##  Extra non-breaking space {...', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + editColumn: 3, + insertText: ' ', + }, + lineNumber: 25, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## Extra normal space {MD019}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 23, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## Extra Tab {MD019}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 27, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## Non-breaking space (left) {...', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 39, + editColumn: 1, + insertText: '##  Non-breaking space (left) {MD020} ##', + }, + lineNumber: 15, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '...aking space (right) {MD020} ##', + errorDetail: null, + errorRange: [ + 38, + 3, + ], + fixInfo: { + deleteCount: 40, + editColumn: 1, + insertText: '## Non-breaking space (right) {MD020}  ##', + }, + lineNumber: 19, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '##  Extra non-breaking space (...', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 46, + editColumn: 1, + insertText: '##   Extra non-breaking space (left) {MD020} ##', + }, + lineNumber: 31, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '...king space (right) {MD020}  ##', + errorDetail: null, + errorRange: [ + 45, + 3, + ], + fixInfo: { + deleteCount: 47, + editColumn: 1, + insertText: '## Extra non-breaking space (right) {MD020}   ##', + }, + lineNumber: 35, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Extra Normal space (both) ...', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 29, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '...ormal space (both) {MD021} ##', + errorDetail: null, + errorRange: [ + 39, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 39, + }, + lineNumber: 29, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Extra tab (left) {MD021} #...', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 33, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '... Extra tab (right) {MD021} ##', + errorDetail: null, + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 37, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + ], + fixed: `# Headings with invalid spaces␊ + ␊ + ## Normal space␊ + ␊ + ##  Normal outer non-breaking inner space␊ + ␊ + ##  Non-breaking space {MD018}␊ + ␊ + ## Tab␊ + ␊ + ## Normal space (both) ##␊ + ␊ + ##  Normal outer non-breaking inner space (both)  ##␊ + ␊ + ##  Non-breaking space (left) {MD020} ##␊ + ␊ + ## Tab (left) ##␊ + ␊ + ## Non-breaking space (right) {MD020}  ##␊ + ␊ + ## Tab (right) ##␊ + ␊ + ## Extra normal space {MD019}␊ + ␊ + ##   Extra non-breaking space {MD018}␊ + ␊ + ## Extra Tab {MD019}␊ + ␊ + ## Extra Normal space (both) {MD021} ##␊ + ␊ + ##   Extra non-breaking space (left) {MD020} ##␊ + ␊ + ## Extra tab (left) {MD021} ##␊ + ␊ + ## Extra non-breaking space (right) {MD020}   ##␊ + ␊ + ## Extra tab (right) {MD021} ##␊ + ␊ + ␊ + `, + } + +## headings-without-content.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '#', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 10, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '#', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 12, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '##', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 18, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '##', + errorDetail: null, + errorRange: [ + 4, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 4, + }, + lineNumber: 20, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + ], + fixed: `# Headings Without Content␊ + ␊ + ␊ + ␊ + ␊ + #␊ + ␊ + # ␊ + ␊ + # ␊ + ␊ + # ␊ + ␊ + ##␊ + ␊ + ## ␊ + ␊ + ## ␊ + ␊ + ## ␊ + ␊ + {MD019:10} {MD019:12} {MD019:18} {MD019:20}␊ + `, + } + +## headings_bad.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h2; Actual: h3', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: h3; Actual: h4', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + ### Heading 3 {MD001}␊ + ␊ + ## Heading 2␊ + ␊ + #### Heading 4 {MD001}␊ + ␊ +

␊ + ###### Not heading␊ +

␊ + ␊ + ␊ + `, + } + +## headings_good.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading 1␊ + ␊ + ## Heading 2␊ + ␊ + ## Heading 3␊ + `, + } + +## headings_good_setext_with_atx.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: setext; Actual: atx', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `Heading 1␊ + =========␊ + ␊ + Heading 2␊ + ---------␊ + ␊ + ## Heading 2 {MD003}␊ + ␊ + ### Heading 3␊ + ␊ + #### Heading 4 {MD003} ####␊ + ␊ + ␊ + `, + } + +## headings_good_setext_with_atx_closed.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: setext; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx_closed; Actual: atx', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `Heading 1␊ + =========␊ + ␊ + Heading 2␊ + ---------␊ + ␊ + ## Heading 2 {MD003} ##␊ + ␊ + ### Heading 3 ###␊ + ␊ + #### Heading 4 {MD003}␊ + ␊ + ␊ + `, + } + +## headings_good_with_issue_numbers.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading 1␊ + ␊ + ## Heading 2␊ + ␊ + See the following issues:␊ + ␊ + * #1234␊ + * #5678 (and related)␊ + * #5678␊ + * #9101␊ + ␊ + ## Heading 3␊ + `, + } + +## headings_surrounding_space_atx.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Heading 2 {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 4, + }, + lineNumber: 3, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '## Heading 3 {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 5, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '## Heading 3 {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 6, + }, + lineNumber: 5, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '## Heading 4 {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 7, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1␊ + ␊ + ## Heading 2 {MD022}␊ + ␊ + Some text␊ + ␊ + ## Heading 3 {MD022}␊ + ␊ + Some text␊ + ␊ + ## Heading 4 {MD022}␊ + ␊ + ## Heading 5␊ + ␊ + * This shouldn't trigger MD022, but did because of some bug where we tried to␊ + #catch headings that kramdown didn't parse correctly.␊ + `, + } + +## headings_surrounding_space_setext.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Heading 2 {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 6, + }, + lineNumber: 4, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Some text {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 6, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Some text {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 9, + }, + lineNumber: 6, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Some text {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 9, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Some text {MD022} {MD025}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 12, + }, + lineNumber: 9, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: 'Some text {MD022} {MD025} Head...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + { + errorContext: 'Some text {MD022} {MD025} Head...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `Heading 1␊ + =========␊ + ␊ + Heading 2 {MD022}␊ + -----------------␊ + ␊ + Some text {MD022} {MD025}␊ + Heading 3␊ + =================␊ + ␊ + Some text {MD022} {MD025}␊ + Heading 4␊ + =================␊ + ␊ + Some text␊ + ␊ + Heading 5␊ + ---------␊ + `, + } + +## headings_with_spaces_at_the_beginning.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '# Test {MD022} Valid heading for CommonMark (see section 5.2)', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 19, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '# Test {MD022} Valid heading for CommonMark (see section 5.2)', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 20, + }, + lineNumber: 19, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '# Test {MD022} {MD023} Also valid heading for CommonMark', + errorDetail: 'Expected: 1; Actual: 0; Above', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 20, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: ' # Heading 1 {MD023}', + errorDetail: null, + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 3, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + { + errorContext: ' Setext style fully indented {...', + errorDetail: null, + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 5, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + { + errorContext: ' Setext style title only inden...', + errorDetail: null, + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 8, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + { + errorContext: ' # Test {MD022} {MD023} Als...', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 20, + ruleDescription: 'Headings must start at the beginning of the line', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md', + ruleNames: [ + 'MD023', + 'heading-start-left', + ], + severity: 'error', + }, + ], + fixed: `Some text␊ + ␊ + # Heading 1 {MD023}␊ + ␊ + Setext style fully indented {MD023}␊ + ===================================␊ + ␊ + Setext style title only indented {MD023}␊ + =========================================␊ + ␊ + * Test situations in which MD023 shouldn't be triggered.␊ + ␊ + \`\`\`rb␊ + # This shouldn't trigger MD023 as it is a code comment.␊ + foo = "And here is some code"␊ + \`\`\`␊ + ␊ + * This is another case where MD023 shouldn't be triggered␊ + ␊ + # Test {MD022} Valid heading for CommonMark (see section 5.2)␊ + ␊ + # Test {MD022} {MD023} Also valid heading for CommonMark␊ + ␊ + ␊ + `, + } + +## hr-in-blockquote-dash.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: - - -', + errorRange: null, + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# HR in Blockquote, Dash␊ + ␊ + ---␊ + ␊ + ***␊ + ␊ + ___␊ + ␊ + {MD035:5} {MD035:7}␊ + ␊ + > Text␊ + >␊ + > ---␊ + >␊ + > ***␊ + >␊ + > ___␊ + >␊ + > Text␊ + ␊ + {MD035:15} {MD035:17}␊ + ␊ + - - -␊ + ␊ + > Text␊ + >␊ + > > Text␊ + > >␊ + > > ---␊ + > >␊ + > > ***␊ + > >␊ + > > ___␊ + > >␊ + > > Text␊ + >␊ + > Text␊ + ␊ + {MD035:23} {MD035:31} {MD035:33}␊ + `, + } + +## hr-in-blockquote-star.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: * * *', + errorRange: null, + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# HR in Blockquote, Star␊ + ␊ + ***␊ + ␊ + ___␊ + ␊ + ---␊ + ␊ + {MD035:5} {MD035:7}␊ + ␊ + > Text␊ + >␊ + > ---␊ + >␊ + > ***␊ + >␊ + > ___␊ + >␊ + > Text␊ + ␊ + {MD035:13} {MD035:17}␊ + ␊ + * * *␊ + ␊ + > Text␊ + >␊ + > > Text␊ + > >␊ + > > ---␊ + > >␊ + > > ***␊ + > >␊ + > > ___␊ + > >␊ + > > Text␊ + >␊ + > Text␊ + ␊ + {MD035:23} {MD035:29} {MD035:33}␊ + `, + } + +## hr-in-blockquote-under.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: _ _ _', + errorRange: null, + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# HR in Blockquote, Under␊ + ␊ + ___␊ + ␊ + ---␊ + ␊ + ***␊ + ␊ + {MD035:5} {MD035:7}␊ + ␊ + > Text␊ + >␊ + > ---␊ + >␊ + > ***␊ + >␊ + > ___␊ + >␊ + > Text␊ + ␊ + {MD035:13} {MD035:15}␊ + ␊ + _ _ _␊ + ␊ + > Text␊ + >␊ + > > Text␊ + > >␊ + > > ---␊ + > >␊ + > > ***␊ + > >␊ + > > ___␊ + > >␊ + > > Text␊ + >␊ + > Text␊ + ␊ + {MD035:23} {MD035:29} {MD035:31}␊ + `, + } + +## hr-in-list-dash.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: - ---', + errorRange: null, + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: * ***', + errorRange: null, + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# HR in List, Dash␊ + ␊ + ---␊ + ␊ + ***␊ + ␊ + ___␊ + ␊ + {MD035:5} {MD035:7}␊ + ␊ + ␊ + ␊ + - list␊ + - ---␊ + - list␊ + - ***␊ + - list␊ + - ___␊ + - list␊ + ␊ + {MD035:14} {MD035:16} {MD035:18}␊ + ␊ + * list␊ + * ---␊ + * list␊ + * ***␊ + * list␊ + * ___␊ + * list␊ + ␊ + {MD035:26} {MD035:28}␊ + `, + } + +## hr-in-list-star.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: - ---', + errorRange: null, + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: * ***', + errorRange: null, + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# HR in List, Star␊ + ␊ + ***␊ + ␊ + ___␊ + ␊ + ---␊ + ␊ + {MD035:5} {MD035:7}␊ + ␊ + ␊ + ␊ + - list␊ + - ---␊ + - list␊ + - ***␊ + - list␊ + - ___␊ + - list␊ + ␊ + {MD035:14} {MD035:18}␊ + ␊ + * list␊ + * ---␊ + * list␊ + * ***␊ + * list␊ + * ___␊ + * list␊ + ␊ + {MD035:24} {MD035:26} {MD035:28}␊ + `, + } + +## hr-in-list-under.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: - ---', + errorRange: null, + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ___; Actual: * ***', + errorRange: null, + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# HR in List, Under␊ + ␊ + ___␊ + ␊ + ---␊ + ␊ + ***␊ + ␊ + {MD035:5} {MD035:7}␊ + ␊ + ␊ + ␊ + - list␊ + - ---␊ + - list␊ + - ***␊ + - list␊ + - ___␊ + - list␊ + ␊ + {MD035:14} {MD035:16}␊ + ␊ + * list␊ + * ---␊ + * list␊ + * ***␊ + * list␊ + * ___␊ + * list␊ + ␊ + {MD035:24} {MD035:26}␊ + `, + } + +## hr-style-custom.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: - - -; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: - - -; Actual: - - -', + errorRange: null, + fixInfo: null, + lineNumber: 10, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: - - -; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# HR Style Custom␊ + ␊ + Text␊ + ␊ + ---␊ + {MD035:5}␊ + ␊ + Text␊ + ␊ + - - -␊ + {MD035:10}␊ + ␊ + Text␊ + ␊ + - - -␊ + ␊ + Text␊ + ␊ + ***␊ + {MD035:19}␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## hr_style_dashes.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: * * *', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: *****', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: - - -', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: -----', + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: _ _ _', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: _____', + errorRange: null, + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# hr_style_dashes␊ + ␊ + ***␊ + ␊ + * * *␊ + ␊ + *****␊ + ␊ + ---␊ + ␊ + - - -␊ + ␊ + -----␊ + ␊ + ___␊ + ␊ + _ _ _␊ + ␊ + _____␊ + ␊ + ***␊ + ␊ + {MD035:3} {MD035:5} {MD035:7} {MD035:11} {MD035:13}␊ + {MD035:15} {MD035:17} {MD035:19} {MD035:21}␊ + ␊ + ␊ + `, + } + +## hr_style_inconsistent.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: * * *', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: *****', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: - - -', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: -----', + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: _ _ _', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: _____', + errorRange: null, + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# hr_style_inconsistent␊ + ␊ + ***␊ + ␊ + * * *␊ + ␊ + *****␊ + ␊ + ---␊ + ␊ + - - -␊ + ␊ + -----␊ + ␊ + ___␊ + ␊ + _ _ _␊ + ␊ + _____␊ + ␊ + ***␊ + ␊ + {MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15} {MD035:17} {MD035:19}␊ + `, + } + +## hr_style_long.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: * * *', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: *****', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: - - -', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: -----', + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: _ _ _', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: _____; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# hr_style_long␊ + ␊ + ***␊ + ␊ + * * *␊ + ␊ + *****␊ + ␊ + ---␊ + ␊ + - - -␊ + ␊ + -----␊ + ␊ + ___␊ + ␊ + _ _ _␊ + ␊ + _____␊ + ␊ + ***␊ + ␊ + {MD035:3} {MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15}␊ + {MD035:17} {MD035:21}␊ + ␊ + ␊ + `, + } + +## hr_style_stars.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: * * *', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: *****', + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ---', + errorRange: null, + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: - - -', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: -----', + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: ___', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: _ _ _', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ***; Actual: _____', + errorRange: null, + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# hr_style_stars␊ + ␊ + ***␊ + ␊ + * * *␊ + ␊ + *****␊ + ␊ + ---␊ + ␊ + - - -␊ + ␊ + -----␊ + ␊ + ___␊ + ␊ + _ _ _␊ + ␊ + _____␊ + ␊ + ***␊ + ␊ + {MD035:5} {MD035:7} {MD035:9} {MD035:11} {MD035:13} {MD035:15} {MD035:17} {MD035:19}␊ + ␊ + ␊ + `, + } + +## html-comment-in-code-and-table.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + }, + lineNumber: 39, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + ], + fixed: `# HTML Comment in Code and Table␊ + ␊ + \`{MD038}\`␊ + ␊ + ␊ + ␊ + \`\`\`text␊ + ␊ + \`\`\`␊ + ␊ + ␊ + ␊ + | Table |␊ + |------------|␊ + | \`{MD038}\` |␊ + ␊ + * item␊ + ␊ + \`{MD038}\`␊ + ␊ + * item␊ + ␊ + ␊ + ␊ + * item␊ + ␊ + \`\`\`text␊ + ␊ + \`\`\`␊ + ␊ + * item␊ + ␊ + ␊ + ␊ + * item␊ + ␊ + | Table |␊ + |------------|␊ + | \`{MD038}\` |␊ + ␊ + ␊ + `, + } + +## html-comment-in-list-item.md + +> Snapshot 1 + + { + errors: [], + fixed: `# HTML Comment in List Item␊ + ␊ + - item␊ + ␊ + ␊ + ␊ + - item␊ + ␊ + x␊ + ␊ + - item␊ + ␊ + x␊ + ␊ + - item␊ + ␊ + xx␊ + ␊ + - item␊ + ␊ + \`\`\`html␊ + ␊ + \`\`\`␊ + ␊ + - item␊ + ␊ + \`\`\`html␊ + x␊ + \`\`\`␊ + ␊ + - item␊ + ␊ + \`\`\`html␊ + x␊ + \`\`\`␊ + ␊ + - item␊ + ␊ + \`\`\`html␊ + xx␊ + \`\`\`␊ + ␊ + - item␊ + `, + } + +## html-comment-in-markdown-table.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 16, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 22, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 28, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 19, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 19, + }, + lineNumber: 40, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 19, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 19, + }, + lineNumber: 46, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`{MD038} `', + errorDetail: null, + errorRange: [ + 19, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 19, + }, + lineNumber: 52, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + ], + fixed: `# HTML Comment in Markdown Table␊ + ␊ + \`\`\`xml␊ + ␊ + \`\`\`␊ + ␊ + | Table |␊ + |-------|␊ + | |␊ + ␊ + | Table |␊ + |------------|␊ + | |␊ + ␊ + | Table |␊ + |----------------|␊ + | |␊ + | cell |␊ + ␊ + | Table |␊ + |----------------|␊ + | |␊ + | cell |␊ + ␊ + | Table | Table |␊ + |-------|-------|␊ + | cell | |␊ + ␊ + | Table | Table |␊ + |-------|------------|␊ + | cell | |␊ + ␊ + | Table | Table |␊ + |-------|----------------|␊ + | cell | |␊ + | cell | cell |␊ + ␊ + | Table | Table |␊ + |-------|----------------|␊ + | cell | |␊ + | cell | cell |␊ + ␊ + ␊ + `, + } + +## html-comments.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '} *', + errorDetail: null, + errorRange: [ + 16, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 16, + }, + lineNumber: 51, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '} *', + errorDetail: null, + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + }, + lineNumber: 53, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + ], + fixed: `# HTML Comments␊ + ␊ + ## Block Comments␊ + ␊ + ␊ + ␊ + ␊ + ␊ + text␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + *text * -->␊ + ␊ + *text * -->␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ## Inline Comments␊ + ␊ + ␊ + ␊ + t␊ + ␊ + ttext␊ + ␊ + t␊ + ␊ + t␊ + ␊ + t␊ + ␊ + t␊ + ␊ + t *{MD037}* -->␊ + ␊ + t *{MD037}* -->␊ + ␊ + t␊ + ␊ + t␊ + ␊ + t␊ + `, + } + +## html-tags.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 6, + 4, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: p', + errorRange: [ + 1, + 3, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 7, + 4, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 7, + 4, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 36, + 4, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 9, + 4, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 14, + 4, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 6, + 4, + ], + fixInfo: null, + lineNumber: 37, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 6, + 4, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 56, + 4, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 35, + 4, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: problem', + errorRange: [ + 3, + 9, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: problem', + errorRange: [ + 8, + 9, + ], + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 8, + 4, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: em', + errorRange: [ + 18, + 4, + ], + fixInfo: null, + lineNumber: 84, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: a', + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 90, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: img', + errorRange: [ + 6, + 39, + ], + fixInfo: null, + lineNumber: 91, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: foo-bar-baz', + errorRange: [ + 1, + 13, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: details', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 109, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: details', + errorRange: [ + 2, + 9, + ], + fixInfo: null, + lineNumber: 116, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: custom-element', + errorRange: [ + 1, + 35, + ], + fixInfo: null, + lineNumber: 120, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + ], + fixed: `# Detailed HTML Results␊ + ␊ + Text␊ + ␊ + Block block {MD033}␊ + ␊ + Text inline inline {MD033} text␊ + ␊ + Text␊ + ␊ + Block block␊ + ␊ + Text inline inline text␊ + ␊ + Text␊ + ␊ +

␊ + Block {MD033:17}␊ + block block {MD033} block␊ + block␊ + block block block␊ + block␊ + block block block block block {MD033}␊ + block block block block block {MD033}␊ +

␊ + ␊ + Text␊ + ␊ + Block block {MD033}␊ + ␊ + Text inline inline {MD033} text␊ + ␊ + Text␊ + ␊ + Block block {MD033}␊ + ␊ + Text inline inline {MD033} text␊ + ␊ + Text␊ + ␊ + Text inline text inline text inline text {MD033}␊ + ␊ + Text inline text inline text inline {MD033}␊ + ␊ + Text␊ + ␊ + \\Block block\\␊ + ␊ + \\\\Block block {MD033}\\\\␊ + ␊ + Block block␊ + ␊ + Text \\inline inline\\ text␊ + ␊ + Text \\\\inline inline {MD033}\\\\ text␊ + ␊ + Text inline inline text␊ + ␊ + Text␊ + ␊ + > Text inline inline {MD033} text␊ + > text inline inline text␊ + ␊ + Text␊ + ␊ + Text inline inline text␊ + text inline inline text␊ + ␊ + Text␊ + ␊ + \`\`\`html␊ + Text inline inline text␊ + text inline inline text␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + \`\`␊ + ␊ + Text \`\`\`\` text␊ + ␊ + Text \`\` text \`\`\`\` text \`\`\`\`\`\` text␊ + ␊ + Text \`\` text inline {MD033} text␊ + ␊ + Text \`\`text text\`\` text␊ + ␊ + Text␊ + ␊ + Text inline {MD033} text␊ + text Description text {MD033}␊ + ␊ + Text␊ + ␊ + is an email autolink.␊ + ␊ + Another email autolink: .␊ + ␊ + Text␊ + ␊ + is an HTML element. {MD033}␊ + ␊ + But is not an autolink or HTML element.␊ + And neither is .␊ + Nor <123abc>.␊ + ␊ + Text␊ + ␊ +
␊ + ␊ + {MD033:109}␊ + ␊ +
␊ + ␊ + - Item␊ +
␊ + ␊ + {MD033:116}␊ + ␊ + ␊ + ␊ + {MD033:120}␊ + ␊ + Text text.␊ + ␊ + ␊ + `, + } + +## hugo-quickstart-example-blank.md + +> Snapshot 1 + + { + errors: [], + fixed: `+++␊ + date = "2016-02-14T16:11:58+05:30"␊ + draft = true␊ + title = "Good to Great Book Review"␊ + ␊ + +++␊ + ␊ + # Heading 1␊ + ␊ + ␊ + `, + } + +## hugo-quickstart-example-clean.md + +> Snapshot 1 + + { + errors: [], + fixed: `+++␊ + date = "2016-02-14T16:11:58+05:30"␊ + draft = true␊ + title = "Good to Great Book Review"␊ + ␊ + +++␊ + # Heading 1␊ + ␊ + ␊ + `, + } + +## hugo-quickstart-example-json.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Heading {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `{␊ + "title": "Another Hugo Post",␊ + "description": "Nothing special, but one post is boring.",␊ + "date": "2014-09-02",␊ + "categories": [ "example", "configuration" ],␊ + "tags": [␊ + "example",␊ + "hugo",␊ + "toml"␊ + ],␊ + }␊ + ␊ + # Heading {MD025}␊ + `, + } + +## ignore-comments.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 29, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 39, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 3, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 5, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 10', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + insertText: ' ', + }, + lineNumber: 5, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 16', + errorRange: [ + 16, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 16, + insertText: ' ', + }, + lineNumber: 5, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 22, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 24, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + ], + fixed: `# ignore-comments.md␊ + ␊ + Hard tab {MD010}␊ + ␊ + Hard tabs hard tabs {MD010}␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + Text comment␊ + Hard tab {MD010}␊ + --> text␊ + ␊ + Text␊ + ␊ + Text {MD009}␊ + ␊ + Text␊ + ␊ + Text␊ + ␊ + Text {MD009}␊ + ␊ + Text␊ + ␊ + ␊ + ␊ + Hard tab␊ + `, + } + +## ignore-html-block.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: style', + errorRange: [ + 1, + 7, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + ], + fixed: `# ignore-html-block.md␊ + ␊ + ␊ + `, + } + +## inconsistent_bullet_indent_same_level.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 4, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# Inconsistent Bullet Indent Same Level␊ + ␊ + * Item␊ + * Item {MD007}␊ + * Item {MD005}␊ + * Item␊ + `, + } + +## inconsistent_bullet_styles_asterisk.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: plus', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '*', + }, + lineNumber: 4, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: dash', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '*', + }, + lineNumber: 5, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: plus', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '*', + }, + lineNumber: 9, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: dash', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '*', + }, + lineNumber: 10, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# inconsistent_bullet_styles_asterisk␊ + ␊ + * Item␊ + * Item {MD004}␊ + * Item {MD004}␊ + * Item␊ + ␊ + > * Item␊ + > * Item {MD004}␊ + > * Item {MD004}␊ + > * Item␊ + `, + } + +## inconsistent_bullet_styles_dash.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '-', + }, + lineNumber: 4, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '-', + }, + lineNumber: 5, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '-', + }, + lineNumber: 9, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '-', + }, + lineNumber: 10, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# inconsistent_bullet_styles_dash␊ + ␊ + - Item␊ + - Item {MD004}␊ + - Item {MD004}␊ + - Item␊ + ␊ + > - Item␊ + > - Item {MD004}␊ + > - Item {MD004}␊ + > - Item␊ + `, + } + +## inconsistent_bullet_styles_plus.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '+', + }, + lineNumber: 4, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '+', + }, + lineNumber: 5, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '+', + }, + lineNumber: 9, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '+', + }, + lineNumber: 10, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# inconsistent_bullet_styles_plus␊ + ␊ + + Item␊ + + Item {MD004}␊ + + Item {MD004}␊ + + Item␊ + ␊ + > + Item␊ + > + Item {MD004}␊ + > + Item {MD004}␊ + > + Item␊ + `, + } + +## incorrect_bullet_style_asterisk.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: dash', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '*', + }, + lineNumber: 4, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: plus', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '*', + }, + lineNumber: 5, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# incorrect_bullet_style_asterisk␊ + ␊ + * Item␊ + * Item {MD004}␊ + * Item {MD004}␊ + ␊ + ␊ + `, + } + +## incorrect_bullet_style_dash.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 3, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '-', + }, + lineNumber: 5, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# incorrect_bullet_style_dash␊ + ␊ + - Item {MD004}␊ + - Item␊ + - Item {MD004}␊ + ␊ + ␊ + `, + } + +## incorrect_bullet_style_plus.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '+', + }, + lineNumber: 3, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '+', + }, + lineNumber: 4, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# incorrect_bullet_style_plus␊ + ␊ + + Item {MD004}␊ + + Item {MD004}␊ + + Item␊ + ␊ + ␊ + `, + } + +## incorrect_heading_atx.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 1, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: setext', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1 {MD003} #␊ + ␊ + ## Heading 2␊ + ␊ + Heading 3 {MD003}␊ + -----------------␊ + ␊ + ␊ + `, + } + +## incorrect_heading_atx_closed.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: atx_closed; Actual: atx', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx_closed; Actual: setext', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1 #␊ + ␊ + ## Heading 2 {MD003}␊ + ␊ + Heading 3 {MD003}␊ + -----------------␊ + ␊ + ␊ + `, + } + +## incorrect_heading_setext.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: setext; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 1, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: setext; Actual: atx', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1 {MD003} #␊ + ␊ + ## Heading 2 {MD003}␊ + ␊ + Heading 3␊ + ---------␊ + ␊ + ␊ + `, + } + +## inline-capture-restore.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 52, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 64, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 70, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 76, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 82, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 88, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 94, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 104, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 116, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 4, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 14, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 30, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 83, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 117, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 21, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 37, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 48, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 54, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 60, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 66, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 72, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 78, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 84, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 90, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + ], + fixed: `# Inline Capture/Restore␊ + ␊ + hard tab␊ + space *in* emphasis {MD037}␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in \` code␊ + ␊ + ␊ + hard tab␊ + space *in* emphasis {MD037}␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in \` code␊ + ␊ + ␊ + hard tab␊ + space *in* emphasis {MD037}␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in \` code␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in* emphasis {MD037}␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in * emphasis␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in * emphasis␊ + space \`in \` code␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in \` code␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in * emphasis␊ + space \`in \` code␊ + ␊ + ␊ + ␊ + hard tab␊ + space *in * emphasis␊ + space \`in \` code␊ + ␊ + ␊ + ␊ + hard tab {MD010}␊ + space *in* emphasis {MD037}␊ + space \`in \` code␊ + ␊ + ␊ + `, + } + +## inline-configure-file-invalid.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Inline Configure File Invalid␊ + ␊ + Not normally too long of a line, but it would have been from an inline config.␊ + ␊ + ␊ + `, + } + +## inline-configure-file-multiple-instances.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# Inline Configure File Multiple Instances␊ + ␊ + ***␊ + {MD035:3}␊ + ␊ + Trailing spaces: ␊ + ␊ + ␊ + ␊ + ***␊ + {MD035:17}␊ + ␊ + Trailing spaces: ␊ + ␊ + ␊ + ␊ + ***␊ + {MD035:30}␊ + ␊ + Trailing spaces: ␊ + `, + } + +## inline-configure-file-multiple-lines.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ---; Actual: ***', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Horizontal rule style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md', + ruleNames: [ + 'MD035', + 'hr-style', + ], + severity: 'error', + }, + ], + fixed: `# Inline Configure File Multiple Lines␊ + ␊ + ***␊ + {MD035:3}␊ + ␊ + Trailing spaces: ␊ + ␊ + ␊ + ␊ + ***␊ + {MD035:17}␊ + ␊ + Trailing spaces: ␊ + `, + } + +## inline-configure-file-single-line.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 70; Actual: 78', + errorRange: [ + 71, + 8, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 70; Actual: 85', + errorRange: [ + 71, + 15, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Inline Configure File Single Line␊ + ␊ + Not normally too long of a line, but it is here from an inline config. {MD013}␊ + ␊ + {MD013}␊ + `, + } + +## inline-configure-file-violations.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '* w', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'h *', + errorDetail: null, + errorRange: [ + 16, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 16, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + ], + fixed: `# Inline Configure File Violations␊ + ␊ + Emphasis *with* spaces {MD037}␊ + ␊ + Trailing spaces: ␊ + ␊ + ␊ + `, + } + +## inline-disable-enable-file.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 3, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 13, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 21, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 30, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 23, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 32, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + hard tab {MD010}␊ + ␊ + space *in* emphasis {MD037}␊ + ␊ + space \`in \` code␊ + ␊ + ␊ + ␊ + hard tab␊ + ␊ + space *in* emphasis {MD037}␊ + ␊ + space \`in \` code␊ + ␊ + ␊ + ␊ + hard tab␊ + ␊ + space *in* emphasis {MD037}␊ + ␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + ␊ + hard tab␊ + ␊ + space *in* emphasis {MD037}␊ + ␊ + space \`in\` code {MD038}␊ + ␊ + ␊ + `, + } + +## inline-disable-enable.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 3, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 11, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 19, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 27, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 35, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 43, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 45, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 47, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 52, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 55, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 61, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 64, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 67, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 73, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 76, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 77, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 79, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 82, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 85, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 93, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 95, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 97, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 99, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Column: 5', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: ' ', + }, + lineNumber: 101, + ruleDescription: 'Hard tabs', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md', + ruleNames: [ + 'MD010', + 'no-hard-tabs', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: b', + errorRange: [ + 10, + 3, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 11, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 23, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 39, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 47, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 52, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 55, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 61, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 64, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 67, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 73, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 76, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 77, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 79, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 81, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 82, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 84, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 85, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 87, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 89, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 90, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 93, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 95, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 97, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 99, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 100, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 101, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 103, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 104, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 105, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 11, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 52, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 52, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 47, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 52, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 55, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 61, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 67, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 73, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 76, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 77, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 79, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 82, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 85, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 52, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 52, + }, + lineNumber: 87, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 52, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 52, + }, + lineNumber: 90, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 93, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 95, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 97, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 99, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 60, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 60, + }, + lineNumber: 101, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 52, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 52, + }, + lineNumber: 103, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`in `', + errorDetail: null, + errorRange: [ + 52, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 52, + }, + lineNumber: 105, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab / space *in * emphasis / space \`in \` code␊ + ␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code␊ + ␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + before after␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code␊ + ␊ + beforeafter␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code␊ + ␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab {MD010} ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab ␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + hard tab / space *in * emphasis / space \`in \` code␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in \` code␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + embedded {MD033} HTML␊ + ␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab / space *in * emphasis / space \`in \` code␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + hard tab / space *in * emphasis / space \`in \` code␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code␊ + hard tab / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + hard tab / space *in * emphasis / space \`in \` code ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + hard tab / space *in * emphasis / space \`in \` code␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + hard tab / space *in * emphasis / space \`in \` code␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code ␊ + hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + hard tab / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + hard tab / space *in* emphasis {MD037} / space \`in \` code␊ + hard tab / space *in* emphasis {MD037} / space \`in\` code {MD038}␊ + ␊ + `, + } + +## inline_html-allowed_elements.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: h2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: h2', + errorRange: [ + 10, + 4, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: h2', + errorRange: [ + 10, + 4, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 6, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 15, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 16, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 23, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 24, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: article', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 37, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: article', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 46, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: Article', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: Br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 13, + 4, + ], + fixInfo: null, + lineNumber: 60, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + ], + fixed: `# inline_html-allowed_elements␊ + ␊ +

This is allowed.

␊ + ␊ +

This is not allowed. {MD033}

␊ + ␊ +

This is allowed.

␊ + ␊ +

This

is not

allowed. {MD033}␊ + ␊ +

This

is not

allowed. {MD033}␊ + ␊ +
␊ + ␊ +
␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ +

␊ + This is allowed.␊ +

␊ + ␊ +
{MD033}␊ + This is not allowed.␊ +
␊ + ␊ +

␊ +

{MD033}␊ + This is not allowed.␊ +
␊ +
␊ +
{MD033}␊ +

␊ + ␊ +

␊ +

{MD033}␊ + This is not allowed.␊ +
␊ +
␊ +
{MD033}␊ +

␊ + ␊ + | Allowed | Not Allowed |␊ + | ------- | ------------ |␊ + |

| |␊ + | |
{MD033} |␊ + ␊ + ␊ + `, + } + +## inline_html-only_table_allowed_elements.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: h1', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: h1', + errorRange: [ + 25, + 4, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: table', + errorRange: [ + 1, + 7, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 3, + 5, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + ], + fixed: `# inline_html-only_table_allowed_elements.md␊ + ␊ +

This is not allowed {MD033}

␊ + ␊ +
This is not allowed {MD033}␊ + ␊ +
This is not allowed {MD033}␊ + ␊ + | Allowed | Not Allowed |␊ + | ------------------- | ------------------ |␊ + |
| |␊ + |
| |␊ + |
| |␊ + | |

{MD033}

|␊ + ␊ + {MD033}␊ +
{MD033}␊ +
␊ + ␊ + ␊ + `, + } + +## inline_html-table_allowed_elements.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: h2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: h1', + errorRange: [ + 25, + 4, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 3, + 5, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + ], + fixed: `# inline_html-table_allowed_elements.md␊ + ␊ +

This is allowed

␊ + ␊ +

This is not allowed {MD033}

␊ + ␊ +
This is not allowed {MD033}␊ + ␊ +
This is not allowed {MD033}␊ + ␊ + | Allowed | Not Allowed |␊ + | ------------------- | ------------------ |␊ + |
| |␊ + |
| |␊ + |
| |␊ + | |

{MD033}

|␊ + ␊ + ␊ +
{MD033}␊ +
␊ + ␊ + ␊ + `, + } + +## inline_html.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: h1', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: p', + errorRange: [ + 1, + 3, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: element', + errorRange: [ + 12, + 9, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 88, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 90, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: a', + errorRange: [ + 1, + 30, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: a', + errorRange: [ + 1, + 46, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: a', + errorRange: [ + 1, + 51, + ], + fixInfo: null, + lineNumber: 98, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: element', + errorRange: [ + 6, + 9, + ], + fixInfo: null, + lineNumber: 122, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: link-with', + errorRange: [ + 4, + 11, + ], + fixInfo: null, + lineNumber: 124, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: reference', + errorRange: [ + 16, + 11, + ], + fixInfo: null, + lineNumber: 128, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: reference', + errorRange: [ + 16, + 11, + ], + fixInfo: null, + lineNumber: 130, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: '`code Inline HTML Heading {MD033}␊ + ␊ +

More inline HTML {MD033}␊ + but this time on multiple lines␊ +

␊ + ␊ +

This shouldn't trigger as it's inside a code block

␊ + ␊ + \`\`\`text␊ +

Neither should this as it's also in a code block {MD046:11}

␊ + \`\`\`␊ + ␊ + ## Elements in code spans␊ + ␊ + Text \`\` text \\\` text␊ + Text \\\` text \`\` text␊ + Text \\\` text \\\` text \`\` text␊ + Text \\\` text \`\` text \`\` text␊ + Text \\\` text \`\` text \\\` text \`\` text␊ + Text \\\`\\\` text \`\` text␊ + Text \`\` text \\\` text \`\` text␊ + ␊ + ## Elements in multiple line code spans␊ + ␊ + Text \`code␊ + \`␊ + ␊ + \`code␊ + \`␊ + ␊ + \`code␊ + \` text␊ + ␊ + Text \`code␊ + code␊ + ␊ + \`␊ + ␊ + \`\`code \`\`\` \`\`\`\` \`␊ + code␊ + \`\`␊ + ␊ + Text \`code␊ + ␊ + code\` text␊ + ␊ + Text \`code code␊ + code \` text␊ + ␊ + Text \`code ␊ + code code\` text␊ + ␊ + Text \`code code␊ + code code␊ + code code\` text␊ + ␊ + Text \`\`\`\`code code␊ + code code␊ + code code\`\`\`\` text␊ + ␊ + Text \`code code␊ + code \` text␊ + text \`code code␊ + code code\` text␊ + ␊ + Text \`code code␊ + code code\` text␊ + text \`code code␊ + code \` text␊ + ␊ + Text \`code code␊ + code \` text␊ + text \`code code␊ + code \` text␊ + ␊ + Text \`code code␊ + code\` text text \`code {MD033}␊ + code code\` text␊ + ␊ + ## Slash in element name␊ + ␊ + Text **\\\\another\\directory\\\\** text␊ + ␊ + ## Self-closing elements␊ + ␊ +
{MD033}␊ + ␊ +
{MD033}␊ + ␊ + ## Links␊ + ␊ + Google {MD033}␊ + ␊ + Google {MD033}␊ + ␊ + Google {MD033}␊ + ␊ + ## Unterminated code span followed by element in code span␊ + ␊ + Text text \`text text␊ + ␊ + Text \`\` text␊ + ␊ + Text␊ + text \`text␊ + text␊ + ␊ + Text \`code code\` text␊ + ␊ + Text \`code code\` text {MD038}␊ + ␊ + \`\`\`lang␊ + code {MD046:114}␊ + ␊ + ␊ + \`\`\`␊ + ␊ + Text \`code code\` text␊ + ␊ + Text text {MD033}␊ + ␊ + A [][a-reference] is problematic. {MD033}␊ + ␊ + A [link with][a-] is okay.␊ + ␊ + A link with [a-][] is problematic. {MD033}␊ + ␊ + A link with [a-] is problematic. {MD033}␊ + ␊ + [a-reference]: https://example.com/␊ + [a-]: https://example.com/␊ + `, + } + +## invalid-ul-style-style.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 3, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '-', + }, + lineNumber: 4, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 6, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '-', + }, + lineNumber: 7, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# Invalid ul-style style␊ + ␊ + - Item {MD004}␊ + - Item {MD004}␊ + ␊ + - Item {MD004}␊ + - Item {MD004}␊ + ␊ + - Item␊ + - Item␊ + ␊ + ␊ + `, + } + +## jekyll_post.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h2; Actual: h3', + errorRange: null, + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + { + errorContext: 'heading1 {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + layout: post␊ + title: Hello World!␊ + category: Meta␊ + tags:␊ + - tag␊ + - another tag␊ + - one more tag␊ + url: https://example.com␊ + excerpt: Hello World! Vestibulum imperdiet adipiscing arcu, quis aliquam dolor condimentum dapibus. Aliquam fermentum leo aliquet quam volutpat et molestie mauris mattis. Suspendisse semper consequat velit in suscipit.␊ + ---␊ + # heading1 {MD025}␊ + ␊ + This is just a sample post.␊ + ␊ + ### offending heading3 {MD001}␊ + `, + } + +## jekyll_post_2.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h2; Actual: h3', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + { + errorContext: 'header1 {MD025}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Multiple top-level headings in the same document', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md025.md', + ruleNames: [ + 'MD025', + 'single-title', + 'single-h1', + ], + severity: 'error', + }, + ], + fixed: `---␊ + layout: post␊ + title: Hello World!␊ + category: Meta␊ + tags:␊ + - tag␊ + - another tag␊ + - one more tag␊ + url: http://example.com␊ + excerpt: Hello World! Vestibulum imperdiet adipiscing arcu, quis aliquam dolor condimentum dapibus. Aliquam fermentum leo aliquet quam volutpat et molestie mauris mattis. Suspendisse semper consequat velit in suscipit.␊ + ---␊ + ␊ + # header1 {MD025}␊ + ␊ + This is just a sample post.␊ + ␊ + ### offending header3 {MD001}␊ + `, + } + +## line-breaks-inside-code-spans.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '` code {MD038} span`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`code span `', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 39, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code {MD038} span code span`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 49, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`code span code span `', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 57, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`code span code span `', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 63, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code {MD038} span code span`', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 65, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`code code code `', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 73, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + ], + fixed: `# Line breaks inside code spans␊ + ␊ + Text \`code␊ + span\` text.␊ + ␊ + Text \`code␊ + span\` text \`code␊ + span\` text.␊ + ␊ + Text \`code␊ + span\` text \`code␊ + span\` text \`code␊ + span\` text.␊ + ␊ + Text \`code␊ + span␊ + code␊ + span\` text.␊ + ␊ + Text \`code␊ + span\` text \`code span\`␊ + text \`code span\` text.␊ + ␊ + Text \`code␊ + span\` text \`code span\` text␊ + \`code span\` text.␊ + ␊ + \`code␊ + span\` \`span\`␊ + \`span\`␊ + ␊ + Text␊ + text \`code {MD038}␊ + span\` text␊ + text.␊ + ␊ + Text␊ + text \`code␊ + span\` text {MD038}␊ + text.␊ + ␊ + Text␊ + text \`code␊ + span code␊ + span\` text␊ + text.␊ + ␊ + Text␊ + text \`code {MD038}␊ + span code␊ + span\` text␊ + text.␊ + ␊ + Text␊ + text \`code␊ + span code␊ + span\` text {MD038}␊ + text.␊ + ␊ + Text␊ + text \`code␊ + span code␊ + span\` text {MD038}␊ + text␊ + text \`code {MD038}␊ + span code␊ + span\` text␊ + text.␊ + ␊ + "␊ + Text \`code␊ + code code\`text\` {MD038}␊ + `, + } + +## link-fragments-default-case.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[Invalid](#Heading-Name)', + errorDetail: 'Expected: #heading-name; Actual: #Heading-Name', + errorRange: [ + 1, + 24, + ], + fixInfo: { + deleteCount: 13, + editColumn: 11, + insertText: '#heading-name', + }, + lineNumber: 7, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#Valid-Heading-With-Emphasis)', + errorDetail: 'Expected: #valid-heading-with-emphasis; Actual: #Valid-Heading-With-Emphasis', + errorRange: [ + 1, + 39, + ], + fixInfo: { + deleteCount: 28, + editColumn: 11, + insertText: '#valid-heading-with-emphasis', + }, + lineNumber: 13, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#-Valid-Heading-With-Emoji)', + errorDetail: 'Expected: #-valid-heading-with-emoji; Actual: #-Valid-Heading-With-Emoji', + errorRange: [ + 1, + 37, + ], + fixInfo: { + deleteCount: 26, + editColumn: 11, + insertText: '#-valid-heading-with-emoji', + }, + lineNumber: 19, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + ], + fixed: `# Link Fragments Default Case␊ + ␊ + ## Heading Name␊ + ␊ + [Valid](#heading-name)␊ + ␊ + [Invalid](#heading-name) {MD051}␊ + ␊ + ## Valid *Heading* With _Emphasis_␊ + ␊ + [Valid](#valid-heading-with-emphasis)␊ + ␊ + [Invalid](#valid-heading-with-emphasis) {MD051}␊ + ␊ + ## 🚀 Valid Heading With Emoji␊ + ␊ + [Valid](#-valid-heading-with-emoji)␊ + ␊ + [Invalid](#-valid-heading-with-emoji) {MD051}␊ + ␊ + ␊ + `, + } + +## link-fragments-ignore-case.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Link Fragments Ignore Case␊ + ␊ + ## Heading Name␊ + ␊ + [Valid](#heading-name)␊ + ␊ + [Valid](#Heading-Name)␊ + ␊ + ## Valid *Heading* With _Emphasis_␊ + ␊ + [Valid](#valid-heading-with-emphasis)␊ + ␊ + [Valid](#Valid-Heading-With-Emphasis)␊ + ␊ + ## 🚀 Valid Heading With Emoji␊ + ␊ + [Valid](#-valid-heading-with-emoji)␊ + ␊ + [Valid](#-Valid-Heading-With-Emoji)␊ + ␊ + ␊ + `, + } + +## link-fragments-ignored-pattern-default.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[Ignored](#ignored)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Missing](#missing)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + ], + fixed: `# Link Fragments Ignored Pattern Default␊ + ␊ + ## Heading␊ + ␊ + [Present](#heading)␊ + ␊ + [Ignored](#ignored) {MD051}␊ + ␊ + [Missing](#missing) {MD051}␊ + `, + } + +## link-fragments-ignored-pattern-empty.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[Ignored](#ignored)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Missing](#missing)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + ], + fixed: `# Link Fragments Ignored Pattern Empty␊ + ␊ + ## Heading␊ + ␊ + [Present](#heading)␊ + ␊ + [Ignored](#ignored) {MD051}␊ + ␊ + [Missing](#missing) {MD051}␊ + ␊ + ␊ + `, + } + +## link-fragments-ignored-pattern-multiple.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Link Fragments Ignored Pattern Multiple␊ + ␊ + ## Heading␊ + ␊ + [Present](#heading)␊ + ␊ + [Ignored](#ignored)␊ + ␊ + [Missing](#missing)␊ + ␊ + ␊ + `, + } + +## link-fragments-ignored-pattern-present.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[Missing](#missing)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + ], + fixed: `# Link Fragments Ignored Pattern Present␊ + ␊ + ## Heading␊ + ␊ + [Present](#heading)␊ + ␊ + [Ignored](#ignored)␊ + ␊ + [Missing](#missing) {MD051}␊ + ␊ + ␊ + `, + } + +## link-fragments.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[Invalid](#valid-heading-is-an-image)', + errorDetail: null, + errorRange: [ + 1, + 37, + ], + fixInfo: null, + lineNumber: 218, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#valid-heading-2004-)', + errorDetail: null, + errorRange: [ + 1, + 31, + ], + fixInfo: null, + lineNumber: 220, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#valid-repeated-heading-3)', + errorDetail: null, + errorRange: [ + 1, + 36, + ], + fixInfo: null, + lineNumber: 222, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#invalid-fragment)', + errorDetail: null, + errorRange: [ + 1, + 28, + ], + fixInfo: null, + lineNumber: 224, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#myname)', + errorDetail: null, + errorRange: [ + 1, + 18, + ], + fixInfo: null, + lineNumber: 226, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#hrefandid)', + errorDetail: 'Expected: #HREFandID; Actual: #hrefandid', + errorRange: [ + 1, + 21, + ], + fixInfo: { + deleteCount: 10, + editColumn: 11, + insertText: '#HREFandID', + }, + lineNumber: 228, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#name-for-other-element)', + errorDetail: null, + errorRange: [ + 1, + 34, + ], + fixInfo: null, + lineNumber: 230, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#name-should-be-ignored)', + errorDetail: null, + errorRange: [ + 1, + 34, + ], + fixInfo: null, + lineNumber: 232, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#not-an-id-should-be-ignored)', + errorDetail: null, + errorRange: [ + 1, + 39, + ], + fixInfo: null, + lineNumber: 234, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 236, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[badref]: #missing "{MD051}"', + errorDetail: null, + errorRange: [ + 1, + 28, + ], + fixInfo: null, + lineNumber: 241, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Title](#Valid-Fragments)', + errorDetail: 'Expected: #valid-fragments; Actual: #Valid-Fragments', + errorRange: [ + 1, + 25, + ], + fixInfo: { + deleteCount: 16, + editColumn: 9, + insertText: '#valid-fragments', + }, + lineNumber: 245, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[ALL CAPS](#NAMEDLINK)', + errorDetail: 'Expected: #namedlink; Actual: #NAMEDLINK', + errorRange: [ + 1, + 22, + ], + fixInfo: { + deleteCount: 10, + editColumn: 12, + insertText: '#namedlink', + }, + lineNumber: 247, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: #namedlink; Actual: #NAMEDLINK', + errorRange: null, + fixInfo: null, + lineNumber: 249, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[mixedref]: #idLINK "{MD051}"', + errorDetail: 'Expected: #idlink; Actual: #idLINK', + errorRange: [ + 1, + 29, + ], + fixInfo: { + deleteCount: 7, + editColumn: 13, + insertText: '#idlink', + }, + lineNumber: 254, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#embedded-space)', + errorDetail: null, + errorRange: [ + 1, + 26, + ], + fixInfo: null, + lineNumber: 289, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#embedded_space)', + errorDetail: null, + errorRange: [ + 1, + 26, + ], + fixInfo: null, + lineNumber: 291, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#embedded)', + errorDetail: null, + errorRange: [ + 1, + 20, + ], + fixInfo: null, + lineNumber: 293, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#hyphen--run)', + errorDetail: null, + errorRange: [ + 1, + 23, + ], + fixInfo: null, + lineNumber: 295, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#hyphen-run)', + errorDetail: null, + errorRange: [ + 1, + 22, + ], + fixInfo: null, + lineNumber: 297, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#named-fragment-outside-heading)', + errorDetail: null, + errorRange: [ + 1, + 42, + ], + fixInfo: null, + lineNumber: 299, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#UpperCase)', + errorDetail: null, + errorRange: [ + 1, + 21, + ], + fixInfo: null, + lineNumber: 301, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#uppercase)', + errorDetail: null, + errorRange: [ + 1, + 21, + ], + fixInfo: null, + lineNumber: 303, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L12-not-a-line-link)', + errorDetail: 'Expected: #l12-not-a-line-link; Actual: #L12-not-a-line-link', + errorRange: [ + 1, + 31, + ], + fixInfo: { + deleteCount: 20, + editColumn: 11, + insertText: '#l12-not-a-line-link', + }, + lineNumber: 305, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#l7)', + errorDetail: null, + errorRange: [ + 1, + 14, + ], + fixInfo: null, + lineNumber: 307, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L)', + errorDetail: null, + errorRange: [ + 1, + 13, + ], + fixInfo: null, + lineNumber: 309, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L7extra)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 311, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30C)', + errorDetail: null, + errorRange: [ + 1, + 16, + ], + fixInfo: null, + lineNumber: 313, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30Cextra)', + errorDetail: null, + errorRange: [ + 1, + 21, + ], + fixInfo: null, + lineNumber: 315, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30L12)', + errorDetail: null, + errorRange: [ + 1, + 18, + ], + fixInfo: null, + lineNumber: 317, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30C12)', + errorDetail: null, + errorRange: [ + 1, + 18, + ], + fixInfo: null, + lineNumber: 319, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30C11-)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 321, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30C11-L)', + errorDetail: null, + errorRange: [ + 1, + 20, + ], + fixInfo: null, + lineNumber: 323, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30C11-L31C)', + errorDetail: null, + errorRange: [ + 1, + 23, + ], + fixInfo: null, + lineNumber: 325, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#L30C11-C31)', + errorDetail: null, + errorRange: [ + 1, + 22, + ], + fixInfo: null, + lineNumber: 327, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#C30)', + errorDetail: null, + errorRange: [ + 1, + 15, + ], + fixInfo: null, + lineNumber: 329, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#C11-C31)', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: null, + lineNumber: 331, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#C11-L4C31)', + errorDetail: null, + errorRange: [ + 1, + 21, + ], + fixInfo: null, + lineNumber: 333, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[Invalid](#ToP)', + errorDetail: 'Expected: #top; Actual: #ToP', + errorRange: [ + 1, + 15, + ], + fixInfo: { + deleteCount: 4, + editColumn: 11, + insertText: '#top', + }, + lineNumber: 339, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + ], + fixed: `# Valid/Invalid Link Fragments␊ + ␊ + ## Valid Fragments␊ + ␊ + [Valid](#validinvalid-link-fragments)␊ + ␊ + [Valid](#valid-fragments)␊ + ␊ + [Valid](#valid-h3-heading)␊ + ␊ + [Valid](#valid-heading-with-underscores-_)␊ + ␊ + [Valid](#valid-heading-with-emphasis)␊ + ␊ + [Valid](#valid-heading-with-code)␊ + ␊ + [Valid](#valid-heading-with-quotes--and-double-quotes-)␊ + ␊ + [Valid](#-valid-heading-with-emoji)␊ + ␊ + [Valid](#valid-heading--with-emoji-2)␊ + ␊ + [Valid](#valid-heading-2010-)␊ + ␊ + [Valid](#valid-heading-2004-%EF%B8%8F)␊ + ␊ + [Valid](#valid-closed-atx-heading)␊ + ␊ + [Valid](#valid-setext-heading)␊ + ␊ + [Valid](#valid-repeated-heading)␊ + ␊ + [Valid](#valid-repeated-heading-1)␊ + ␊ + [Valid](#valid-repeated-heading-2)␊ + ␊ + [Valid](#valid-heading-with-trailing-space-)␊ + ␊ + [Valid](#valid-heading-with-two-trailing-spaces--)␊ + ␊ + [Valid](#valid-heading-with-embedded--comment)␊ + ␊ + [Valid](#the-best-headin-for-testin-quotes)␊ + ␊ + [Valid](#valid-heading-about-lh%C3%B4pitals-rule)␊ + ␊ + [Valid](#valid-heading-about-lhôpitals-rule)␊ + ␊ + [Valid](#en-t%C3%AAte-valide-dans-fran%C3%A7ais-pour-v%C3%A9rification)␊ + ␊ + [Valid](#en-tête-valide-dans-français-pour-vérification)␊ + ␊ + [Valid](#%E6%A0%87%E9%A2%98)␊ + ␊ + [Valid](#标题)␊ + ␊ + [Valid](#valid-heading-is-a-link)␊ + ␊ + [Valid](#valid-heading-has-a-link)␊ + ␊ + [Valid](#valid-heading-is-a-reference-link)␊ + ␊ + [Valid](#valid-heading-has-a-reference-link)␊ + ␊ + [Valid](#valid-heading-has-)␊ + ␊ + [Valid](#valid_heading-escaped_underscores)␊ + ␊ + [Valid](#valid\\_heading\\-escaped\\_underscores)␊ + ␊ + [Valid](#valid-heading-with_embedded_escaping)␊ + ␊ + [Valid](#namedlink)␊ + ␊ + [Valid](#idlink)␊ + ␊ + [Valid](#myident)␊ + ␊ + [Valid](#HREFandID)␊ + ␊ + [Valid](#id-for-other-element)␊ + ␊ + [Valid](#id-after-name)␊ + ␊ + [Valid][goodref]␊ + ␊ + [Valid][escapedref]␊ + ␊ + [Valid](#l12-not-a-line-link)␊ + ␊ + [Valid](#latex-style)␊ + ␊ + [Valid](#area-pi--r2)␊ + ␊ + [Valid](#L7)␊ + ␊ + [Valid](#L30-L31)␊ + ␊ + [Valid](#L3C24-L88)␊ + ␊ + [Valid](#L304-L314C98)␊ + ␊ + [Valid](#L200C4-L3244C2)␊ + ␊ + ### Valid H3 Heading␊ + ␊ + Text␊ + ␊ + ### Valid Heading With Underscores _␊ + ␊ + Text␊ + ␊ + ### Valid *Heading* With _Emphasis_␊ + ␊ + Text␊ + ␊ + ### Valid Heading With \`Code\`␊ + ␊ + Text␊ + ␊ + ### Valid Heading With Quotes ' And Double Quotes "␊ + ␊ + Text␊ + ␊ + ### 🚀 Valid Heading With Emoji␊ + ␊ + Text␊ + ␊ + ### Valid Heading 👀 With Emoji 2␊ + ␊ + Text␊ + ␊ + ### Valid Heading 20.10 ❌␊ + ␊ + Text␊ + ␊ + ### Valid Heading 20.04 ✔️␊ + ␊ + Text␊ + ␊ + ### Valid Closed ATX Heading ###␊ + ␊ + Text␊ + ␊ + Valid Setext Heading␊ + --------------------␊ + ␊ + Text␊ + ␊ + ### Valid Repeated Heading␊ + ␊ + Text␊ + ␊ + ### Valid Repeated Heading␊ + ␊ + Text␊ + ␊ + ### Valid Repeated Heading␊ + ␊ + ### Valid Heading With Trailing Space ␊ + ␊ + ### Valid Heading With Two Trailing Spaces ␊ + ␊ + ### Valid Heading With Embedded Comment␊ + ␊ + ### The "Best" Headin' for Testin' Quotes␊ + ␊ + ### Valid Heading About L'Hôpital's Rule␊ + ␊ + ### En-tête Valide Dans Français Pour Vérification␊ + ␊ + ### 标题␊ + ␊ + ### [Valid Heading Is a Link](https://example.com)␊ + ␊ + ### Valid Heading [Has a Link](https://example.com)␊ + ␊ + ### [Valid Heading Is a Reference Link][goodref]␊ + ␊ + ### Valid Heading [Has a Reference Link][goodref]␊ + ␊ + ### ![Valid Heading Is an Image](https://example.com)␊ + ␊ + ### Valid Heading Has ![an Image](https://example.com)␊ + ␊ + ### Valid_Heading Escaped_Underscores␊ + ␊ + ### Valid Heading\\-With\\_Embedded\\_Escaping␊ + ␊ + ### L12 Not A Line Link␊ + ␊ + ## $\\LaTeX$ Style␊ + ␊ + ## Area: $\\pi * r^2$␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + Text␊ + ␊ +

␊ + ␊ +

␊ + ␊ + ␊ + ␊ + ␊ + ␊ + [goodref]: #namedlink␊ + ␊ + [escapedref]: #valid\\_heading\\-escaped\\_underscores␊ + ␊ + ## Invalid Fragments␊ + ␊ + [Invalid](#valid-heading-is-an-image) {MD051}␊ + ␊ + [Invalid](#valid-heading-2004-) {MD051}␊ + ␊ + [Invalid](#valid-repeated-heading-3) {MD051}␊ + ␊ + [Invalid](#invalid-fragment) {MD051}␊ + ␊ + [Invalid](#myname) {MD051}␊ + ␊ + [Invalid](#HREFandID) {MD051}␊ + ␊ + [Invalid](#name-for-other-element) {MD051}␊ + ␊ + [Invalid](#name-should-be-ignored) {MD051}␊ + ␊ + [Invalid](#not-an-id-should-be-ignored) {MD051}␊ + ␊ + [Invalid {MD051}](#multi-line␊ + "Title")␊ + ␊ + [Invalid][badref]␊ + ␊ + [badref]: #missing "{MD051}"␊ + ␊ + ## Inconsistent Case Fragments␊ + ␊ + [Title](#valid-fragments) {MD051}␊ + ␊ + [ALL CAPS](#namedlink) {MD051}␊ + ␊ + [Multi-line {MD051}](#NAMEDLINK␊ + "Title")␊ + ␊ + [MiXeD][mixedref]␊ + ␊ + [mixedref]: #idlink "{MD051}"␊ + ␊ + ## Valid Named Fragments␊ + ␊ + [Valid](#named-fragment)␊ + ␊ + [Valid](#valid-heading-with-named-fragment-named-fragment)␊ + ␊ + [Valid](#another_fragment_123)␊ + ␊ + [Valid](#valid-heading-with-another-named-fragment-another_fragment_123)␊ + ␊ + [Valid](#closed-atx)␊ + ␊ + [Valid](#setext)␊ + ␊ + ### Valid Heading with Named Fragment {#named-fragment}␊ + ␊ + ### Valid Heading with Another Named Fragment {#another_fragment_123}␊ + ␊ + ### Valid Closed ATX Heading with Named Fragment {#closed-atx} ###␊ + ␊ + Valid Setext Heading with Named Fragment {#setext}␊ + --------------------------------------------------␊ + ␊ + ## Invalid Named Fragments␊ + ␊ + ### Invalid Heading with Named Fragment {#embedded space}␊ + ␊ + ### Invalid Heading with Named Fragment {#hyphen--run}␊ + ␊ + ### Invalid Heading with Named Fragment {#UpperCase}␊ + ␊ + {#named-fragment-outside-heading}␊ + ␊ + [Invalid](#embedded-space) {MD051}␊ + ␊ + [Invalid](#embedded_space) {MD051}␊ + ␊ + [Invalid](#embedded) {MD051}␊ + ␊ + [Invalid](#hyphen--run) {MD051}␊ + ␊ + [Invalid](#hyphen-run) {MD051}␊ + ␊ + [Invalid](#named-fragment-outside-heading) {MD051}␊ + ␊ + [Invalid](#UpperCase) {MD051}␊ + ␊ + [Invalid](#uppercase) {MD051}␊ + ␊ + [Invalid](#l12-not-a-line-link) {MD051}␊ + ␊ + [Invalid](#l7) {MD051}␊ + ␊ + [Invalid](#L) {MD051}␊ + ␊ + [Invalid](#L7extra) {MD051}␊ + ␊ + [Invalid](#L30C) {MD051}␊ + ␊ + [Invalid](#L30Cextra) {MD051}␊ + ␊ + [Invalid](#L30L12) {MD051}␊ + ␊ + [Invalid](#L30C12) {MD051}␊ + ␊ + [Invalid](#L30C11-) {MD051}␊ + ␊ + [Invalid](#L30C11-L) {MD051}␊ + ␊ + [Invalid](#L30C11-L31C) {MD051}␊ + ␊ + [Invalid](#L30C11-C31) {MD051}␊ + ␊ + [Invalid](#C30) {MD051}␊ + ␊ + [Invalid](#C11-C31) {MD051}␊ + ␊ + [Invalid](#C11-L4C31) {MD051}␊ + ␊ + ## Implicit Fragments␊ + ␊ + [Valid](#top)␊ + ␊ + [Invalid](#top) {MD051}␊ + ␊ + ␊ + `, + } + +## link-style-autolink-only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 26, + ], + fixInfo: { + deleteCount: 26, + editColumn: 6, + insertText: '', + }, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 27, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]()', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: { + deleteCount: 28, + editColumn: 6, + insertText: '', + }, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]()', + errorDetail: null, + errorRange: [ + 6, + 29, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com "tit...', + errorDetail: null, + errorRange: [ + 6, + 34, + ], + fixInfo: { + deleteCount: 34, + editColumn: 6, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com "ti...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[text][url]', + errorDetail: null, + errorRange: [ + 6, + 11, + ], + fixInfo: { + deleteCount: 11, + editColumn: 6, + insertText: '', + }, + lineNumber: 21, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![text][url]', + errorDetail: null, + errorRange: [ + 6, + 12, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url][]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 6, + insertText: '', + }, + lineNumber: 25, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url][]', + errorDetail: null, + errorRange: [ + 6, + 8, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]', + errorDetail: null, + errorRange: [ + 6, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 6, + insertText: '', + }, + lineNumber: 29, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]', + errorDetail: null, + errorRange: [ + 6, + 6, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/embe...', + errorDetail: null, + errorRange: [ + 6, + 46, + ], + fixInfo: { + deleteCount: 46, + editColumn: 6, + insertText: '', + }, + lineNumber: 39, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/back...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: { + deleteCount: 44, + editColumn: 6, + insertText: '', + }, + lineNumber: 41, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[embedded-backslash]', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 6, + insertText: '', + }, + lineNumber: 43, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[backslash-escape]', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: { + deleteCount: 18, + editColumn: 6, + insertText: '', + }, + lineNumber: 45, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](', + }, + lineNumber: 57, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/\\(pa...', + errorDetail: null, + errorRange: [ + 6, + 37, + ], + fixInfo: { + deleteCount: 37, + editColumn: 6, + insertText: '', + }, + lineNumber: 59, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/pa(r...', + errorDetail: null, + errorRange: [ + 6, + 37, + ], + fixInfo: { + deleteCount: 37, + editColumn: 6, + insertText: '', + }, + lineNumber: 61, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](relative/path)', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: null, + lineNumber: 63, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](#fragment)', + errorDetail: null, + errorRange: [ + 6, + 16, + ], + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/an>g...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com](user@exampl...', + errorDetail: null, + errorRange: [ + 6, + 36, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com][email]', + errorDetail: null, + errorRange: [ + 6, + 25, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email][]', + errorDetail: null, + errorRange: [ + 6, + 9, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Autolink Only␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url]() text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url](https://example.com "title") text {MD054}␊ + ␊ + Text {MD054} [url](https://example.com␊ + "title") text␊ + ␊ + Text {MD054} ![url](https://example.com␊ + "title") text␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![text][url] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url][] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url] text {MD054}␊ + ␊ + Text text␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text␊ + ␊ + Text text␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [url](relative/path) text {MD054}␊ + ␊ + Text [url](#fragment) text {MD054}␊ + ␊ + Text text␊ + ␊ + Text [url](https://example.com/an>g) text {MD054}␊ + ␊ + Text text␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com][email] text {MD054}␊ + ␊ + Text [email][] text {MD054}␊ + ␊ + Text [email] text {MD054}␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-autolink-or-inline.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[text][url]', + errorDetail: null, + errorRange: [ + 6, + 11, + ], + fixInfo: { + deleteCount: 11, + editColumn: 6, + insertText: '[text](https://example.com)', + }, + lineNumber: 21, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![text][url]', + errorDetail: null, + errorRange: [ + 6, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 6, + insertText: '![text](https://example.com)', + }, + lineNumber: 23, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url][]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 6, + insertText: '[url](https://example.com)', + }, + lineNumber: 25, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url][]', + errorDetail: null, + errorRange: [ + 6, + 8, + ], + fixInfo: { + deleteCount: 8, + editColumn: 6, + insertText: '![url](https://example.com)', + }, + lineNumber: 27, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]', + errorDetail: null, + errorRange: [ + 6, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 6, + insertText: '[url](https://example.com)', + }, + lineNumber: 29, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]', + errorDetail: null, + errorRange: [ + 6, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 6, + insertText: '![url](https://example.com)', + }, + lineNumber: 31, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[embedded-backslash]', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 6, + insertText: '[embedded-backslash](https://example.com/embedded\\3backslash)', + }, + lineNumber: 43, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[backslash-escape]', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: { + deleteCount: 18, + editColumn: 6, + insertText: '[backslash-escape](https://example.com/backslash\\[escape)', + }, + lineNumber: 45, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com][email]', + errorDetail: null, + errorRange: [ + 6, + 25, + ], + fixInfo: { + deleteCount: 25, + editColumn: 6, + insertText: '[user@example.com](user@example.com)', + }, + lineNumber: 75, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email][]', + errorDetail: null, + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[email](user@example.com)', + }, + lineNumber: 77, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 6, + insertText: '[email](user@example.com)', + }, + lineNumber: 79, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Autolink or Inline␊ + ␊ + Text [url](https://example.com) text␊ + ␊ + Text ![url](https://example.com) text␊ + ␊ + Text [url]() text␊ + ␊ + Text ![url]() text␊ + ␊ + Text [url](https://example.com "title") text␊ + ␊ + Text ![url](https://example.com "title") text␊ + ␊ + Text [url](https://example.com␊ + "title") text␊ + ␊ + Text ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text](https://example.com) text {MD054}␊ + ␊ + Text ![text](https://example.com) text {MD054}␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text text␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text␊ + ␊ + Text [embedded-backslash](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [backslash-escape](https://example.com/backslash\\[escape) text {MD054}␊ + ␊ + Text text␊ + ␊ + Text text␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text␊ + ␊ + Text [url]() text␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text␊ + ␊ + Text [url](relative/path) text␊ + ␊ + Text [url](#fragment) text␊ + ␊ + Text text␊ + ␊ + Text [url](https://example.com/an>g) text␊ + ␊ + Text text␊ + ␊ + Text [user@example.com](user@example.com) text␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [email](user@example.com) text {MD054}␊ + ␊ + Text [email](user@example.com) text {MD054}␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-autolink-or-reference.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 26, + ], + fixInfo: { + deleteCount: 26, + editColumn: 6, + insertText: '', + }, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 27, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]()', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: { + deleteCount: 28, + editColumn: 6, + insertText: '', + }, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]()', + errorDetail: null, + errorRange: [ + 6, + 29, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com "tit...', + errorDetail: null, + errorRange: [ + 6, + 34, + ], + fixInfo: { + deleteCount: 34, + editColumn: 6, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com "ti...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/embe...', + errorDetail: null, + errorRange: [ + 6, + 46, + ], + fixInfo: { + deleteCount: 46, + editColumn: 6, + insertText: '', + }, + lineNumber: 39, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/back...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: { + deleteCount: 44, + editColumn: 6, + insertText: '', + }, + lineNumber: 41, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](', + }, + lineNumber: 57, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/\\(pa...', + errorDetail: null, + errorRange: [ + 6, + 37, + ], + fixInfo: { + deleteCount: 37, + editColumn: 6, + insertText: '', + }, + lineNumber: 59, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/pa(r...', + errorDetail: null, + errorRange: [ + 6, + 37, + ], + fixInfo: { + deleteCount: 37, + editColumn: 6, + insertText: '', + }, + lineNumber: 61, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](relative/path)', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: null, + lineNumber: 63, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](#fragment)', + errorDetail: null, + errorRange: [ + 6, + 16, + ], + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/an>g...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com](user@exampl...', + errorDetail: null, + errorRange: [ + 6, + 36, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Autolink or Reference␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url]() text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![url](https://example.com "title") text {MD054}␊ + ␊ + Text {MD054} [url](https://example.com␊ + "title") text␊ + ␊ + Text {MD054} ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text][url] text␊ + ␊ + Text ![text][url] text␊ + ␊ + Text [url][] text␊ + ␊ + Text ![url][] text␊ + ␊ + Text [url] text␊ + ␊ + Text ![url] text␊ + ␊ + Text text␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [embedded-backslash] text␊ + ␊ + Text [backslash-escape] text␊ + ␊ + Text text␊ + ␊ + Text text␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [url](relative/path) text {MD054}␊ + ␊ + Text [url](#fragment) text {MD054}␊ + ␊ + Text text␊ + ␊ + Text [url](https://example.com/an>g) text {MD054}␊ + ␊ + Text text␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com][email] text␊ + ␊ + Text [email][] text␊ + ␊ + Text [email] text␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-collapsed-only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 26, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 27, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]()', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]()', + errorDetail: null, + errorRange: [ + 6, + 29, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com "tit...', + errorDetail: null, + errorRange: [ + 6, + 34, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com "ti...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[text][url]', + errorDetail: null, + errorRange: [ + 6, + 11, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![text][url]', + errorDetail: null, + errorRange: [ + 6, + 12, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]', + errorDetail: null, + errorRange: [ + 6, + 5, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]', + errorDetail: null, + errorRange: [ + 6, + 6, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/embe...', + errorDetail: null, + errorRange: [ + 6, + 46, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/back...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[embedded-backslash]', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[backslash-escape]', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 30, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/an>g...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com](user@exampl...', + errorDetail: null, + errorRange: [ + 6, + 36, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com][email]', + errorDetail: null, + errorRange: [ + 6, + 25, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Collapsed Only␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text ![url]() text {MD054}␊ + ␊ + Text [url](https://example.com "title") text {MD054}␊ + ␊ + Text ![url](https://example.com "title") text {MD054}␊ + ␊ + Text {MD054} [url](https://example.com␊ + "title") text␊ + ␊ + Text {MD054} ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text][url] text {MD054}␊ + ␊ + Text ![text][url] text {MD054}␊ + ␊ + Text [url][] text␊ + ␊ + Text ![url][] text␊ + ␊ + Text [url] text {MD054}␊ + ␊ + Text ![url] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text {MD054}␊ + ␊ + Text [embedded-backslash] text {MD054}␊ + ␊ + Text [backslash-escape] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text {MD054}␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text {MD054}␊ + ␊ + Text [url](relative/path) text {MD054}␊ + ␊ + Text [url](#fragment) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [url](https://example.com/an>g) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com][email] text {MD054}␊ + ␊ + Text [email][] text␊ + ␊ + Text [email] text {MD054}␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-full-only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 26, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 27, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]()', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]()', + errorDetail: null, + errorRange: [ + 6, + 29, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com "tit...', + errorDetail: null, + errorRange: [ + 6, + 34, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com "ti...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url][]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url][]', + errorDetail: null, + errorRange: [ + 6, + 8, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]', + errorDetail: null, + errorRange: [ + 6, + 5, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]', + errorDetail: null, + errorRange: [ + 6, + 6, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/embe...', + errorDetail: null, + errorRange: [ + 6, + 46, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/back...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[embedded-backslash]', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[backslash-escape]', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 30, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/an>g...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com](user@exampl...', + errorDetail: null, + errorRange: [ + 6, + 36, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email][]', + errorDetail: null, + errorRange: [ + 6, + 9, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Full Only␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text ![url]() text {MD054}␊ + ␊ + Text [url](https://example.com "title") text {MD054}␊ + ␊ + Text ![url](https://example.com "title") text {MD054}␊ + ␊ + Text {MD054} [url](https://example.com␊ + "title") text␊ + ␊ + Text {MD054} ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text][url] text␊ + ␊ + Text ![text][url] text␊ + ␊ + Text [url][] text {MD054}␊ + ␊ + Text ![url][] text {MD054}␊ + ␊ + Text [url] text {MD054}␊ + ␊ + Text ![url] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text {MD054}␊ + ␊ + Text [embedded-backslash] text {MD054}␊ + ␊ + Text [backslash-escape] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text {MD054}␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text {MD054}␊ + ␊ + Text [url](relative/path) text {MD054}␊ + ␊ + Text [url](#fragment) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [url](https://example.com/an>g) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com][email] text␊ + ␊ + Text [email][] text {MD054}␊ + ␊ + Text [email] text {MD054}␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-inline-only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[text][url]', + errorDetail: null, + errorRange: [ + 6, + 11, + ], + fixInfo: { + deleteCount: 11, + editColumn: 6, + insertText: '[text](https://example.com)', + }, + lineNumber: 21, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![text][url]', + errorDetail: null, + errorRange: [ + 6, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 6, + insertText: '![text](https://example.com)', + }, + lineNumber: 23, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url][]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 6, + insertText: '[url](https://example.com)', + }, + lineNumber: 25, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url][]', + errorDetail: null, + errorRange: [ + 6, + 8, + ], + fixInfo: { + deleteCount: 8, + editColumn: 6, + insertText: '![url](https://example.com)', + }, + lineNumber: 27, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]', + errorDetail: null, + errorRange: [ + 6, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 6, + insertText: '[url](https://example.com)', + }, + lineNumber: 29, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]', + errorDetail: null, + errorRange: [ + 6, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 6, + insertText: '![url](https://example.com)', + }, + lineNumber: 31, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: { + deleteCount: 21, + editColumn: 6, + insertText: '[https://example.com](https://example.com)', + }, + lineNumber: 33, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[embedded-backslash]', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 6, + insertText: '[embedded-backslash](https://example.com/embedded\\3backslash)', + }, + lineNumber: 43, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[backslash-escape]', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: { + deleteCount: 18, + editColumn: 6, + insertText: '[backslash-escape](https://example.com/backslash\\[escape)', + }, + lineNumber: 45, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 30, + ], + fixInfo: { + deleteCount: 30, + editColumn: 6, + insertText: '[https://example.com/pa)re(ns](https://example.com/pa\\)re\\(ns)', + }, + lineNumber: 67, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: { + deleteCount: 18, + editColumn: 6, + insertText: '[user@example.com](user@example.com)', + }, + lineNumber: 71, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com][email]', + errorDetail: null, + errorRange: [ + 6, + 25, + ], + fixInfo: { + deleteCount: 25, + editColumn: 6, + insertText: '[user@example.com](user@example.com)', + }, + lineNumber: 75, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email][]', + errorDetail: null, + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: '[email](user@example.com)', + }, + lineNumber: 77, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 6, + insertText: '[email](user@example.com)', + }, + lineNumber: 79, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Inline Only␊ + ␊ + Text [url](https://example.com) text␊ + ␊ + Text ![url](https://example.com) text␊ + ␊ + Text [url]() text␊ + ␊ + Text ![url]() text␊ + ␊ + Text [url](https://example.com "title") text␊ + ␊ + Text ![url](https://example.com "title") text␊ + ␊ + Text [url](https://example.com␊ + "title") text␊ + ␊ + Text ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text](https://example.com) text {MD054}␊ + ␊ + Text ![text](https://example.com) text {MD054}␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [https://example.com](https://example.com) text {MD054}␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text␊ + ␊ + Text [embedded-backslash](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [backslash-escape](https://example.com/backslash\\[escape) text {MD054}␊ + ␊ + Text [https://example.com/embedded\\3backslash](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [https://example.com/backslash\\[no-escape](https://example.com/backslash[no-escape) text {MD054}␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text␊ + ␊ + Text [url]() text␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text␊ + ␊ + Text [url](relative/path) text␊ + ␊ + Text [url](#fragment) text␊ + ␊ + Text [https://example.com/pa)re(ns](https://example.com/pa\\)re\\(ns) text {MD054}␊ + ␊ + Text [url](https://example.com/an>g) text␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com](user@example.com)␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [email](user@example.com) text {MD054}␊ + ␊ + Text [email](user@example.com) text {MD054}␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-inline-or-reference.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: { + deleteCount: 21, + editColumn: 6, + insertText: '[https://example.com](https://example.com)', + }, + lineNumber: 33, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 30, + ], + fixInfo: { + deleteCount: 30, + editColumn: 6, + insertText: '[https://example.com/pa)re(ns](https://example.com/pa\\)re\\(ns)', + }, + lineNumber: 67, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: { + deleteCount: 18, + editColumn: 6, + insertText: '[user@example.com](user@example.com)', + }, + lineNumber: 71, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Inline or Reference␊ + ␊ + Text [url](https://example.com) text␊ + ␊ + Text ![url](https://example.com) text␊ + ␊ + Text [url]() text␊ + ␊ + Text ![url]() text␊ + ␊ + Text [url](https://example.com "title") text␊ + ␊ + Text ![url](https://example.com "title") text␊ + ␊ + Text [url](https://example.com␊ + "title") text␊ + ␊ + Text ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text][url] text␊ + ␊ + Text ![text][url] text␊ + ␊ + Text [url][] text␊ + ␊ + Text ![url][] text␊ + ␊ + Text [url] text␊ + ␊ + Text ![url] text␊ + ␊ + Text [https://example.com](https://example.com) text {MD054}␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text␊ + ␊ + Text [embedded-backslash] text␊ + ␊ + Text [backslash-escape] text␊ + ␊ + Text [https://example.com/embedded\\3backslash](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [https://example.com/backslash\\[no-escape](https://example.com/backslash[no-escape) text {MD054}␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text␊ + ␊ + Text [url]() text␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text␊ + ␊ + Text [url](relative/path) text␊ + ␊ + Text [url](#fragment) text␊ + ␊ + Text [https://example.com/pa)re(ns](https://example.com/pa\\)re\\(ns) text {MD054}␊ + ␊ + Text [url](https://example.com/an>g) text␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com](user@example.com) text␊ + ␊ + Text [user@example.com][email] text␊ + ␊ + Text [email][] text␊ + ␊ + Text [email] text␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-no-url-inline-not-possible.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: { + deleteCount: 21, + editColumn: 6, + insertText: '[https://example.com](https://example.com)', + }, + lineNumber: 27, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: { + deleteCount: 18, + editColumn: 6, + insertText: '[user@example.com](user@example.com)', + }, + lineNumber: 50, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style No URL Inline Not Possible␊ + ␊ + Text [https://example.com](https://example.com) text␊ + ␊ + Text ![https://example.com](https://example.com) text␊ + ␊ + Text [https://example.com]() text␊ + ␊ + Text ![https://example.com]() text␊ + ␊ + Text [https://example.com](https://example.com/page "title") text␊ + ␊ + Text ![https://example.com](https://example.com/page "title") text␊ + ␊ + Text [https://example.com](https://example.com "title") text␊ + ␊ + Text ![https://example.com](https://example.com "title") text␊ + ␊ + Text [https://example.com][url] text␊ + ␊ + Text ![https://example.com][url] text␊ + ␊ + Text [https://example.com][url-title] text␊ + ␊ + Text ![https://example.com][url-title] text␊ + ␊ + Text [https://example.com](https://example.com) text {MD054}␊ + ␊ + [url]: https://example.com␊ + [url-title]: https://example.com "title"␊ + ␊ + Text [link](https://example.com) text␊ + ␊ + Text ![link](https://example.com) text␊ + ␊ + Text [link][url] text␊ + ␊ + Text ![link][url] text␊ + ␊ + Text [url][] text␊ + ␊ + Text ![url][] text␊ + ␊ + Text [url] text␊ + ␊ + Text ![url] text␊ + ␊ + Text [file.md](file.md) text␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com](user@example.com) text␊ + ␊ + Text [user@example.com][email] text␊ + ␊ + Text [email][] text␊ + ␊ + Text [email] text␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-no-url-inline-possible.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[https://example.com](https://...', + errorDetail: null, + errorRange: [ + 6, + 42, + ], + fixInfo: { + deleteCount: 42, + editColumn: 6, + insertText: '', + }, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[https://example.com](', + }, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style No URL Inline Possible␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![https://example.com](https://example.com) text␊ + ␊ + Text text {MD054}␊ + ␊ + Text ![https://example.com]() text␊ + ␊ + Text [https://example.com](https://example.com/page "title") text␊ + ␊ + Text ![https://example.com](https://example.com/page "title") text␊ + ␊ + Text [https://example.com](https://example.com "title") text␊ + ␊ + Text ![https://example.com](https://example.com "title") text␊ + ␊ + Text [https://example.com][url] text␊ + ␊ + Text ![https://example.com][url] text␊ + ␊ + Text [https://example.com][url-title] text␊ + ␊ + Text ![https://example.com][url-title] text␊ + ␊ + Text text␊ + ␊ + [url]: https://example.com␊ + [url-title]: https://example.com "title"␊ + ␊ + Text [link](https://example.com) text␊ + ␊ + Text ![link](https://example.com) text␊ + ␊ + Text [link][url] text␊ + ␊ + Text ![link][url] text␊ + ␊ + Text [url][] text␊ + ␊ + Text ![url][] text␊ + ␊ + Text [url] text␊ + ␊ + Text ![url] text␊ + ␊ + Text [file.md](file.md) text␊ + ␊ + Text text␊ + ␊ + Text [user@example.com](user@example.com) text␊ + (allowed by !url_inline because email address is not an absolute URL)␊ + ␊ + Text [user@example.com][email] text␊ + ␊ + Text [email][] text␊ + ␊ + Text [email] text␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-none.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 26, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 27, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]()', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]()', + errorDetail: null, + errorRange: [ + 6, + 29, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com "tit...', + errorDetail: null, + errorRange: [ + 6, + 34, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com "ti...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[text][url]', + errorDetail: null, + errorRange: [ + 6, + 11, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![text][url]', + errorDetail: null, + errorRange: [ + 6, + 12, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url][]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url][]', + errorDetail: null, + errorRange: [ + 6, + 8, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]', + errorDetail: null, + errorRange: [ + 6, + 5, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]', + errorDetail: null, + errorRange: [ + 6, + 6, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/embe...', + errorDetail: null, + errorRange: [ + 6, + 46, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/back...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[embedded-backslash]', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[backslash-escape]', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 30, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/an>g...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com](user@exampl...', + errorDetail: null, + errorRange: [ + 6, + 36, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com][email]', + errorDetail: null, + errorRange: [ + 6, + 25, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email][]', + errorDetail: null, + errorRange: [ + 6, + 9, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style None␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text ![url]() text {MD054}␊ + ␊ + Text [url](https://example.com "title") text {MD054}␊ + ␊ + Text ![url](https://example.com "title") text {MD054}␊ + ␊ + Text {MD054} [url](https://example.com␊ + "title") text␊ + ␊ + Text {MD054} ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text][url] text {MD054}␊ + ␊ + Text ![text][url] text {MD054}␊ + ␊ + Text [url][] text {MD054}␊ + ␊ + Text ![url][] text {MD054}␊ + ␊ + Text [url] text {MD054}␊ + ␊ + Text ![url] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text {MD054}␊ + ␊ + Text [embedded-backslash] text {MD054}␊ + ␊ + Text [backslash-escape] text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text {MD054}␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text {MD054}␊ + ␊ + Text [url](relative/path) text {MD054}␊ + ␊ + Text [url](#fragment) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [url](https://example.com/an>g) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com][email] text {MD054}␊ + ␊ + Text [email][] text {MD054}␊ + ␊ + Text [email] text {MD054}␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-reference-only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 26, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 27, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]()', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]()', + errorDetail: null, + errorRange: [ + 6, + 29, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com "tit...', + errorDetail: null, + errorRange: [ + 6, + 34, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com "ti...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/embe...', + errorDetail: null, + errorRange: [ + 6, + 46, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/back...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 30, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/an>g...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com](user@exampl...', + errorDetail: null, + errorRange: [ + 6, + 36, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Reference Only␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text ![url]() text {MD054}␊ + ␊ + Text [url](https://example.com "title") text {MD054}␊ + ␊ + Text ![url](https://example.com "title") text {MD054}␊ + ␊ + Text {MD054} [url](https://example.com␊ + "title") text␊ + ␊ + Text {MD054} ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text][url] text␊ + ␊ + Text ![text][url] text␊ + ␊ + Text [url][] text␊ + ␊ + Text ![url][] text␊ + ␊ + Text [url] text␊ + ␊ + Text ![url] text␊ + ␊ + Text text {MD054}␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text {MD054}␊ + ␊ + Text [embedded-backslash] text␊ + ␊ + Text [backslash-escape] text␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text {MD054}␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text {MD054}␊ + ␊ + Text [url](relative/path) text {MD054}␊ + ␊ + Text [url](#fragment) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [url](https://example.com/an>g) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com][email] text␊ + ␊ + Text [email][] text␊ + ␊ + Text [email] text␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## link-style-shortcut-only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 26, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com)', + errorDetail: null, + errorRange: [ + 6, + 27, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url]()', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url]()', + errorDetail: null, + errorRange: [ + 6, + 29, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com "tit...', + errorDetail: null, + errorRange: [ + 6, + 34, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com "ti...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url](https://example.com', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[text][url]', + errorDetail: null, + errorRange: [ + 6, + 11, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![text][url]', + errorDetail: null, + errorRange: [ + 6, + 12, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url][]', + errorDetail: null, + errorRange: [ + 6, + 7, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '![url][]', + errorDetail: null, + errorRange: [ + 6, + 8, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 21, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/embe...', + errorDetail: null, + errorRange: [ + 6, + 46, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/back...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 30, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[url](https://example.com/an>g...', + errorDetail: null, + errorRange: [ + 6, + 35, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com](user@exampl...', + errorDetail: null, + errorRange: [ + 6, + 36, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[user@example.com][email]', + errorDetail: null, + errorRange: [ + 6, + 25, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + { + errorContext: '[email][]', + errorDetail: null, + errorRange: [ + 6, + 9, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Link and image style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md', + ruleNames: [ + 'MD054', + 'link-image-style', + ], + severity: 'error', + }, + ], + fixed: `# Link Style Shortcut Only␊ + ␊ + Text [url](https://example.com) text {MD054}␊ + ␊ + Text ![url](https://example.com) text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text ![url]() text {MD054}␊ + ␊ + Text [url](https://example.com "title") text {MD054}␊ + ␊ + Text ![url](https://example.com "title") text {MD054}␊ + ␊ + Text {MD054} [url](https://example.com␊ + "title") text␊ + ␊ + Text {MD054} ![url](https://example.com␊ + "title") text␊ + ␊ + Text [text][url] text {MD054}␊ + ␊ + Text ![text][url] text {MD054}␊ + ␊ + Text [url][] text {MD054}␊ + ␊ + Text ![url][] text {MD054}␊ + ␊ + Text [url] text␊ + ␊ + Text ![url] text␊ + ␊ + Text text {MD054}␊ + ␊ + [url]: https://example.com "title"␊ + ␊ + [undefined]␊ + ␊ + Text [url](https://example.com/embedded\\3backslash) text {MD054}␊ + ␊ + Text [url](https://example.com/backslash\\[escape) text {MD054}␊ + ␊ + Text [embedded-backslash] text␊ + ␊ + Text [backslash-escape] text␊ + ␊ + Text text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + [embedded-backslash]: https://example.com/embedded\\3backslash␊ + ␊ + [backslash-escape]: https://example.com/backslash\\[escape␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url]() text {MD054}␊ + ␊ + Text [url](https://example.com/\\(parens\\)) text {MD054}␊ + ␊ + Text [url](https://example.com/pa(re(ns))) text {MD054}␊ + ␊ + Text [url](relative/path) text {MD054}␊ + ␊ + Text [url](#fragment) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [url](https://example.com/an>g) text {MD054}␊ + ␊ + Text text {MD054}␊ + ␊ + Text [user@example.com](user@example.com) text {MD054}␊ + ␊ + Text [user@example.com][email] text {MD054}␊ + ␊ + Text [email][] text {MD054}␊ + ␊ + Text [email] text␊ + ␊ + [email]: user@example.com␊ + ␊ + ␊ + `, + } + +## links-alternate.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: '(Incorrect link syntax)[https://www.example.com/]', + errorRange: [ + 1, + 49, + ], + fixInfo: { + deleteCount: 49, + editColumn: 1, + insertText: '[Incorrect link syntax](https://www.example.com/)', + }, + lineNumber: 30, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/', + errorDetail: null, + errorRange: [ + 6, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 6, + insertText: '', + }, + lineNumber: 3, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/bare', + errorDetail: null, + errorRange: [ + 42, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 42, + insertText: '', + }, + lineNumber: 5, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/bare', + errorDetail: null, + errorRange: [ + 6, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 6, + insertText: '', + }, + lineNumber: 7, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/', + errorDetail: null, + errorRange: [ + 48, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 48, + insertText: '', + }, + lineNumber: 9, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/bare', + errorDetail: null, + errorRange: [ + 44, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 44, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/dir', + errorDetail: null, + errorRange: [ + 6, + 23, + ], + fixInfo: { + deleteCount: 23, + editColumn: 6, + insertText: '', + }, + lineNumber: 13, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/file.txt', + errorDetail: null, + errorRange: [ + 6, + 28, + ], + fixInfo: { + deleteCount: 28, + editColumn: 6, + insertText: '', + }, + lineNumber: 14, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/dir/dir/fi...', + errorDetail: null, + errorRange: [ + 6, + 44, + ], + fixInfo: { + deleteCount: 44, + editColumn: 6, + insertText: '', + }, + lineNumber: 16, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/same', + errorDetail: null, + errorRange: [ + 43, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 43, + insertText: '', + }, + lineNumber: 24, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/same', + errorDetail: null, + errorRange: [ + 46, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 46, + insertText: '', + }, + lineNumber: 26, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/first', + errorDetail: null, + errorRange: [ + 6, + 25, + ], + fixInfo: { + deleteCount: 25, + editColumn: 6, + insertText: '', + }, + lineNumber: 28, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/second', + errorDetail: null, + errorRange: [ + 42, + 26, + ], + fixInfo: { + deleteCount: 26, + editColumn: 42, + insertText: '', + }, + lineNumber: 28, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/third', + errorDetail: null, + errorRange: [ + 85, + 25, + ], + fixInfo: { + deleteCount: 25, + editColumn: 85, + insertText: '', + }, + lineNumber: 28, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: '[link ]', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 32, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 34, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 36, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 12, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 12, + }, + lineNumber: 36, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[link ]', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 38, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 40, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 42, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 12, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 12, + }, + lineNumber: 42, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + ], + fixed: `# Detailed Link Results␊ + ␊ + Text text {MD034}␊ + ␊ + Text text text {MD034}␊ + ␊ + Text text text {MD034}␊ + ␊ + Text \`code https://example.com/code code\` text text {MD034}␊ + ␊ + > Text text text {MD034}␊ + ␊ + Text {MD034}␊ + text {MD034}␊ + text ␊ + text {MD034}␊ + ␊ + \`\`\`text␊ + Code https://example.com/code?type=fence code␊ + \`\`\`␊ + ␊ + Code https://example.com/code?type=indent code␊ + ␊ + Text more text still more text done {MD034}␊ + ␊ + Text more \\* text more \\[ text done {MD034}␊ + ␊ + Text more text still more text done {MD034}␊ + ␊ + [Incorrect link syntax](https://www.example.com/) {MD011}␊ + ␊ + Text [link](https://example.com/) text. {MD039}␊ + ␊ + Text [link](https://example.com/) text. {MD039}␊ + ␊ + Text [link](https://example.com/) text. {MD039}␊ + ␊ + Text [link][reference] text. {MD039}␊ + ␊ + Text [link][reference] text. {MD039}␊ + ␊ + Text [link][reference] text. {MD039}␊ + ␊ + [reference]: https://example.com/␊ + ␊ + ␊ + `, + } + +## links-with-markup.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '...k has `code` and right space ]', + errorDetail: null, + errorRange: [ + 38, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 38, + }, + lineNumber: 11, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ This link has *emphasis* and...', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 13, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[too ]', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + ], + fixed: `# links-with-markup␊ + ␊ + [This link is plain](link)␊ + ␊ + [This link has \`code\`](link)␊ + ␊ + [This link has *some* emphasis](link)␊ + ␊ + [This link has **more** emphasis](link)␊ + ␊ + [This link has \`code\` and right space](link) {MD039}␊ + ␊ + [This link has *emphasis* and left space](link) {MD039}␊ + ␊ + [This](link) line has [multiple](link) links.␊ + ␊ + [This](line) does [too](link) and one has a [space](link) {MD039}␊ + `, + } + +## links.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'https://www.example.com/', + errorDetail: null, + errorRange: [ + 17, + 24, + ], + fixInfo: { + deleteCount: 24, + editColumn: 17, + insertText: '', + }, + lineNumber: 4, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://www.google.com/', + errorDetail: null, + errorRange: [ + 1, + 23, + ], + fixInfo: { + deleteCount: 23, + editColumn: 1, + insertText: '', + }, + lineNumber: 7, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'hTtPs://gOoGlE.cOm/', + errorDetail: null, + errorRange: [ + 1, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 1, + insertText: '', + }, + lineNumber: 9, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 2, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 2, + insertText: '', + }, + lineNumber: 20, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com}', + errorDetail: null, + errorRange: [ + 2, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 2, + insertText: '', + }, + lineNumber: 21, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/', + errorDetail: null, + errorRange: [ + 3, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 3, + insertText: '', + }, + lineNumber: 27, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/', + errorDetail: null, + errorRange: [ + 26, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 26, + insertText: '', + }, + lineNumber: 27, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 43, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 43, + insertText: '', + }, + lineNumber: 30, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + ], + fixed: `# Link test␊ + ␊ + For more information, please see the␊ + following page: {MD034}␊ + which will tell you all you want to know.␊ + ␊ + {MD034}␊ + ␊ + {MD034}␊ + ␊ + This link should be fine: ␊ + ␊ + The following are allowed to avoid conflicts with MD011/no-reversed-links:␊ + ␊ + [https://example.com]␊ + [https://example.com/search?query=text]␊ + ␊ + Other enclosures are not allowed:␊ + ␊ + () {MD034}␊ + { {MD034}␊ + ␊ + Duplicate links in tables should be handled:␊ + ␊ + | Link | Same Link | Violation |␊ + |----------------------|----------------------|-----------|␊ + | | | {MD034} |␊ + ␊ + This is not a bare URL: [text [undefined] text](https://example.com).␊ + This is a bare URL: [text [defined] text](). {MD034}␊ + ␊ + [defined]: https://example.com␊ + `, + } + +## lint-javascript.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Lint JavaScript␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + \`\`\`js␊ + "use strict";␊ + ␊ + var x = 0;␊ + ␊ + console.log(x);␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + var y = 0;␊ + ␊ + Text␊ + ␊ + Text \`undefined\` text␊ + ␊ + Text␊ + `, + } + +## list-indentation-start-indent-indent.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 7; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 9, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 15, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 16, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 25, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 26, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 7; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 27, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# List Indentation start_indent/indent␊ + ␊ + * item 1␊ + * item 2␊ + * item 2.1␊ + * item 2.2␊ + * item 2.2.1␊ + * item 2.3␊ + * item 2.3.1 {MD007}␊ + * item 3␊ + * item 4 {MD005} {MD007}␊ + ␊ + Text␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1␊ + * item 2.2␊ + * item 2.2.1␊ + ␊ + Text␊ + ␊ + * item 1␊ + * item 2␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + ␊ + ␊ + `, + } + +## list-indentation-start-indent-no-indent.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 5; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 9, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 11, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 15, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 16, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 17, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 18, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 5; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 19, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 25, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 26, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 5; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 27, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# List Indentation start_indent/no indent␊ + ␊ + * item 1␊ + * item 2␊ + * item 2.1␊ + * item 2.2␊ + * item 2.2.1␊ + * item 2.3␊ + * item 2.3.1 {MD007}␊ + * item 3␊ + * item 4 {MD005} {MD007}␊ + ␊ + Text␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + ␊ + Text␊ + ␊ + * item 1␊ + * item 2␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + ␊ + ␊ + `, + } + +## list-indentation-start-indented-indent.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 0', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 13, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 0', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 14, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 15, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 16, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 9; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 17, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 18, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 0', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 19, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 23, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 24, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 25, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 26, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 9; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 27, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 28, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 29, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 33, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 34, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 35, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 36, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 9; Actual: 8', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 37, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 38, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 39, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# List Indentation - Start Indented␊ + ␊ + * item 1␊ + * item 2␊ + * item 2.1␊ + * item 2.2␊ + * item 2.2.1␊ + * item 2.3␊ + * item 3␊ + ␊ + ## Disallowed List Indentation - Starts at Zero␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + * item 2.3 {MD007}␊ + * item 3 {MD007}␊ + ␊ + ## Disallowed List Indentation - Starts at One␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + * item 2.3 {MD007}␊ + * item 3 {MD007}␊ + ␊ + ## Disallowed List Indentation - Starts at Two␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + * item 2.3 {MD007}␊ + * item 3 {MD007}␊ + ␊ + ␊ + `, + } + +## list-indentation-start-indented-no-indent.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 0', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 13, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 0', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 14, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 15, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 16, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 17, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 18, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 0', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 19, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 23, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 24, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 25, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 26, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 27, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 28, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 30, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 34, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 35, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 36, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 37, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 9', + errorRange: [ + 1, + 11, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + insertText: '', + }, + lineNumber: 38, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 39, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 40, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# List Indentation - Start Indented/No Indent␊ + ␊ + * item 1␊ + * item 2␊ + * item 2.1␊ + * item 2.2␊ + * item 2.2.1␊ + * item 2.3␊ + * item 3␊ + ␊ + ## Disallowed List Indentation - Starts at Zero␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + * item 2.3 {MD007}␊ + * item 3 {MD007}␊ + ␊ + ## Disallowed List Indentation - Starts at One␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + * item 2.3 {MD007}␊ + * item 2.3.1␊ + * item 3 {MD007}␊ + ␊ + ## Disallowed List Indentation - Starts at Three␊ + ␊ + * item 1 {MD007}␊ + * item 2 {MD007}␊ + * item 2.1 {MD007}␊ + * item 2.2 {MD007}␊ + * item 2.2.1 {MD007}␊ + * item 2.3 {MD007}␊ + * item 3 {MD007}␊ + ␊ + ␊ + `, + } + +## list-indentation.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 6, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 8, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 15, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 20, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 28, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 30, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 31, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 35, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 38, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 39, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 40, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 42, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 43, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 50, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 51, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 52, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 53, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 54, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 55, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 56, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# List Indentation␊ + ␊ + Text␊ + ␊ + - Item␊ + - Item {MD007}␊ + - Item␊ + - Item {MD007}␊ + ␊ + Text␊ + ␊ + - Item␊ + - Item␊ + - Item␊ + - Item {MD007}␊ + ␊ + Text␊ + ␊ + - Item␊ + - Item {MD007}␊ + - Item␊ + - Item␊ + ␊ + Text␊ + ␊ + - Item␊ + - Item␊ + - Item {MD005} {MD007}␊ + - Item␊ + - Item {MD005} {MD007}␊ + - Item {MD005} {MD007}␊ + - Item␊ + - Item␊ + - Item␊ + - Item {MD005} {MD007}␊ + - Item␊ + - Item␊ + - Item {MD007}␊ + - Item {MD007}␊ + - Item {MD007}␊ + - Item␊ + - Item {MD007}␊ + - Item {MD007}␊ + - Item {MD005}␊ + ␊ + Text␊ + ␊ + ## Invalid Indentation - Should Start at Zero␊ + ␊ + - item 1 {MD007}␊ + - item 2 {MD007}␊ + - item 2.1 {MD007}␊ + - item 2.2 {MD007}␊ + - item 2.2.1 {MD007}␊ + - item 2.3 {MD007}␊ + - item 3 {MD007}␊ + `, + } + +## list-item-prefix-alignment.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 87, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: (4); Actual: (5)', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: '', + }, + lineNumber: 93, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: (4); Actual: (3)', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 1, + insertText: ' ', + }, + lineNumber: 95, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 101, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 5; Actual: 6', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '', + }, + lineNumber: 107, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 5; Actual: 6', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '', + }, + lineNumber: 110, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 114, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 5', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 0, + editColumn: 6, + insertText: ' ', + }, + lineNumber: 118, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '', + }, + lineNumber: 122, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 0, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 127, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + ], + fixed: `# List Alignment␊ + ␊ + ## Leading Spaces␊ + ␊ + 1. One␊ + 2. Two␊ + 3. Three␊ + 4. Four␊ + 5. Five␊ + 6. Six␊ + 7. Seven␊ + 8. Eight␊ + 9. Nine␊ + 10. Ten␊ + 11. Eleven␊ + 12. Twelve␊ + ␊ + ## Leading Zeroes␊ + ␊ + 01. One␊ + 02. Two␊ + 03. Three␊ + 04. Four␊ + 05. Five␊ + 06. Six␊ + 07. Seven␊ + 08. Eight␊ + 09. Nine␊ + 10. Ten␊ + 11. Eleven␊ + 12. Twelve␊ + ␊ + ## Double Leading Zeroes␊ + ␊ + 001. One␊ + 002. Two␊ + 003. Three␊ + ␊ + ## Nested Lists␊ + ␊ + - Item␊ + - Item␊ + 01. One␊ + 02. Two␊ + 03. Three␊ + 04. Four␊ + 05. Five␊ + 06. Six␊ + 07. Seven␊ + 08. Eight␊ + 09. Nine␊ + 10. Ten␊ + 11. Eleven␊ + 12. Twelve␊ + - Item␊ + - Item␊ + 1. One␊ + 2. Two␊ + 3. Three␊ + 4. Four␊ + 5. Five␊ + 6. Six␊ + 7. Seven␊ + 8. Eight␊ + 9. Nine␊ + 10. Ten␊ + 11. Eleven␊ + 12. Twelve␊ + - Item␊ + - Item␊ + ␊ + ## Another Nested List␊ + ␊ + 01. One␊ + 02. Two␊ + 01. One␊ + 02. Two␊ + 03. Three␊ + 04. Four␊ + ␊ + ## Leading Spaces Errors␊ + ␊ + 1. One␊ + 2. Two␊ + 3. Three␊ + 4. Four␊ + 5. Five {MD005}␊ + 6. Six␊ + 7. Seven␊ + 8. Eight␊ + 9. Nine␊ + 10. Ten␊ + 11. Eleven {MD005}␊ + 12. Twelve␊ + 13. Thirteen {MD005}␊ + 14. Fourteen␊ + ␊ + ## Leading Spaces Errors with Nesting␊ + ␊ + 1. One␊ + 2. Two {MD005}␊ + 3. Three␊ + 1. One␊ + 2. Two␊ + 3. Three␊ + 4. Four␊ + 5. Five {MD005}␊ + 6. Six␊ + 7. Seven␊ + 8. Eight {MD005}␊ + 9. Nine␊ + 10. Ten␊ + 4. Four␊ + 5. Five {MD005}␊ + 6. Six␊ + 1. One␊ + 2. Two␊ + 3. Three {MD005}␊ + 4. Four␊ + 5. Five␊ + 6. Six␊ + 7. Seven {MD005}␊ + 8. Eight␊ + 9. Nine␊ + 10. Ten␊ + 7. Seven␊ + 8. Eight {MD005}␊ + 9. Nine␊ + 10. Ten␊ + `, + } + +## list-syntax-in-paragraph-text.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 24, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 5; Style: 1/2/3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '2', + }, + lineNumber: 14, + ruleDescription: 'Ordered list item prefix', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md029.md', + ruleNames: [ + 'MD029', + 'ol-prefix', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 3, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 17, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 3', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 3, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 27, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: '1. This is a list. {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 10, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. This is a list. It also has...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 13, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. This is a list. {MD030} {...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 17, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- in its list. {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 20, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- in its list. It also has a p...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 23, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- in its list. It also has a p...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 24, + }, + lineNumber: 23, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '+ in its list. {MD004} {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 24, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- This is a list. {MD030} {M...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 27, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. which creates a list {MD032...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 31, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. before the list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 37, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + This paragraph has the number␊ + 5. More text.␊ + ␊ + This paragraph has the number␊ + 11. More text.␊ + ␊ + This non-paragraph has the number␊ + ␊ + 1. This is a list. {MD032}␊ + ␊ + This non-paragraph has the number␊ + ␊ + 1. This is a list. It also has the number {MD032}␊ + 2. This is a list. {MD029}␊ + ␊ + This non-paragraph has spaces and the number␊ + ␊ + 1. This is a list. {MD030} {MD032}␊ + ␊ + This non-paragraph has a dash␊ + ␊ + - in its list. {MD032}␊ + ␊ + This non-paragraph has a dash␊ + ␊ + - in its list. It also has a plus {MD032}␊ + - in its list. {MD004} {MD032}␊ + ␊ + This non-paragraph has spaces and a dash␊ + ␊ + - This is a list. {MD030} {MD032}␊ + ␊ + This is a mixed paragraph that has␊ + 2. followed by text followed by␊ + ␊ + 1. which creates a list {MD032}␊ + 1. with a couple of items␊ + ␊ + Another mixed paragraph␊ + 2. with more text␊ + in the middle of things␊ + ␊ + 1. before the list {MD032}␊ + `, + } + +## lists-and-headings.md + +> Snapshot 1 + + { + errors: [], + fixed: `␊ + ␊ + * list␊ + * list␊ + ␊ + # Heading 1␊ + ␊ + * list␊ + * list␊ + ␊ + # Heading 2 #␊ + ␊ + * list␊ + * list␊ + ␊ + Heading 3␊ + =========␊ + ␊ + * list␊ + * list␊ + ␊ + ␊ + `, + } + +## lists-in-blockquote-normal-indent.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Lists in Blockquote Normal Indent␊ + ␊ + Text␊ + ␊ + + Item␊ + + Item␊ + more␊ + item␊ + + Item␊ + + Item␊ + + Item␊ + more␊ + item␊ + + Item␊ + + Item␊ + + Item␊ + + Item␊ + + Item␊ + ␊ + Text␊ + ␊ + Code␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > + Item␊ + > + Item␊ + > more␊ + > item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > more␊ + > item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > + Item␊ + >␊ + > Text␊ + >␊ + > Code␊ + ␊ + Text␊ + ␊ + 1. Item␊ + 1. Item␊ + more␊ + item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + more␊ + item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + ␊ + Text␊ + ␊ + Code␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > 1. Item␊ + > 1. Item␊ + > more␊ + > item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > more␊ + > item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + >␊ + > Text␊ + >␊ + > Code␊ + ␊ + Text␊ + `, + } + +## lists-in-blockquote-start-indented-no-list-items.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Lists in Blockquote Start Indented␊ + ␊ + Text␊ + ␊ + + Item␊ + + Item␊ + more␊ + item␊ + + Item␊ + + Item␊ + + Item␊ + more␊ + item␊ + + Item␊ + + Item␊ + + Item␊ + + Item␊ + + Item␊ + ␊ + Text␊ + ␊ + Code␊ + ␊ + Text␊ + ␊ + ␊ + ␊ + > Text␊ + >␊ + > + Item␊ + > + Item␊ + > more␊ + > item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > more␊ + > item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > + Item␊ + >␊ + > Text␊ + >␊ + > Code␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + 1. Item␊ + 1. Item␊ + more␊ + item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + more␊ + item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + ␊ + Text␊ + ␊ + Code␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > 1. Item␊ + > 1. Item␊ + > more␊ + > item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > more␊ + > item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + >␊ + > Text␊ + >␊ + > Code␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## lists-in-blockquote-start-indented.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '> + Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 30, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> + Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 31, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> + Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 34, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> + Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 43, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> 1. Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 76, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> 1. Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 77, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> 1. Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 80, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: '> 1. Item {MD027}', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 89, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + ], + fixed: `# Lists in Blockquote Start Indented␊ + ␊ + Text␊ + ␊ + + Item␊ + + Item␊ + more␊ + item␊ + + Item␊ + + Item␊ + + Item␊ + more␊ + item␊ + + Item␊ + + Item␊ + + Item␊ + + Item␊ + + Item␊ + ␊ + Text␊ + ␊ + Code␊ + ␊ + Text␊ + ␊ + ␊ + ␊ + > Text␊ + >␊ + > + Item {MD027}␊ + > + Item {MD027}␊ + > more␊ + > item␊ + > + Item {MD027}␊ + > + Item␊ + > + Item␊ + > more␊ + > item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > + Item␊ + > + Item {MD027}␊ + >␊ + > Text␊ + >␊ + > Code␊ + ␊ + ␊ + ␊ + Text␊ + ␊ + 1. Item␊ + 1. Item␊ + more␊ + item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + more␊ + item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + ␊ + Text␊ + ␊ + Code␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > 1. Item {MD027}␊ + > 1. Item {MD027}␊ + > more␊ + > item␊ + > 1. Item {MD027}␊ + > 1. Item␊ + > 1. Item␊ + > more␊ + > item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item {MD027}␊ + >␊ + > Text␊ + >␊ + > Code␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## lists-in-blockquote.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '+', + }, + lineNumber: 32, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '+', + }, + lineNumber: 33, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '+', + }, + lineNumber: 64, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '+', + }, + lineNumber: 65, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '+', + }, + lineNumber: 66, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '+', + }, + lineNumber: 67, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '+', + }, + lineNumber: 68, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '+', + }, + lineNumber: 69, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '+', + }, + lineNumber: 70, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '+', + }, + lineNumber: 71, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: '+', + }, + lineNumber: 72, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '+', + }, + lineNumber: 76, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '+', + }, + lineNumber: 77, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '+', + }, + lineNumber: 78, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '+', + }, + lineNumber: 79, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '+', + }, + lineNumber: 85, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '+', + }, + lineNumber: 86, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '+', + }, + lineNumber: 87, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '+', + }, + lineNumber: 89, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '+', + }, + lineNumber: 90, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '+', + }, + lineNumber: 91, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '+', + }, + lineNumber: 96, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '+', + }, + lineNumber: 97, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + insertText: '+', + }, + lineNumber: 98, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + insertText: '+', + }, + lineNumber: 99, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '+', + }, + lineNumber: 100, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '+', + }, + lineNumber: 101, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '+', + }, + lineNumber: 122, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '+', + }, + lineNumber: 123, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '+', + }, + lineNumber: 140, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '+', + }, + lineNumber: 141, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 7; Actual: 8', + errorRange: [ + 1, + 10, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 5; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 9; Actual: 10', + errorRange: [ + 1, + 12, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 8; Actual: 9', + errorRange: [ + 1, + 11, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 8; Actual: 9', + errorRange: [ + 1, + 11, + ], + fixInfo: null, + lineNumber: 90, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 8; Actual: 9', + errorRange: [ + 1, + 11, + ], + fixInfo: null, + lineNumber: 91, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 98, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 8; Actual: 9', + errorRange: [ + 1, + 11, + ], + fixInfo: null, + lineNumber: 100, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 8; Actual: 9', + errorRange: [ + 1, + 11, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 106, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 109, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 114, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 116, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: null, + lineNumber: 185, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 188, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '', + }, + lineNumber: 67, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '', + }, + lineNumber: 68, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 5', + errorRange: [ + 1, + 12, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: '', + }, + lineNumber: 72, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 11, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '', + }, + lineNumber: 79, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '', + }, + lineNumber: 185, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '', + }, + lineNumber: 188, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: ' > * Item {MD004} {MD005} {...', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 68, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > - Item {MD004} {MD005} ...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 86, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > > - Item {MD004} {MD005...', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 90, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > > - Item {MD004} {MD005...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 91, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > - Item {MD004} {MD005} ...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 97, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > > - Item {MD004} {MD005...', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 100, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > > > - Item {MD004} {MD005...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 101, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: ' > + list in blockquote {MD0...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 185, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 2, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 4, + insertText: ' ', + }, + lineNumber: 19, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 2, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 23, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 9, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 11, + insertText: ' ', + }, + lineNumber: 60, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 8, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 9, + insertText: ' ', + }, + lineNumber: 66, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 9, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + insertText: ' ', + }, + lineNumber: 78, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: '> + Item {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + }, + lineNumber: 47, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '> + Item {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 54, + }, + lineNumber: 53, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '> > - Item {MD004} {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: ` > >␊ + `, + }, + lineNumber: 96, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '> > - Item {MD004} {MD005} {MD...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: ` > >␊ + `, + lineNumber: 99, + }, + lineNumber: 98, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '> > > - Item {MD004} {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: ` > > >␊ + `, + }, + lineNumber: 99, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '> + Item {MD005} {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>␊ + `, + lineNumber: 115, + }, + lineNumber: 114, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '>>+ Item {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `>>␊ + `, + }, + lineNumber: 115, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + ], + fixed: `# Lists in Blockquote␊ + ␊ + > 1. The simplest ordered list in blockquote␊ + ␊ + Text␊ + ␊ + > + The simplest unordered list in blockquote␊ + ␊ + Text␊ + ␊ + >1. Item␊ + ␊ + Text␊ + ␊ + >+ Item␊ + ␊ + Text␊ + ␊ + >1. Item {MD030}␊ + ␊ + Text␊ + ␊ + >+ Item {MD030}␊ + ␊ + Text␊ + ␊ + > 1. Item␊ + > 1. Item␊ + ␊ + Text␊ + ␊ + > + Item {MD004}␊ + > + Item {MD004}␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > + Item␊ + > + Item␊ + >␊ + > Text␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > + Item {MD032}␊ + > + Item␊ + ␊ + Text␊ + ␊ + > + Item␊ + > + Item {MD032}␊ + >␊ + > ---␊ + ␊ + Text␊ + ␊ + > 1. Item␊ + > 1. Item␊ + > 1. Item {MD030}␊ + ␊ + Text␊ + ␊ + > + Item {MD004}␊ + > + Item {MD004}␊ + > + Item {MD004} {MD030}␊ + > + Item {MD004} {MD005} {MD007}␊ + > + Item {MD004} {MD005} {MD007} {MD027}␊ + > + Item {MD004}␊ + > + Item {MD004}␊ + > + Item {MD004}␊ + > + Item {MD004} {MD005} {MD007}␊ + ␊ + Text␊ + ␊ + > > + Item {MD004}␊ + > > + Item {MD004}␊ + > > + Item {MD004} {MD030}␊ + > > + Item {MD004} {MD005} {MD007}␊ + ␊ + Text␊ + ␊ + > Text␊ + >␊ + > > + Item {MD004}␊ + > > + Item {MD004} {MD005} {MD027}␊ + > > + Item {MD004} {MD005}␊ + > >␊ + > > > + Item {MD004}␊ + > > > + Item {MD004} {MD005} {MD027}␊ + > > > + Item {MD004} {MD005} {MD027}␊ + ␊ + Text␊ + ␊ + > Text␊ + > >␊ + > > + Item {MD004} {MD032}␊ + > > + Item {MD004} {MD005} {MD027}␊ + > > + Item {MD004} {MD005} {MD032}␊ + > > >␊ + > > > + Item {MD004} {MD032}␊ + > > > + Item {MD004} {MD005} {MD027}␊ + > > > + Item {MD004} {MD005} {MD027}␊ + ␊ + Text␊ + ␊ + >+ Item␊ + > + Item {MD005}␊ + >>␊ + >>+ Item␊ + >> + Item {MD005}␊ + ␊ + Text␊ + ␊ + >+ Item␊ + > + Item {MD005} {MD032}␊ + >>␊ + >>+ Item {MD032}␊ + >> + Item {MD005}␊ + ␊ + Text␊ + ␊ + > Quoted text␊ + >␊ + > + A list {MD004}␊ + > + of items {MD004}␊ + >␊ + > More quoted text␊ + ␊ + Text␊ + ␊ + > Quoted text␊ + >␊ + > > + A list␊ + > > + of items␊ + >␊ + > More quoted text␊ + ␊ + Text␊ + ␊ + > Quoted text␊ + >␊ + > > + A list {MD004}␊ + > > + of items {MD004}␊ + > >␊ + > > More quoted text␊ + ␊ + Text␊ + ␊ + + List␊ + > blockquote in list␊ + >␊ + > + list in blockquote in list␊ + ␊ + Text␊ + ␊ + + List␊ + Text␊ + ␊ + > + list in blockquote␊ + > + list in blockquote␊ + ␊ + Text␊ + ␊ + > + list in blockquote␊ + ␊ + Text␊ + + List␊ + ␊ + Text␊ + ␊ + > + list in blockquote␊ + ␊ + Text␊ + + List␊ + ␊ + > + list in blockquote␊ + > + sublist in blockquote␊ + > + list in blockquote␊ + > + sublist in blockquote␊ + ␊ + Text␊ + ␊ + + List␊ + Text␊ + ␊ + > + list in blockquote␊ + > + list in blockquote {MD005} {MD007} {MD027}␊ + > + list in blockquote␊ + > + sublist in blockquote␊ + > + sublist in blockquote {MD005} {MD007}␊ + `, + } + +## lists-incomplete.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + editColumn: 8, + insertText: `␊ + `, + }, + lineNumber: 49, + ruleDescription: 'Files should end with a single newline character', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', + ruleNames: [ + 'MD047', + 'single-trailing-newline', + ], + severity: 'error', + }, + ], + fixed: `# Lists Incomplete␊ + ␊ + Text␊ + ␊ + - Item␊ + -␊ + ␊ + Text␊ + ␊ + -␊ + - Item␊ + ␊ + Text␊ + ␊ + - Item␊ + -␊ + - Item␊ + ␊ + Text␊ + ␊ + - Item␊ + -␊ + -␊ + ␊ + Text␊ + ␊ + 1. Item␊ + 1.␊ + ␊ + Text␊ + ␊ + 1.␊ + 1. Item␊ + ␊ + Text␊ + ␊ + 1. Item␊ + 1.␊ + 1. Item␊ + ␊ + Text␊ + ␊ + 1. Item␊ + 1.␊ + 1.␊ + ␊ + Text␊ + ␊ + {MD047}␊ + `, + } + +## lists-inside-footnote.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 18, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 21, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# Lists Inside Footnote␊ + ␊ + Text.[^ref]␊ + ␊ + [^ref]: Note and list:␊ + ␊ + * Item␊ + * Item␊ + * Item␊ + ␊ + 1. Item␊ + 1. Item␊ + 1. Item␊ + ␊ + Text␊ + ␊ + * Item␊ + * Item {MD005} {MD007}␊ + * Item␊ + * Item␊ + * Item {MD005} {MD007}␊ + * Item␊ + `, + } + +## lists-on-a-line.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 6; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 36, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 36, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 40, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 40, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 40, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 44, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 44, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 44, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 48, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 52, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 56, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 56, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 6', + errorRange: [ + 1, + 8, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 56, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 4; Actual: 7', + errorRange: [ + 1, + 9, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + insertText: '', + }, + lineNumber: 57, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 5', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + insertText: '', + }, + lineNumber: 58, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 3', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + insertText: '', + }, + lineNumber: 59, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + ], + fixed: `# Lists on a Line␊ + ␊ + ## Correct␊ + ␊ + Text␊ + ␊ + * * Item␊ + ␊ + Text␊ + ␊ + * * * Item␊ + ␊ + Text␊ + ␊ + - + * Item␊ + ␊ + Text␊ + ␊ + - 1. Item␊ + ␊ + Text␊ + ␊ + - 1. + Item␊ + ␊ + Text␊ + ␊ + * * * Item␊ + * Item␊ + * Item␊ + * Item␊ + ␊ + ## Incorrect␊ + ␊ + Text␊ + ␊ + * * Item {MD007}␊ + ␊ + Text␊ + ␊ + * * * Item {MD007}␊ + ␊ + Text␊ + ␊ + - + * Item {MD007}␊ + ␊ + Text␊ + ␊ + - 1. Item {MD007}␊ + ␊ + Text␊ + ␊ + - 1. + Item {MD007}␊ + ␊ + Text␊ + ␊ + * * * Item {MD007}␊ + * Item {MD005} {MD007}␊ + * Item {MD005} {MD007}␊ + * Item {MD005} {MD007}␊ + ␊ + ␊ + `, + } + +## lists-with-commented-items.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Lists with Commented Items␊ + ␊ + Text␊ + ␊ + - item ␊ + - item ␊ + ␊ + - item ␊ + - item ␊ + ␊ + Text␊ + ␊ + - item ␊ + - item ␊ + ␊ + - item ␊ + - item ␊ + ␊ + Text␊ + ␊ + - item ␊ + ␊ + - item ␊ + ␊ + Text␊ + ␊ + - item ␊ + - item ␊ + ␊ + ␊ + - item ␊ + - item ␊ + ␊ + Text␊ + `, + } + +## lists-with-fenced-code-tight.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Lists with Fenced Code, Tight␊ + ␊ + - Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + - Item␊ + - Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + - Item␊ + ␊ + Text␊ + ␊ + - Item␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + - Item␊ + - Item␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + - Item␊ + ␊ + Text␊ + ␊ + 1. Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + 1. Item␊ + 1. Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + 1. Item␊ + ␊ + Text␊ + ␊ + 1. Item␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + 1. Item␊ + 1. Item␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + 1. Item␊ + ␊ + ␊ + `, + } + +## lists-with-fenced-code.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 21, + }, + lineNumber: 21, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 24, + }, + lineNumber: 23, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 26, + }, + lineNumber: 26, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 29, + }, + lineNumber: 28, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 51, + }, + lineNumber: 51, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 54, + }, + lineNumber: 53, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```text', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 56, + }, + lineNumber: 56, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 59, + }, + lineNumber: 58, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```shell', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 71, + }, + lineNumber: 71, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: 'fence {MD031:-1} {MD031} {MD03...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 73, + }, + lineNumber: 73, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: 'fence {MD031:-1} {MD031} {MD03...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 73, + }, + lineNumber: 72, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + ], + fixed: `# Lists with Fenced Code␊ + ␊ + - Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + - Item␊ + - Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + - Item␊ + ␊ + Text␊ + ␊ + - Item␊ + ␊ + \`\`\`text␊ + fence {MD031:-1} {MD031:+1}␊ + \`\`\`␊ + ␊ + - Item␊ + - Item␊ + ␊ + \`\`\`text␊ + fence {MD031:-1} {MD031:+1}␊ + \`\`\`␊ + ␊ + - Item␊ + ␊ + Text␊ + ␊ + 1. Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + 1. Item␊ + 1. Item␊ + ␊ + \`\`\`text␊ + fence␊ + \`\`\`␊ + ␊ + 1. Item␊ + ␊ + Text␊ + ␊ + 1. Item␊ + ␊ + \`\`\`text␊ + fence {MD031:-1} {MD031:+1}␊ + \`\`\`␊ + ␊ + 1. Item␊ + 1. Item␊ + ␊ + \`\`\`text␊ + fence {MD031:-1} {MD031:+1}␊ + \`\`\`␊ + ␊ + 1. Item␊ + ␊ + Text␊ + ␊ + 1. Text␊ + ␊ + \`\`\`text␊ + code␊ + ␊ + Text␊ + ␊ + 1. Text␊ + ␊ + \`\`\`shell␊ + fence {MD031:-1} {MD031} {MD031:+1} {MD032} {MD040:+1}␊ + ␊ + \`\`\`␊ + `, + } + +## lists-with-nesting.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: '-', + }, + lineNumber: 97, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: '-', + }, + lineNumber: 98, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: '-', + }, + lineNumber: 99, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '', + }, + lineNumber: 22, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 97, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 98, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 99, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2; Style: 1/1/1', + errorRange: [ + 4, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + insertText: '1', + }, + lineNumber: 98, + ruleDescription: 'Ordered list item prefix', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md029.md', + ruleNames: [ + 'MD029', + 'ol-prefix', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 3; Style: 1/1/1', + errorRange: [ + 4, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + insertText: '1', + }, + lineNumber: 99, + ruleDescription: 'Ordered list item prefix', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md029.md', + ruleNames: [ + 'MD029', + 'ol-prefix', + ], + severity: 'error', + }, + { + errorContext: '- one {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 18, + }, + lineNumber: 17, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. two {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 18, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. two {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 19, + }, + lineNumber: 18, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- three {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 19, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. one {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 22, + }, + lineNumber: 21, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- two {MD007} {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 22, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- two {MD007} {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 23, + }, + lineNumber: 22, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. three {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 23, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + ], + fixed: `# Lists with Nesting␊ + ␊ + ## Excessive nesting␊ + ␊ + - one␊ + 1. two␊ + 1. three␊ + - four␊ + ␊ + 1. one␊ + - two␊ + - three␊ + 1. four␊ + ␊ + ## Insufficient nesting␊ + ␊ + - one {MD032}␊ + ␊ + 1. two {MD032}␊ + ␊ + - three {MD032}␊ + ␊ + 1. one {MD032}␊ + ␊ + - two {MD007} {MD032}␊ + ␊ + 1. three {MD032}␊ + ␊ + ## Correct nesting, same type␊ + ␊ + - one␊ + - two␊ + - three␊ + - four␊ + - five␊ + - six␊ + - seven␊ + ␊ + 1. one␊ + 1. two␊ + 1. three␊ + 1. four␊ + 1. five␊ + 1. six␊ + 1. seven␊ + ␊ + ## Correct nesting, different types␊ + ␊ + - one␊ + 1. two␊ + 1. three␊ + - four␊ + ␊ + 1. one␊ + - two␊ + - three␊ + 1. four␊ + ␊ + 1. one␊ + - two␊ + - three␊ + ␊ + - one␊ + 1. two␊ + - three␊ + ␊ + - one␊ + - two␊ + 1. three␊ + ␊ + 1. one␊ + 1. two␊ + - three␊ + ␊ + 1. one␊ + - two␊ + 1. three␊ + ␊ + - one␊ + 1. two␊ + 1. three␊ + ␊ + - one␊ + 1. two␊ + - three␊ + 1. four␊ + - five␊ + 1. six␊ + - seven␊ + 1. eight␊ + ␊ + 1. one␊ + - two␊ + 1. three␊ + - four␊ + 1. five␊ + - six␊ + 1. seven␊ + - eight␊ + ␊ + - 1. Item {MD004} {MD007}␊ + - 1. Item {MD004} {MD007} {MD029}␊ + - 1. Item {MD004} {MD007} {MD029}␊ + `, + } + +## lists_without_blank_lines.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 64, + }, + lineNumber: 64, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '```', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 73, + }, + lineNumber: 72, + ruleDescription: 'Fenced code blocks should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md031.md', + ruleNames: [ + 'MD031', + 'blanks-around-fences', + ], + severity: 'error', + }, + { + errorContext: '* list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 10, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '* list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 11, + }, + lineNumber: 10, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '+ list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 12, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '+ list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 13, + }, + lineNumber: 12, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 14, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '- list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 15, + }, + lineNumber: 14, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 16, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 17, + }, + lineNumber: 16, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '* list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 21, + }, + lineNumber: 20, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '1. list {MD032}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 24, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '* list {MD032} {MD031:64}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 64, + }, + lineNumber: 63, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: '* list {MD032} {MD031:72}', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 73, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 45, + 1, + ], + fixInfo: { + editColumn: 46, + insertText: `␊ + `, + }, + lineNumber: 103, + ruleDescription: 'Files should end with a single newline character', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', + ruleNames: [ + 'MD047', + 'single-trailing-newline', + ], + severity: 'error', + }, + ], + fixed: `# lists_without_blank_lines␊ + ␊ + * list (on first line)␊ + ␊ + text␊ + ␊ + * list␊ + ␊ + ---␊ + ␊ + * list {MD032}␊ + ␊ + ---␊ + ␊ + + list {MD032}␊ + ␊ + ---␊ + ␊ + - list {MD032}␊ + ␊ + ---␊ + ␊ + 1. list {MD032}␊ + ␊ + ---␊ + ␊ + * list␊ + * list {MD032}␊ + ␊ + ---␊ + ␊ + text␊ + ␊ + 1. list {MD032}␊ + 2. list␊ + ␊ + text␊ + ␊ + * list␊ + * list␊ + * list␊ + ␊ + text␊ + ␊ + * list␊ + with hanging indent␊ + * list␊ + with hanging indent␊ + * list␊ + with hanging indent␊ + ␊ + Note: list without hanging indent violates MD032␊ + ␊ + * list␊ + ␊ + item with blank lines␊ + ␊ + * list␊ + ␊ + item with blank lines␊ + ␊ + text␊ + ␊ + \`\`\`js␊ + /*␊ + * code block␊ + * not a list␊ + */␊ + \`\`\`␊ + ␊ + text␊ + ␊ + * list {MD032} {MD031:64}␊ + ␊ + \`\`\`␊ + code␊ + \`\`\`␊ + ␊ + text␊ + ␊ + \`\`\`␊ + code␊ + \`\`\`␊ + ␊ + * list {MD032} {MD031:72}␊ + ␊ + text␊ + ␊ +

␊ + 1. Not a␊ + 2. list␊ +

␊ + ␊ +

1. Not a list

␊ + ␊ +

␊ + * Not a␊ + * list␊ +

␊ + ␊ +

* Not a list

␊ + ␊ + 1. Undefined reference token␊ +
␊
+         [()]␊
+         
␊ + ␊ + ␊ + ␊ + * list (on last line without newline) {MD047}␊ + `, + } + +## long-heading-exceptions.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 127', + errorRange: [ + 81, + 47, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 127', + errorRange: [ + 81, + 47, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 127', + errorRange: [ + 81, + 47, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + Text␊ + ␊ + ## Heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading␊ + ␊ + Text␊ + ␊ + Text text text text text text text text text text text text text text text text text text text text text text text text {MD013}␊ + ␊ + ## Heading heading␊ + ␊ + Text␊ + ␊ + Text text text text text text text text text text text text text text text text text text text text text text text text {MD013}␊ + ␊ + ### Heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading␊ + ␊ + Text␊ + ␊ + Text text text text text text text text text text text text text text text text text text text text text text text text {MD013}␊ + ␊ + ␊ + `, + } + +## long-lines-long-reference-definitions-stern.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Long Lines Long Reference Definitions Stern␊ + ␊ + [Link][short-reference-definition]␊ + ␊ + [Link][long-reference-definition]␊ + ␊ + [Link][long-reference-definition-split]␊ + ␊ + ![Image][long-reference-definition-image]␊ + ␊ + [short-reference-definition]: https://example.com/short␊ + [long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + [long-reference-definition-split]:␊ + https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + [long-reference-definition-image]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/image␊ + ␊ + [long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + ␊ + ␊ + `, + } + +## long-lines-long-reference-definitions-strict.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Long Lines Long Reference Definitions Strict␊ + ␊ + [Link][short-reference-definition]␊ + ␊ + [Link][long-reference-definition]␊ + ␊ + [Link][long-reference-definition-split]␊ + ␊ + ![Image][long-reference-definition-image]␊ + ␊ + [short-reference-definition]: https://example.com/short␊ + [long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + [long-reference-definition-split]:␊ + https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + [long-reference-definition-image]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/image␊ + ␊ + [long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + ␊ + ␊ + `, + } + +## long-lines-long-reference-definitions.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Long Lines Long Reference Definitions␊ + ␊ + [Link][short-reference-definition]␊ + ␊ + [Link][long-reference-definition]␊ + ␊ + [Link][long-reference-definition-split]␊ + ␊ + ![Image][long-reference-definition-image]␊ + ␊ + [short-reference-definition]: https://example.com/short␊ + [long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + [long-reference-definition-split]:␊ + https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + [long-reference-definition-image]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long/image␊ + ␊ + [long-reference-definition]: https://example.com/long/long/long/long/long/long/long/long/long/long/long/long/long␊ + ␊ + `, + } + +## long-lines-negative-line-length.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Long Lines Negative Line Length␊ + ␊ + Text text text text text text text text text text text text text text text text text text text text.␊ + ␊ + This is an invalid configuration, but present in the wild and (for backward compatibility) disables the rule:␊ + ␊ + ␊ + ␊ + `, + } + +## long-lines-short-code.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 92', + errorRange: [ + 81, + 12, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 46', + errorRange: [ + 31, + 16, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 47', + errorRange: [ + 31, + 17, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Long Lines, Short Code␊ + ␊ + Text text text text text text text text text text text text text text text␊ + ␊ + Text text text text text text text text text text text text text text text text text {MD013}␊ + ␊ + Text␊ + ␊ + Code code code code␊ + ␊ + Text␊ + ␊ + Code code code code code code code {MD013}␊ + ␊ + Text␊ + ␊ + \`\`\`text␊ + Code code code code code␊ + \`\`\`␊ + ␊ + Text␊ + ␊ + \`\`\`text␊ + Code code code code code code code code {MD013}␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## long-lines-short-headings.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 92', + errorRange: [ + 81, + 12, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 38', + errorRange: [ + 31, + 8, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 36', + errorRange: [ + 31, + 6, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 53', + errorRange: [ + 31, + 23, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Long Lines, Short Headings␊ + ␊ + Text text text text text text text text text text text text text text text text text {MD013}␊ + ␊ + ## Short heading text text text␊ + ␊ + Text␊ + ␊ + ## Long heading text text text {MD013}␊ + ␊ + Text␊ + ␊ + ## Long heading text text {MD013} ##␊ + ␊ + Text␊ + ␊ + Long heading of text text text text text text {MD013}␊ + -----------------------------------------------------␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## long-lines-stern.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 82', + errorRange: [ + 81, + 2, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 81', + errorRange: [ + 81, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 87', + errorRange: [ + 81, + 7, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 31', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 21', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 84', + errorRange: [ + 81, + 4, + ], + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 84', + errorRange: [ + 81, + 4, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 85', + errorRange: [ + 81, + 5, + ], + fixInfo: null, + lineNumber: 38, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 84', + errorRange: [ + 81, + 4, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Long Lines Stern␊ + ␊ + 12345678901234567890123456789012345678901234567890123456789012345678901234567890␊ + ␊ + This line is too long. text text text text text text text text text text text text␊ + ␊ + This line is barely too long. text text text text text text text text text text t␊ + ␊ + This line is just okay. text text text text text text text text text text text t␊ + ␊ + This line is not a problem. text text text text text text text text text text t␊ + ␊ + This line is too long. texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext␊ + ␊ + ThisLineIsOkaytexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext␊ + ␊ + ## This heading is way too long␊ + ␊ + ## This heading is long but ok␊ + ␊ + ## This heading is short + ok␊ + ␊ + ## ThisTooLongHeadingIsOkaytext␊ + ␊ + \`\`\`text␊ + This code is too long␊ + This code is a-okay.␊ + This code is short.␊ + ThisTooLongCodeIsOkay.␊ + \`\`\`␊ + ␊ + * This list item line is too long. text text text text text text text text text text␊ + * This list item line is okay. text text text text text text text text text␊ + This list item line is okay. text text text text text text text text text␊ + This list item line is too long. text text text text text text text text text text␊ + ThisTooLongListItemLineIsOkaytexttexttexttexttexttexttexttexttexttexttexttexttext␊ + ␊ + > This blockquote line is too long. text text text text text text text text text text␊ + > This blockquote line is okay. text text text text text text text text text␊ + > ThisTooLongBlockquoteLineIsOkaytexttexttexttexttexttexttexttexttexttexttexttexttext␊ + >␊ + > > This double blockquote line is too long. text text text text text text text text␊ + > > This double blockquote line is okay. text text text text text text text␊ + > > ThisTooLongDoubleBlockquoteLineIsOkaytexttexttexttexttexttexttexttexttexttexttext␊ + ␊ + ThisLineIsTooLongButIsNotReportedBecauseItLooksLikePartOfAListItemtexttexttexttext␊ + ␊ + {MD013:5}␊ + {MD013:7}␊ + {MD013:13}␊ + {MD013:17}␊ + {MD013:26}␊ + {MD013:32}␊ + {MD013:35}␊ + {MD013:38}␊ + {MD013:42}␊ + ␊ + ␊ + `, + } + +## long-lines-strict.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 82', + errorRange: [ + 81, + 2, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 86', + errorRange: [ + 81, + 6, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 81', + errorRange: [ + 81, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 31', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 21', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 22, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Long Lines Strict␊ + ␊ + 12345678901234567890123456789012345678901234567890123456789012345678901234567890␊ + ␊ + This line is too long. text text text text text text text text text text text text␊ + ␊ + This line is way too long. text text text text text text text text text text text text␊ + ␊ + This line is barely too long. text text text text text text text text text text t␊ + ␊ + This line is just okay. text text text text text text text text text text text t␊ + ␊ + This line is not a problem. text text text text text text text text text text t␊ + ␊ + ## This heading is way too long␊ + ␊ + ## This heading is long but ok␊ + ␊ + ## This heading is short + ok␊ + ␊ + \`\`\`text␊ + This code is too long␊ + This code is a-okay.␊ + This code is short.␊ + \`\`\`␊ + ␊ + {MD013:5}␊ + {MD013:7}␊ + {MD013:9}␊ + {MD013:15}␊ + {MD013:22}␊ + ␊ + ␊ + `, + } + +## long-lines-thresholds.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 40; Actual: 44', + errorRange: [ + 41, + 4, + ], + fixInfo: null, + lineNumber: 10, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 40; Actual: 45', + errorRange: [ + 41, + 5, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 40; Actual: 46', + errorRange: [ + 41, + 6, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 33; Actual: 37', + errorRange: [ + 34, + 4, + ], + fixInfo: null, + lineNumber: 22, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 33; Actual: 38', + errorRange: [ + 34, + 5, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 33; Actual: 39', + errorRange: [ + 34, + 6, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 24', + errorRange: [ + 21, + 4, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 25', + errorRange: [ + 21, + 5, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 26', + errorRange: [ + 21, + 6, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 24', + errorRange: [ + 21, + 4, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 25', + errorRange: [ + 21, + 5, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 26', + errorRange: [ + 21, + 6, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Long Lines Thresholds␊ + ␊ + 00000000011111111112222222222333333333344444444445␊ + 12345678901234567890123456789012345678901234567890␊ + ␊ + Text text text text text text text te text␊ + ␊ + Text text text text text text text tex text␊ + ␊ + Text text text text text text text text text␊ + ␊ + Text text text text text text text textx text␊ + ␊ + Text text text text text text text textxe text␊ + ␊ + {MD013:-2} {MD013:-4} {MD013:-6}␊ + ␊ + ## Text text text text text te text␊ + ␊ + ## Text text text text text tex text␊ + ␊ + ## Text text text text text text text␊ + ␊ + ## Text text text text text textx text␊ + ␊ + ## Text text text text text textxe text␊ + ␊ + {MD013:-2} {MD013:-4} {MD013:-6}␊ + ␊ + \`\`\`text␊ + Text text text te text␊ + Text text text tex text␊ + Text text text text text␊ + Text text text textx text␊ + Text text text textxe text␊ + \`\`\`␊ + ␊ + {MD013:-3} {MD013:-4} {MD013:-5}␊ + ␊ + Text text tex text␊ + Text text text text␊ + Text text textx text␊ + Text text textxe text␊ + Text text textxet text␊ + ␊ + {MD013:-2} {MD013:-3} {MD013:-4}␊ + ␊ + ␊ + `, + } + +## long_lines.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 97', + errorRange: [ + 81, + 17, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 110', + errorRange: [ + 81, + 30, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 117', + errorRange: [ + 81, + 37, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 107', + errorRange: [ + 81, + 27, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 112', + errorRange: [ + 81, + 32, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 104', + errorRange: [ + 81, + 24, + ], + fixInfo: null, + lineNumber: 21, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 109', + errorRange: [ + 81, + 29, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 96', + errorRange: [ + 81, + 16, + ], + fixInfo: null, + lineNumber: 64, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 96', + errorRange: [ + 81, + 16, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 96', + errorRange: [ + 81, + 16, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 105', + errorRange: [ + 81, + 25, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 105', + errorRange: [ + 81, + 25, + ], + fixInfo: null, + lineNumber: 74, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 113', + errorRange: [ + 81, + 33, + ], + fixInfo: null, + lineNumber: 80, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 116', + errorRange: [ + 81, + 36, + ], + fixInfo: null, + lineNumber: 82, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '*', + }, + lineNumber: 35, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 114, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 114, + insertText: '*', + }, + lineNumber: 35, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '*', + }, + lineNumber: 41, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 129, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 129, + insertText: '*', + }, + lineNumber: 41, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '*', + }, + lineNumber: 43, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 127, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 127, + insertText: '*', + }, + lineNumber: 43, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '**', + }, + lineNumber: 39, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 110, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 110, + insertText: '**', + }, + lineNumber: 39, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: '[Link to broken label][notlabel]', + errorDetail: 'Missing link or image reference definition: "notlabel"', + errorRange: [ + 1, + 32, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + ], + fixed: `# Long Lines␊ + ␊ + This is a very very very very very very very very very very very very very very long line {MD013}␊ + ␊ + This line however, while very long, doesn't have whitespace after the 80th columnwhichallowsforURLsandotherlongthings.␊ + ␊ + [This long line is comprised entirely of a link](https://example.com "This is the long link's title")␊ + ␊ + > [This long line is comprised entirely of a link](https://example.com "This is the long link's title")␊ + ␊ + [This long line is comprised entirely of a link](https://example.com "But is inside a code block") {MD013}␊ + ␊ + \`\`\`markdown␊ + [This long line is comprised entirely of a link](https://example.com "But is inside a code block") {MD013} {MD046:13}␊ + \`\`\`␊ + ␊ + This [long line is comprised mostly of a link](https://example.com "This is the long link's title") {MD013}␊ + ␊ + [This long line is comprised mostly of a link](https://example.com "This is the long link's title") text {MD013}␊ + ␊ + This long line includes a simple [reference][label] link and is long enough to violate the rule. {MD013}␊ + ␊ + [This long line is comprised entirely of a reference link and is long enough to violate the rule][label]␊ + ␊ + [label]: https://example.org "Title for a link reference that is itself long enough to violate the rule"␊ + ␊ + [Link to broken label][notlabel] {MD052}␊ + ␊ + [notlabel\\]: notlink "Invalid syntax for a link label because the right bracket is backslash-escaped {MD013}"␊ + ␊ + [](https://example.com "This long line is comprised entirely of a link with empty text and a non-empty title")␊ + ␊ + *[This long line is comprised of an emphasized link](https://example.com "This is the long link's title")*␊ + ␊ + *[This long line is comprised of an emphasized link {MD049}](https://example.com "This is the long link's title")*␊ + ␊ + **[This long line is comprised of a bolded link](https://example.com "This is the long link's title")**␊ + ␊ + **[This long line is comprised of a bolded link {MD050}](https://example.com "This is the long link's title")**␊ + ␊ + ***[This long line is comprised of an emphasized and bolded link {MD049}](https://example.com "This is the long link's title")***␊ + ␊ + ***[This long line is comprised of an emphasized and bolded link {MD049}](https://example.com "This is the long link's title")***␊ + ␊ + *[](https://example.com "This long line is comprised of an emphasized link with empty text and a non-empty title")*␊ + ␊ + **[](https://example.com "This long line is comprised of a bolded link with empty text and a non-empty title")**␊ + ␊ + ![Alternate text for long line image example](https://example.com "Title text for long line image example")␊ + ␊ + *![Alternate text for long line image example](https://example.com "Title text for long line image example")*␊ + ␊ + **![Alternate text for long line image example](https://example.com "Title text for long line image example")**␊ + ␊ + ![Reference style for long line image which is itself an example of a long line with content][image]␊ + ␊ + *![Reference style for long line image which is itself an example of a long line with content][image]*␊ + ␊ + **![Reference style for long line image which is itself an example of a long line with content][image]**␊ + ␊ + [image]: https://example.com "Title text for long line image example using reference style for image details"␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + Long lines inside HTML comments should also ␊ + ␊ + ␊ + ␊ + https://example.com/long-line-comprised-entirely-of-a-bare-link-long-line-comprised-entirely-of-a-bare-link␊ + ␊ + Long {MD013}␊ + ␊ + Long https://example.com/long-line-comprised-mostly-of-a-bare-link-long-line-comprised-mostly-of-a-bare-link {MD013}␊ + ␊ + ␊ + `, + } + +## long_lines_100.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 100; Actual: 111', + errorRange: [ + 101, + 11, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# long_lines_100␊ + ␊ + This is a very very very very very very very very long line over 80 chars but less than 100␊ + ␊ + This is a very very very very very very very very very very long line over 80 chars, and also over 100. {MD013}␊ + ␊ + This is a very very very very very very very very very long line that is exactly 100 characters long␊ + ␊ + This line however, while very long, doesn't have whitespace after the 100th columnwhichallowsforURLsandotherlongthings.␊ + ␊ + ␊ + `, + } + +## long_lines_code-default.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 128', + errorRange: [ + 81, + 48, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 139', + errorRange: [ + 81, + 59, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 20, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 128', + errorRange: [ + 81, + 48, + ], + fixInfo: null, + lineNumber: 22, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 111', + errorRange: [ + 81, + 31, + ], + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# long_lines_code-default␊ + ␊ + This is a short line.␊ + ␊ + This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013}␊ + ␊ + This is a short line.␊ + ␊ + \`\`\`text␊ + Here is a short line in a code block.␊ + Here is a very very very very very very very very very very very very very very very very very very very long line in a code block. {MD013}␊ + \`\`\`␊ + ␊ + This is a short line.␊ + ␊ + | First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | {MD013}␊ + | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | {MD013}␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013}␊ + | ============== | ============== | ============== | ============== | ============== | ============== | {MD013}␊ + | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013}␊ + ␊ + This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013}␊ + ␊ + Another line.␊ + ␊ + | First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | {MD013}␊ + | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | {MD013}␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013}␊ + | ============== | ============== | ============== | ============== | ============== | ============== | {MD013}␊ + | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013}␊ + `, + } + +## long_lines_code.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 128', + errorRange: [ + 81, + 48, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 80; Actual: 128', + errorRange: [ + 81, + 48, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# long_lines_code␊ + ␊ + This is a short line.␊ + ␊ + This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013}␊ + ␊ + This is a short line.␊ + ␊ + \`\`\`text␊ + Here is a short line in a code block.␊ + Here is a very very very very very very very very very very very very very very very very very very very long line in a code block.␊ + \`\`\`␊ + ␊ + \`\`\`text␊ + test␊ + test␊ + ␊ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut␊ + \`\`\`␊ + ␊ + This is a short line.␊ + ␊ + | First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading |␊ + | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | ============== | ============== | ============== | ============== | ============== | ============== |␊ + | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell |␊ + ␊ + This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013}␊ + ␊ + Another line.␊ + ␊ + | First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading |␊ + | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell |␊ + | ============== | ============== | ============== | ============== | ============== | ============== |␊ + | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell |␊ + ␊ + ␊ + `, + } + +## markdown-extra-footnote.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: '(parenthesized footnote)[x^y]', + errorRange: [ + 15, + 29, + ], + fixInfo: { + deleteCount: 29, + editColumn: 15, + insertText: '[parenthesized footnote](x^y)', + }, + lineNumber: 7, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(is this)[z]', + errorRange: [ + 5, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 5, + insertText: '[is this](z)', + }, + lineNumber: 9, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + Text with Markdown Extra footnote[^1]␊ + ␊ + Text with (parenthesized footnote)[^2]␊ + ␊ + This is not a [parenthesized footnote](x^y) {MD011}␊ + ␊ + Nor [is this](z) {MD011}␊ + ␊ + [^1]: Footnote␊ + [^2]: Another footnote␊ + `, + } + +## markdown-in-html.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: '+', + }, + lineNumber: 25, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '+', + }, + lineNumber: 26, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 0', + errorRange: [ + 1, + 2, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Inconsistent indentation for list items at the same level', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md', + ruleNames: [ + 'MD005', + 'list-indent', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '', + }, + lineNumber: 25, + ruleDescription: 'Unordered list indentation', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md', + ruleNames: [ + 'MD007', + 'ul-indent', + ], + severity: 'error', + }, + { + errorContext: '## Heading 2b {MD019} {MD022}', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 24, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '### Heading 3b {MD003} {MD021...', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 32, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '...b {MD003} {MD021} {MD022} ###', + errorDetail: null, + errorRange: [ + 41, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 41, + }, + lineNumber: 32, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## Heading 2b {MD019} {MD022}', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 25, + }, + lineNumber: 24, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '### Heading 3b {MD003} {MD021} {MD022} ###', + errorDetail: 'Expected: 1; Actual: 0; Below', + errorRange: null, + fixInfo: { + insertText: `␊ + `, + lineNumber: 33, + }, + lineNumber: 32, + ruleDescription: 'Headings should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md', + ruleNames: [ + 'MD022', + 'blanks-around-headings', + ], + severity: 'error', + }, + { + errorContext: '- Text *text* text * text * te...', + errorDetail: null, + errorRange: null, + fixInfo: { + insertText: `␊ + `, + }, + lineNumber: 25, + ruleDescription: 'Lists should be surrounded by blank lines', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md', + ruleNames: [ + 'MD032', + 'blanks-around-lists', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com/', + errorDetail: null, + errorRange: [ + 8, + 20, + ], + fixInfo: { + deleteCount: 20, + editColumn: 8, + insertText: '', + }, + lineNumber: 26, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 22, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 22, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 't *', + errorDetail: null, + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** t', + errorDetail: null, + errorRange: [ + 37, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 37, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 't **', + errorDetail: null, + errorRange: [ + 42, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 42, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '` text `', + errorDetail: null, + errorRange: [ + 64, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 64, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` text `', + errorDetail: null, + errorRange: [ + 70, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 70, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 26, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 35, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 35, + }, + lineNumber: 26, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + ], + fixed: `# Markdown in HTML␊ + ␊ + Text␊ + ␊ + + Item␊ + ␊ + Text␊ + ␊ +

␊ + ## Heading 2a␊ + - Text *text* text * text * text ** text ** text \`text\` text \` text \` text␊ + - Text https://example.com/ [ link ](https://example.com/)␊ +

␊ + ␊ +

␊ + ### Heading 3a ###␊ + Text␊ +

␊ + ␊ + Text␊ + ␊ +

␊ + ␊ + ## Heading 2b {MD019} {MD022}␊ + ␊ + + Text *text* text *text* text **text** text \`text\` text \`text\` text {MD004} {MD007} {MD032} {MD037} {MD038}␊ + + Text [link](https://example.com/) {MD004} {MD005} {MD034} {MD039}␊ + ␊ +

␊ + ␊ +

␊ + ␊ + ### Heading 3b {MD003} {MD021} {MD022} ###␊ + ␊ + Text␊ + ␊ +

␊ + ␊ + ␊ + `, + } + +## mathjax-scenarios.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Mathjax Scenarios␊ + ␊ + $1 * 2 * 3$␊ + ␊ + $$1 * 2 * 3$$␊ + ␊ + $$1␊ + + 2␊ + + 3$$␊ + ␊ + $$␊ + 1␊ + $$$$␊ + 2␊ + $$␊ + `, + } + +## md003-escaped-trailing-hash.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: '...railing hash no space{MD020}##', + errorDetail: null, + errorRange: [ + 46, + 3, + ], + fixInfo: { + deleteCount: 48, + editColumn: 1, + insertText: '### Heading with trailing hash no space{MD020} ##', + }, + lineNumber: 17, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '...with trailing hash {MD020} \\##', + errorDetail: null, + errorRange: [ + 41, + 2, + ], + fixInfo: { + deleteCount: 42, + editColumn: 1, + insertText: '### Heading with trailing hash {MD020} \\# #', + }, + lineNumber: 19, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '...ailing hash no space{MD020}\\##', + errorDetail: null, + errorRange: [ + 48, + 2, + ], + fixInfo: { + deleteCount: 49, + editColumn: 1, + insertText: '### Heading with trailing hash no space{MD020} \\# #', + }, + lineNumber: 21, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + ## Heading with trailing hash \\#␊ + ␊ + ## Heading with trailing hash no space\\#␊ + ␊ + ### Heading with trailing hash \\#\\#␊ + ␊ + ### Heading with trailing hash no space\\#\\#␊ + ␊ + ### Heading with trailing hash #\\#␊ + ␊ + ### Heading with trailing hash no space#\\#␊ + ␊ + ### Heading with trailing hash {MD003} ##␊ + ␊ + ### Heading with trailing hash no space{MD020} ##␊ + ␊ + ### Heading with trailing hash {MD020} \\# #␊ + ␊ + ### Heading with trailing hash no space{MD020} \\# #␊ + `, + } + +## md004-list-items-in-blockquote.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + Text␊ + ␊ + - Item␊ + - Item␊ + ␊ + Text␊ + ␊ + >- Item␊ + >- Item␊ + ␊ + Text␊ + ␊ + > - Item␊ + > - Item␊ + ␊ + Text␊ + ␊ + > > - Item␊ + > > - Item␊ + ␊ + Text␊ + `, + } + +## md022-line-number-out-of-range.md + +> Snapshot 1 + + { + errors: [], + fixed: `--␊ + ␊ + `, + } + +## md033-cannot-read-property-of-undefined.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: i', + errorRange: [ + 11, + 3, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: br', + errorRange: [ + 1, + 5, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: b', + errorRange: [ + 11, + 3, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + Head | Head␊ + --------|------------␊ +
| {MD033}␊ + ␊ + {MD033} | Head␊ + --------|------------␊ +
| {MD033}␊ + text | text␊ + {MD033} | text␊ + ␊ + ␊ + `, + } + +## md036-emphasis-as-heading.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'Emphasis as heading {MD036}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + { + errorContext: 'Emphasis as heading {MD036}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Emphasis used instead of a heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md036.md', + ruleNames: [ + 'MD036', + 'no-emphasis-as-heading', + ], + severity: 'error', + }, + ], + fixed: `# Simplified examples from issue #26␊ + ␊ + * Item␊ + * **Emphasized item**␊ + * Item␊ + ␊ + _Emphasis as heading {MD036}_␊ + ␊ + 1. **Emphasized item**␊ + * Item␊ + * Item␊ + 1. **Emphasized item**␊ + * Item␊ + * **Emphasized item**␊ + * Item␊ + ␊ + **Emphasis as heading {MD036}**␊ + `, + } + +## md038-scenarios.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '`code `', + errorDetail: null, + errorRange: [ + 6, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 6, + }, + lineNumber: 23, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code`', + errorDetail: null, + errorRange: [ + 2, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 2, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``code` ``', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` `code``', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 37, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code `', + errorDetail: null, + errorRange: [ + 2, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 2, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code `', + errorDetail: null, + errorRange: [ + 8, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 8, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` code` ``', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 49, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` code` ``', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 49, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` `code ``', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 53, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` `code ``', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 53, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` `code` ``', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 57, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` `code` ``', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 57, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + ], + fixed: `# MD038 Scenarios␊ + ␊ + ## Allowed: No space␊ + ␊ + \`code\`␊ + ␊ + ## Allowed: Padding, no backtick␊ + ␊ + \` code \`␊ + ␊ + ## Allowed: Padding, backtick␊ + ␊ + \`\` \`code\` \`\`␊ + ␊ + ## Allowed: Start or end, backtick␊ + ␊ + \`\`code\` \`\`␊ + ␊ + \`\` \`code\`\`␊ + ␊ + ## Reported: Start or end, no backtick␊ + ␊ + \`code\` {MD038}␊ + ␊ + \`code\` (fixed)␊ + ␊ + \`code\` {MD038}␊ + ␊ + \`code\` (fixed)␊ + ␊ + ## Reported: Start or end, backtick␊ + ␊ + \`\`code\` \`\` {MD038}␊ + ␊ + \`\`code\` \`\` (fixed)␊ + ␊ + \`\` \`code\`\` {MD038}␊ + ␊ + \`\` \`code\`\` (fixed)␊ + ␊ + ## Reported: Start and end, no backtick␊ + ␊ + \`code\` {MD038}␊ + ␊ + \`code\` (fixed)␊ + ␊ + ## Reported: Start and end, backtick␊ + ␊ + \`\` code\` \`\` {MD038}␊ + ␊ + \`\` code\` \`\` (fixed)␊ + ␊ + \`\` \`code \`\` {MD038}␊ + ␊ + \`\` \`code \`\` (fixed)␊ + ␊ + \`\` \`code\` \`\` {MD038}␊ + ␊ + \`\` \`code\` \`\` (fixed)␊ + `, + } + +## md040-allowed_languages.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '` scss`', + errorDetail: null, + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 39, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '"html" is not allowed', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '"css" is not allowed', + errorRange: null, + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '"MD" is not allowed', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '"ts" is not allowed', + errorRange: null, + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + ], + fixed: `# md040-allowed_languages.md␊ + ␊ + Code block with \`html\` not in allowed_languages:␊ + ␊ + \`\`\`html␊ +

markdownlint

{MD040:5}␊ + \`\`\`␊ + ␊ + Code block with \`css\` not in allowed_languages:␊ + ␊ + \`\`\`css␊ + body {} {MD040:11}␊ + \`\`\`␊ + ␊ + Code block with \`MD\` (uppercase) not in allowed_languages:␊ + ␊ + \`\`\`MD␊ + hello md {MD040:17}␊ + \`\`\`␊ + ␊ + Code block with \`ts\` (lowercase) not in allowed_languages:␊ + ␊ + \`\`\`ts␊ + let foo = "bar"; {MD040:23}␊ + \`\`\`␊ + ␊ + Code block with \`js\` in allowed_languages:␊ + ␊ + \`\`\`js␊ + console.log('markdownlint')␊ + \`\`\`␊ + ␊ + Code block with \`js foo\` allowed_languages:␊ + ␊ + \`\`\`js foo␊ + console.log('bar')␊ + \`\`\`␊ + ␊ + Code block with \`scss\` (prefixed by a space) in allowed_languages: {MD038}␊ + ␊ + \`\`\` scss␊ + body {␊ + h1 {␊ + color: red;␊ + }␊ + }␊ + \`\`\`␊ + ␊ + Code block with \`md\` (lowercase) in allowed_languages:␊ + ␊ + \`\`\`md␊ + hello md␊ + \`\`\`␊ + ␊ + Code block with \`TS\` (uppercase) in allowed_languages:␊ + ␊ + \`\`\`TS␊ + body {␊ + h1 {␊ + color: red;␊ + }␊ + }␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## md040-language_only.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 11, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Info string contains more than language: "```html version=5"', + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Fenced code blocks should have a language specified', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md', + ruleNames: [ + 'MD040', + 'fenced-code-language', + ], + severity: 'error', + }, + ], + fixed: `# md040-language_only.md␊ + ␊ + Fence code block information with leading whitespace:␊ + ␊ + \`\`\` html␊ +

markdownlint

␊ + \`\`\`␊ + ␊ + Fence code block information with trailing whitespace:␊ + ␊ + \`\`\`css␊ + body {} {MD009:11}␊ + \`\`\`␊ + ␊ + Fence code block information with extra data:␊ + ␊ + \`\`\`html version=5␊ + MarkdownLint {MD040:17}␊ + \`\`\`␊ + ␊ + Fence code block information without whitespaces and extra data:␊ + ␊ + \`\`\`css␊ + a {}␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## md041-ignore-leading-comments-combined.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 5', + errorRange: [ + 23, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 23, + }, + lineNumber: 9, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Heading # ␊ + ␊ + Text text text␊ + ␊ + Embedded tab␊ + ␊ + Text text text␊ + ␊ + Trailing space {MD009}␊ + ␊ + Text text text␊ + ␊ + ␊ + `, + } + +## md041-ignore-leading-comments-violation.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 5', + errorRange: [ + 23, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 23, + }, + lineNumber: 9, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: 'Text text text {MD041}', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'First line in a file should be a top-level heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md', + ruleNames: [ + 'MD041', + 'first-line-heading', + 'first-line-h1', + ], + severity: 'error', + }, + ], + fixed: `␊ + ␊ + Text text text {MD041}␊ + ␊ + Embedded tab␊ + ␊ + Text text text␊ + ␊ + Trailing space {MD009}␊ + ␊ + Text text text␊ + ␊ + ␊ + `, + } + +## md041-ignore-leading-comments.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 5', + errorRange: [ + 23, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 23, + }, + lineNumber: 11, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `␊ + ␊ + # Heading␊ + ␊ + Text text text␊ + ␊ + Embedded tab␊ + ␊ + Text text text␊ + ␊ + Trailing space {MD009}␊ + ␊ + Text text text␊ + ␊ + ␊ + `, + } + +## md041-yaml-title-and-first-line-heading.md + +> Snapshot 1 + + { + errors: [], + fixed: `---␊ + path: "/post"␊ + date: "2012-06-21T10:14:00.000+02:00"␊ + title: "First level heading"␊ + ---␊ + ␊ + ## Second level heading␊ + ␊ + ␊ + `, + } + +## md052-invalid-range-bug.md + +> Snapshot 1 + + { + errors: [], + fixed: `# MD052 Invalid Range Bug␊ + ␊ + * [0, N)␊ + * \`inputs[0][d]\`␊ + * \`inputs[k]\`␊ + `, + } + +## micromark-regressions.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Micromark Regressions␊ + ␊ + ## ␊ + ␊ + * List item␊ + :::Directive␊ + ␊ + Text␊ + `, + } + +## mixed-emphasis-markers.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 28, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 28, + insertText: '*', + }, + lineNumber: 3, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 34, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 34, + insertText: '*', + }, + lineNumber: 3, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 16, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 16, + insertText: '*', + }, + lineNumber: 5, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + insertText: '*', + }, + lineNumber: 5, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 28, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 28, + insertText: '*', + }, + lineNumber: 7, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 34, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 34, + insertText: '*', + }, + lineNumber: 7, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 16, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 16, + insertText: '*', + }, + lineNumber: 13, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 47, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 47, + insertText: '*', + }, + lineNumber: 13, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 16, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 16, + insertText: '*', + }, + lineNumber: 15, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 49, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 49, + insertText: '*', + }, + lineNumber: 15, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 16, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 16, + insertText: '__', + }, + lineNumber: 11, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 50, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 50, + insertText: '__', + }, + lineNumber: 11, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 28, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 28, + insertText: '__', + }, + lineNumber: 15, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 35, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 35, + insertText: '__', + }, + lineNumber: 15, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 29, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 29, + insertText: '__', + }, + lineNumber: 17, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 36, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 36, + insertText: '__', + }, + lineNumber: 17, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + ], + fixed: `# Mixed Emphasis Markers␊ + ␊ + This paragraph *uses* both *kinds* of emphasis marker. {MD049}␊ + ␊ + This paragraph *uses* both *kinds* of emphasis marker. {MD049}␊ + ␊ + This paragraph *nests both *kinds* of emphasis* marker. {MD049}␊ + ␊ + This paragraph *nests both __kinds__ of emphasis* marker.␊ + ␊ + This paragraph __nests both __kinds__ of emphasis__ marker. {MD050}␊ + ␊ + This paragraph *nests both *kinds* of emphasis* marker. {MD049}␊ + ␊ + This paragraph *nests both __kinds__ of emphasis* marker. {MD049} {MD050}␊ + ␊ + This paragraph __nests both __kinds__ of emphasis__ marker. {MD050}␊ + ␊ + ␊ + `, + } + +## mixed_heading_types_atx.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx; Actual: setext', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + ## Heading 2 {MD003} ##␊ + ␊ + Heading 3 {MD003}␊ + -----------------␊ + `, + } + +## mixed_heading_types_atx_closed.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: atx_closed; Actual: atx', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: atx_closed; Actual: setext', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `# Heading 1 #␊ + ␊ + ## Heading 2 {MD003}␊ + ␊ + Heading 3 {MD003}␊ + -----------------␊ + `, + } + +## mixed_heading_types_setext.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: setext; Actual: atx', + errorRange: null, + fixInfo: null, + lineNumber: 4, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: setext; Actual: atx_closed', + errorRange: null, + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Heading style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md', + ruleNames: [ + 'MD003', + 'heading-style', + ], + severity: 'error', + }, + ], + fixed: `Heading 1␊ + ========␊ + ␊ + ## Heading 2 {MD003}␊ + ␊ + ## Heading 3 {MD003} ##␊ + `, + } + +## no-alt-text.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: null, + errorRange: [ + 1, + 14, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 1, + 22, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 30, + 14, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 40, + 12, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 50, + 10, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 39, + 14, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 1, + 25, + ], + fixInfo: null, + lineNumber: 37, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 33, + 23, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 48, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 1, + 4, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 37, + 21, + ], + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 3, + 23, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 24, + 42, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Images should have alternate text (alt text)', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md', + ruleNames: [ + 'MD045', + 'no-alt-text', + ], + severity: 'error', + }, + ], + fixed: `# Images with and without alternate text␊ + ␊ + ![Alternate text](image.jpg)␊ + ␊ + ![](image.jpg) {MD045}␊ + ␊ + ![Alternate text](image.jpg "Title")␊ + ␊ + ![](image.jpg "Title") {MD045}␊ + ␊ + Image without alternate text ![](image.jpg) in a sentence. {MD045}␊ + ␊ + Reference image with alternate text ![Alternate text][notitle]␊ + ␊ + Reference image without alternate text ![][notitle] {MD045}␊ + ␊ + Reference image with alternate text and title ![Alternate text][title]␊ + ␊ + Reference image without alternate text and title ![][title] {MD045}␊ + ␊ + Link to image with alternate text [![Alternate text](image.jpg)](image.jpg)␊ + ␊ + Link to image without alternate text [![](image.jpg)](image.jpg) {MD045}␊ + ␊ + Multi-line image with alternate text ![Alternate text](image.jpg "Title"␊ + )␊ + ␊ + Multi-line image without alternate text ![](image.jpg "Title"␊ + ) {MD045:28}␊ + ␊ + ␊ + ␊ + Image tag with alt attribute set to text␊ + Descriptive text␊ + ␊ + Image tag with alt attribute not set␊ + {MD045}␊ + ␊ + Image tag with alt attribute set to decorative with an empty double-quote string␊ + ␊ + ␊ + Image tag with alt attribute set to decorative with an empty single-quote string␊ + ␊ + ␊ + Image tag with no alt attribute {MD045}␊ + ␊ + Multi-line image tag with no alt text␊ + {MD045:48}␊ + ␊ + Multi-line image tag with alt attribute not set␊ + {MD045:52}␊ + ␊ + Multi-line image tag with alt text␊ + ␊ + ␊ + Uppercase image tag with alt attribute set␊ + Descriptive text␊ + ␊ + Uppercase image tag with no alt set {MD045}␊ + ␊ +

␊ + {MD045}␊ +

␊ + ␊ + No alt attribute is okay when the image is hidden from assistive technology:␊ + ␊ + ␊ + ␊ + But not when disabled: {MD045}␊ + ␊ + Multi-line image tag aria-hidden:␊ +
␊ + ␊ + ␊ + ␊ + ␊ + ␊ + JavaScript {MD044}␊ + ␊ +
JavaScript
{MD044}␊ + ␊ + ␊ + ␊ + ␊ + ␊ +
␊ + ␊ +
␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + } + +## proper-names-non-word-boundaries.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: .NET; Actual: .net', + errorRange: [ + 6, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 6, + insertText: '.NET', + }, + lineNumber: 9, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: NET.; Actual: net.', + errorRange: [ + 6, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 6, + insertText: 'NET.', + }, + lineNumber: 11, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: .NET.; Actual: .net.', + errorRange: [ + 6, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 6, + insertText: '.NET.', + }, + lineNumber: 13, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + ], + fixed: `# Proper Names Non-Word Boundaries␊ + ␊ + Text .NET text.␊ + ␊ + Text NET. text.␊ + ␊ + Text .NET. text.␊ + ␊ + Text .NET text. {MD044}␊ + ␊ + Text NET. text. {MD044}␊ + ␊ + Text .NET. text. {MD044}␊ + ␊ + ␊ + `, + } + +## proper-names-projects.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: GitHub; Actual: github', + errorRange: [ + 5, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 5, + insertText: 'GitHub', + }, + lineNumber: 5, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Vue; Actual: vue', + errorRange: [ + 5, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 5, + insertText: 'Vue', + }, + lineNumber: 21, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Vue; Actual: vue', + errorRange: [ + 4, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 4, + insertText: 'Vue', + }, + lineNumber: 23, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Vuex; Actual: vuex', + errorRange: [ + 5, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 5, + insertText: 'Vuex', + }, + lineNumber: 29, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: vue-router; Actual: Vue-router', + errorRange: [ + 5, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 5, + insertText: 'vue-router', + }, + lineNumber: 33, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: npm; Actual: Npm', + errorRange: [ + 9, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 9, + insertText: 'npm', + }, + lineNumber: 46, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: npm; Actual: NPM', + errorRange: [ + 4, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 4, + insertText: 'npm', + }, + lineNumber: 47, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + insertText: '*', + }, + lineNumber: 43, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + insertText: '*', + }, + lineNumber: 43, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + insertText: '*', + }, + lineNumber: 43, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 34, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 34, + insertText: '*', + }, + lineNumber: 43, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + ], + fixed: `# Proper Names of Projects (code_blocks:false)␊ + ␊ + The site GitHub␊ + ␊ + Not GitHub {MD044}␊ + ␊ + Link to [GitHub](https://github.com/)␊ + ␊ + Link to [github.com](https://github.com/)␊ + ␊ + Link to [github.com](https://github.com/about)␊ + ␊ + Link to [github.com/about](https://github.com/about)␊ + ␊ + The domain name of GitHub is github.com␊ + ␊ + The project Vue␊ + ␊ + AKA Vue.js␊ + ␊ + Not Vue {MD044}␊ + ␊ + Or Vue.js {MD044}␊ + ␊ + The file \`vue.js\` (code block)␊ + ␊ + The library Vuex␊ + ␊ + Not Vuex {MD044}␊ + ␊ + The library vue-router␊ + ␊ + Not vue-router {MD044}␊ + ␊ + But vue-router-extra is different␊ + ␊ + As is extra-vue-router␊ + ␊ + Quoted "Vue" and "vue-router"␊ + ␊ + Emphasized *Vue* and *vue-router*␊ + ␊ + Underscored *Vue* and *vue-router* {MD049}␊ + ␊ + Call it npm␊ + But not npm {MD044}␊ + Or npm {MD044}␊ + ␊ + ␊ + `, + } + +## proper-names-substrings.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Proper Names as Substrings␊ + ␊ + The proper case is: @aws-control-tower␊ + ␊ + Similarly, aws-vault and AWS and @aws-control-tower are all correct.␊ + ␊ + ␊ + `, + } + +## proper-names-urls.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: HTTPS; Actual: https', + errorRange: [ + 6, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 6, + insertText: 'HTTPS', + }, + lineNumber: 3, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: EXAMPLE; Actual: example', + errorRange: [ + 6, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 6, + insertText: 'EXAMPLE', + }, + lineNumber: 4, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: COM; Actual: com', + errorRange: [ + 6, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 6, + insertText: 'COM', + }, + lineNumber: 5, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: DIRECTORY; Actual: directory', + errorRange: [ + 6, + 9, + ], + fixInfo: { + deleteCount: 9, + editColumn: 6, + insertText: 'DIRECTORY', + }, + lineNumber: 6, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: FILE; Actual: file', + errorRange: [ + 6, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 6, + insertText: 'FILE', + }, + lineNumber: 7, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: FILE; Actual: file', + errorRange: [ + 29, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 29, + insertText: 'FILE', + }, + lineNumber: 55, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + ], + fixed: `# Proper Names in URLs␊ + ␊ + Text HTTPS text {MD044}␊ + Text EXAMPLE text {MD044}␊ + Text COM text {MD044}␊ + Text DIRECTORY text {MD044}␊ + Text FILE text {MD044}␊ + Text HTTPS EXAMPLE COM DIRECTORY FILE text␊ + ␊ + > The following lines are deliberately duplicated␊ + ␊ + Text https://example.com/directory/file text␊ + ␊ + Text https://example.com/directory/file text␊ + ␊ + Text text␊ + ␊ + Text text␊ + ␊ + Text [https://example.com/directory/file](https://example.com/directory/file) text␊ + ␊ + Text [https://example.com/directory/file](https://example.com/directory/file) text␊ + ␊ + Text \`https://example.com/directory/file\` text␊ + Text \`https://example.com/directory/file\` text␊ + ␊ + \`\`\`text␊ + Text https://example.com/directory/file text␊ + Text https://example.com/directory/file text␊ + \`\`\`␊ + ␊ + Text https://example.com/directory/file text␊ + Text https://example.com/directory/file text␊ + ␊ + Text https://example.com/directory/text.file text␊ + Text https://example.com/directory/text.file text␊ + ␊ + Text https://example.com/directory/text%20text.file text␊ + Text https://example.com/directory/text%20text.file text␊ + ␊ + Text text␊ + Text text␊ + ␊ + Text text␊ + Text text␊ + ␊ + Text [https://example.com/directory/text.file](https://example.com/directory/text.file) text␊ + Text [https://example.com/directory/text.file](https://example.com/directory/text.file) text␊ + ␊ + Text [https://example.com/directory/text%20text.file](https://example.com/directory/text%20text.file) text␊ + Text [https://example.com/directory/text%20text.file](https://example.com/directory/text%20text.file) text␊ + ␊ + {MD044:+2}␊ + ␊ + ␊ + `, + } + +## proper-names.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'https://github.com/DavidAnson/...', + errorDetail: null, + errorRange: [ + 17, + 42, + ], + fixInfo: { + deleteCount: 42, + editColumn: 17, + insertText: '', + }, + lineNumber: 69, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: Markdownlint', + errorRange: [ + 1, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 1, + insertText: 'markdownlint', + }, + lineNumber: 3, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: Markdownlint', + errorRange: [ + 9, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 9, + insertText: 'markdownlint', + }, + lineNumber: 5, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: Markdownlint', + errorRange: [ + 13, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 13, + insertText: 'markdownlint', + }, + lineNumber: 7, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: Javascript', + errorRange: [ + 11, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 11, + insertText: 'JavaScript', + }, + lineNumber: 13, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: npm; Actual: NPM', + errorRange: [ + 22, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 22, + insertText: 'npm', + }, + lineNumber: 19, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: npm; Actual: NPM', + errorRange: [ + 27, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 27, + insertText: 'npm', + }, + lineNumber: 27, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: GitHub; Actual: Github', + errorRange: [ + 19, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 19, + insertText: 'GitHub', + }, + lineNumber: 29, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Internet Explorer; Actual: internet explorer', + errorRange: [ + 8, + 17, + ], + fixInfo: { + deleteCount: 17, + editColumn: 8, + insertText: 'Internet Explorer', + }, + lineNumber: 35, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Node.js; Actual: node.js', + errorRange: [ + 4, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 4, + insertText: 'Node.js', + }, + lineNumber: 37, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 10, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 10, + insertText: 'JavaScript', + }, + lineNumber: 39, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Node.js; Actual: node.js', + errorRange: [ + 18, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 18, + insertText: 'Node.js', + }, + lineNumber: 41, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 9, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 9, + insertText: 'JavaScript', + }, + lineNumber: 43, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: npm; Actual: NPM', + errorRange: [ + 7, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 7, + insertText: 'npm', + }, + lineNumber: 45, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: markdownlint; Actual: Markdownlint', + errorRange: [ + 7, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 7, + insertText: 'markdownlint', + }, + lineNumber: 47, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 5, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 5, + insertText: 'JavaScript', + }, + lineNumber: 49, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Node.js; Actual: node.js', + errorRange: [ + 5, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 5, + insertText: 'Node.js', + }, + lineNumber: 50, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 1, + insertText: 'JavaScript', + }, + lineNumber: 53, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Node.js; Actual: node.js', + errorRange: [ + 1, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 1, + insertText: 'Node.js', + }, + lineNumber: 54, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: GitHub; Actual: github', + errorRange: [ + 21, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 21, + insertText: 'GitHub', + }, + lineNumber: 57, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: GitHub; Actual: github', + errorRange: [ + 12, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 12, + insertText: 'GitHub', + }, + lineNumber: 59, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: GitHub; Actual: github', + errorRange: [ + 10, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 10, + insertText: 'GitHub', + }, + lineNumber: 63, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: Node.js; Actual: node.js', + errorRange: [ + 7, + 7, + ], + fixInfo: { + deleteCount: 7, + editColumn: 7, + insertText: 'Node.js', + }, + lineNumber: 72, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 1, + insertText: 'JavaScript', + }, + lineNumber: 73, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 10, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 10, + insertText: 'JavaScript', + }, + lineNumber: 75, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 1, + insertText: 'JavaScript', + }, + lineNumber: 78, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 1, + insertText: 'JavaScript', + }, + lineNumber: 81, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 2, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 2, + insertText: 'JavaScript', + }, + lineNumber: 84, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: multiplecase; Actual: MULTIPLECASE', + errorRange: [ + 18, + 12, + ], + fixInfo: { + deleteCount: 12, + editColumn: 18, + insertText: 'multiplecase', + }, + lineNumber: 89, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 15, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 15, + insertText: 'JavaScript', + }, + lineNumber: 92, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 20, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 20, + insertText: 'JavaScript', + }, + lineNumber: 94, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 1, + insertText: 'JavaScript', + }, + lineNumber: 96, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 24, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 24, + insertText: 'JavaScript', + }, + lineNumber: 99, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 6, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 6, + insertText: 'JavaScript', + }, + lineNumber: 101, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 1, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 1, + insertText: 'JavaScript', + }, + lineNumber: 104, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: HTTPS; Actual: https', + errorRange: [ + 10, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 10, + insertText: 'HTTPS', + }, + lineNumber: 107, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: HTTPS; Actual: https', + errorRange: [ + 15, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 15, + insertText: 'HTTPS', + }, + lineNumber: 109, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: HTTPS; Actual: https', + errorRange: [ + 12, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 12, + insertText: 'HTTPS', + }, + lineNumber: 112, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 3, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 3, + insertText: 'JavaScript', + }, + lineNumber: 116, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: HTTPS; Actual: https', + errorRange: [ + 12, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 12, + insertText: 'HTTPS', + }, + lineNumber: 117, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: JavaScript; Actual: javascript', + errorRange: [ + 3, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 3, + insertText: 'JavaScript', + }, + lineNumber: 118, + ruleDescription: 'Proper names should have the correct capitalization', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md044.md', + ruleNames: [ + 'MD044', + 'proper-names', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: indented; Actual: fenced', + errorRange: null, + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Code block style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md046.md', + ruleNames: [ + 'MD046', + 'code-block-style', + ], + severity: 'error', + }, + ], + fixed: `# markdownlint test file␊ + ␊ + markdownlint is a tool {MD044}␊ + ␊ + Quoted "markdownlint" {MD044}␊ + ␊ + Emphasized *markdownlint* {MD044}␊ + ␊ + JavaScript is a language␊ + ␊ + JavaScript is not Java␊ + ␊ + Nor is it JavaScript. {MD044}␊ + ␊ + markdownlint runs on Node.js via npm␊ + ␊ + Node is an environment␊ + ␊ + Install into it with npm {MD044}␊ + ␊ + Node.JSX is not a real thing␊ + ␊ + Nor is nodesjs or NPMI␊ + ␊ + npm can npm stand npm for npm many npm things␊ + ␊ + Writing npm is right, but npm is wrong {MD044}␊ + ␊ + Get excited about GitHub! {MD044}␊ + ␊ + Share code on GitHub via Git␊ + ␊ + Internet Explorer is a web browser␊ + ␊ + OTOH, "Internet Explorer" is a job {MD044}␊ + ␊ + ## Node.js instructions {MD044}␊ + ␊ + Code in \`JavaScript\` {MD044}␊ + ␊ + Execute \`via the Node.js engine\` {MD044}␊ + ␊ + HTML JavaScript {MD044}␊ + ␊ + * Use npm {MD044}␊ + ␊ + > Run markdownlint on your README {MD044}␊ + ␊ + JavaScript is code {MD044}␊ + Node.js is runtime {MD044}␊ + ␊ + \`\`\`javascript␊ + JavaScript is code {MD044} {MD046:-1}␊ + Node.js is runtime {MD044}␊ + \`\`\`␊ + ␊ + Upload the code (to GitHub) {MD044}␊ + ␊ + Image of ![GitHub](https://github.com/). {MD044}␊ + ␊ + Image of ![GitHub](https://github.com/).␊ + ␊ + Link to [GitHub](https://github.com/). {MD044}␊ + ␊ + Link to [GitHub](https://github.com/).␊ + ␊ + Link to [markdownlint](https://github.com/DavidAnson/MARKDOWNLINT).␊ + ␊ + Bare URL exempt {MD034}␊ + ␊ + A short paragraph␊ + about Node.js and {MD044}␊ + JavaScript. {MD044}␊ + ␊ + {MD044} \`JavaScript\`␊ + ␊ + \`code␊ + JavaScript\` {MD044}␊ + ␊ + \`code␊ + JavaScript {MD044}␊ + code\`␊ + ␊ + \`JavaScript {MD044}␊ + code\`␊ + ␊ + Text referencing multiplecase name.␊ + Text referencing MultipleCase name.␊ + Text referencing multiplecase name. {MD044}␊ + Text referencing mULTIPLEcASE name.␊ + ␊ + Description␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ +
␊ + ␊ + ␊ + ␊ + ␊ + ␊ + {MD044:-14} {MD044:-12} {MD044:-9} {MD044:-4}␊ + ␊ + ␊ + `, + } + +## reference-links-and-images-ignored-labels-empty.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[full][full]', + errorDetail: 'Missing link or image reference definition: "full"', + errorRange: [ + 1, + 12, + ], + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[collapsed][]', + errorDetail: 'Missing link or image reference definition: "collapsed"', + errorRange: [ + 1, + 13, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[shortcut]', + errorDetail: 'Missing link or image reference definition: "shortcut"', + errorRange: [ + 1, + 10, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[invalid][invalid]', + errorDetail: 'Missing link or image reference definition: "invalid"', + errorRange: [ + 1, + 18, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[x]', + errorDetail: 'Missing link or image reference definition: "x"', + errorRange: [ + 3, + 3, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + ], + fixed: `# Reference Links and Images (Ignored Labels Empty)␊ + ␊ + [full][full] {MD052}␊ + ␊ + [collapsed][] {MD052}␊ + ␊ + [shortcut] {MD052}␊ + ␊ + [invalid][invalid] {MD052}␊ + ␊ + - [ ] Unchecked task list item␊ + - [x] Checked task list item {MD052}␊ + ␊ + ␊ + `, + } + +## reference-links-and-images-ignored-labels.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[invalid][invalid]', + errorDetail: 'Missing link or image reference definition: "invalid"', + errorRange: [ + 1, + 18, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[x]', + errorDetail: 'Missing link or image reference definition: "x"', + errorRange: [ + 3, + 3, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + ], + fixed: `# Reference Links and Images (Ignored Labels)␊ + ␊ + [full][full]␊ + ␊ + [collapsed][]␊ + ␊ + [shortcut]␊ + ␊ + [invalid][invalid] {MD052}␊ + ␊ + - [ ] Unchecked task list item␊ + - [x] Checked task list item {MD052}␊ + ␊ + ␊ + `, + } + +## reference-links-and-images-shortcuts.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'https://example.com/footnote', + errorDetail: null, + errorRange: [ + 7, + 28, + ], + fixInfo: { + deleteCount: 28, + editColumn: 7, + insertText: '', + }, + lineNumber: 116, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: '[missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 20, + 9, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 10, + 9, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 26, + 9, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '![missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 10, + 10, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '![missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 26, + 10, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[^2]', + errorDetail: 'Missing link or image reference definition: "^2"', + errorRange: [ + 8, + 4, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + ], + fixed: `# Reference Links and Images (Shortcuts)␊ + ␊ + ## Shortcut Handling␊ + ␊ + Validates the shortcut: [shortcut]␊ + ␊ + [shortcut]: https://example.com/shortcut␊ + ␊ + Missing reference: [missing] {MD052}␊ + ␊ + ## Valid Links␊ + ␊ + Full reference link: [text][label]␊ + ␊ + Collapsed reference link: [label][]␊ + ␊ + Shortcut reference link: [label]␊ + ␊ + Same line: [text][label] [label][] [label]␊ + ␊ + Mixed case: [TEXT][LABEL] [LABEL][] [LABEL]␊ + ␊ + With nested brackets: [t\\[ex\\]t][label]␊ + ␊ + Shortcut inline code span: [\`code\`]␊ + ␊ + Shortcut ending in colon: [colon]:␊ + ␊ + ## Invalid Links␊ + ␊ + Missing: [missing] {MD052}␊ + ␊ + > Missing in blockquote: [missing] {MD052}␊ + ␊ + ## Non-Links␊ + ␊ + Code span: \`[code]\`␊ + ␊ + Escaped left: \\[escaped]␊ + ␊ + Escaped right: [escaped\\]␊ + ␊ + Escaped both: \\[escaped\\]␊ + ␊ + Unmatched [ in text␊ + ␊ + Unmatched ] in text␊ + ␊ + ## Valid Images␊ + ␊ + Full style: ![text][image0]␊ + ␊ + Collapsed style: ![image1][]␊ + ␊ + Shortcut style: ![image2]␊ + ␊ + Image in link: [![text][image3]](link) [![image4][]](link) [![image5]](link)␊ + ␊ + Image in shortcut link: [![text][image6]][unique6] [![image7][]][unique7] [![image8]][unique8]␊ + ␊ + Wrapped in brackets: \\[![text][unique9]\\]␊ + ␊ + Embedded \\[in ![text][unique10] brackets\\]␊ + ␊ + ## Invalid Images␊ + ␊ + Missing: ![missing] {MD052}␊ + ␊ + > Missing in blockquote: ![missing] {MD052}␊ + ␊ + ## Non-Images␊ + ␊ + Escaped left: !\\[escaped]␊ + ␊ + Escaped right: ![escaped\\]␊ + ␊ + Escaped both: !\\[escaped\\]␊ + ␊ + ## Valid Footnotes␊ + ␊ + Footnote[^1]␊ + ␊ + ## Invalid Footnotes␊ + ␊ + Missing[^2] {MD052}␊ + ␊ + ## GitHub Flavored Markdown Task List Items␊ + ␊ + - [ ] Unchecked task list item␊ + - [x] Checked task list item␊ + ␊ + - [x] alpha␊ + - [ ] beta␊ + - [x] charlie␊ + - [ ] delta␊ + ␊ + ## Valid Labels␊ + ␊ + [label]: https://example.com/label␊ + [image0]: https://example.com/image0␊ + [image1]: https://example.com/image1␊ + [image2]: https://example.com/image2␊ + [image3]: https://example.com/image3␊ + [image4]: https://example.com/image4␊ + [image5]: https://example.com/image5␊ + [image6]: https://example.com/image6␊ + [image7]: https://example.com/image7␊ + [image8]: https://example.com/image8␊ + [\`code\`]: https://example.com/code␊ + [colon]: https://example.com/colon␊ + [unique6]: https://example.com/unique6␊ + [unique7]: https://example.com/unique7␊ + [unique8]: https://example.com/unique8␊ + [unique9]: https://example.com/unique9␊ + [unique10]: https://example.com/unique10␊ + [^1]: {MD034}␊ + ␊ + ␊ + `, + } + +## reference-links-and-images.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: 'https://example.com/footnote', + errorDetail: null, + errorRange: [ + 7, + 28, + ], + fixInfo: { + deleteCount: 28, + editColumn: 7, + insertText: '', + }, + lineNumber: 186, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: '[text][missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 16, + 15, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[text][missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 36, + 15, + ], + fixInfo: null, + lineNumber: 74, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[text][missing', + errorDetail: 'Missing link or image reference definition: "missing label"', + errorRange: [ + 35, + 14, + ], + fixInfo: null, + lineNumber: 76, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[text][missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 32, + 15, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '![text][missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 13, + 16, + ], + fixInfo: null, + lineNumber: 125, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '![text][missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 17, + 16, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[![text][image]][missing]', + errorDetail: 'Missing link or image reference definition: "missing"', + errorRange: [ + 21, + 25, + ], + fixInfo: null, + lineNumber: 222, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[hidden][]', + errorDetail: 'Missing link or image reference definition: "hidden"', + errorRange: [ + 19, + 10, + ], + fixInfo: null, + lineNumber: 236, + ruleDescription: 'Reference links and images should use a label that is defined', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md052.md', + ruleNames: [ + 'MD052', + 'reference-links-images', + ], + severity: 'error', + }, + { + errorContext: '[label]: {MD053}', + errorDetail: 'Duplicate link or image reference definition: "label"', + errorRange: [ + 1, + 16, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 198, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + { + errorContext: '[unused]: {MD053}', + errorDetail: 'Unused link or image reference definition: "unused"', + errorRange: [ + 1, + 17, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 200, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + { + errorContext: '[^3]: {MD053}', + errorDetail: 'Unused link or image reference definition: "^3"', + errorRange: [ + 1, + 13, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 202, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + { + errorContext: '[Duplicate unused multi-line l...', + errorDetail: 'Unused link or image reference definition: "duplicate unused multi-line label {md053}"', + errorRange: [ + 1, + 44, + ], + fixInfo: null, + lineNumber: 206, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + { + errorContext: '[Duplicate unused multi-line l...', + errorDetail: 'Duplicate link or image reference definition: "duplicate unused multi-line label {md053}"', + errorRange: [ + 1, + 44, + ], + fixInfo: null, + lineNumber: 209, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + ], + fixed: `# Reference Links and Images␊ + ␊ + ## Valid Links␊ + ␊ + Full reference link: [text][label]␊ + ␊ + Collapsed reference link: [label][]␊ + ␊ + Shortcut reference link: [label]␊ + ␊ + Same line: [text][label] [label][] [label]␊ + ␊ + Mixed case: [TEXT][LABEL] [LABEL][] [LABEL]␊ + ␊ + With spaces: [text][label with spaces] [text][ label with spaces ]␊ + ␊ + With nested brackets: [t[ex]t][label]␊ + ␊ + With inline content: [*text*][label]␊ + ␊ + With inline code span: [\`code\`][label]␊ + ␊ + Shortcut inline code span: [\`code\`]␊ + ␊ + Multi-line full text: [multi␊ + line][multi line full text]␊ + ␊ + Multi-line full label: [text][multi␊ + line full label]␊ + ␊ + Multi-line collapsed label: [multi␊ + line collapsed label][]␊ + ␊ + Multi-line shortcut label: [multi line␊ + shortcut label]␊ + ␊ + > Multi-line full text: [multi␊ + > line][blockquote multi line full text]␊ + >␊ + > Multi-line full label: [text][blockquote multi␊ + > line full label]␊ + >␊ + > Multi-line collapsed label: [blockquote multi␊ + > line collapsed label][]␊ + >␊ + > Multi-line shortcut label: [blockquote multi line␊ + > shortcut label]␊ + >␊ + > > Multi-line shortcut label: [blockquote blockquote␊ + > > multi line shortcut label]␊ + ␊ + Dedicated line:␊ + [text][label]␊ + ␊ + Dedicated line with trailing colon:␊ + [text][label]:␊ + ␊ + Shortcut ending in colon: [colon]:␊ + ␊ + Use of multi-line label: [multi-line-label][]␊ + ␊ + Use of link in label: [link-in-label][]␊ + ␊ + Standard link: [text](https://example.com/standard)␊ + ␊ + Wrapped in brackets: [[text][unique0]] [[unique1][]] [[unique2]]␊ + ␊ + [Embedded [text][unique3] in [unique4][] brackets [unique5]]␊ + ␊ + ## Invalid Links␊ + ␊ + Missing label: [text][missing] {MD052}␊ + ␊ + Mixed valid/invalid: [text][label] [text][missing] {MD052}␊ + ␊ + Missing multi-line label {MD052}: [text][missing␊ + label]␊ + ␊ + > Missing label in blockquote: [text][missing] {MD052}␊ + ␊ + ## Non-Links␊ + ␊ + Space: [text] [wrong]␊ + ␊ + Empty: [text][ ]␊ + ␊ + Code span: \`[wrong]\`␊ + ␊ + Code span: \`[wrong][]\`␊ + ␊ + Code span: \`[text][wrong]\`␊ + ␊ + Code span: \`[[wrong]]\`␊ + ␊ + Code span: \`[[wrong][]]\`␊ + ␊ + Code span: \`[[text][wrong]]\`␊ + ␊ + Escaped left text: \\[text][wrong]␊ + ␊ + Escaped right text: [text\\][wrong]␊ + ␊ + Escaped left label: [text]\\[wrong]␊ + ␊ + Escaped right label: [text][wrong\\]␊ + ␊ + ## Valid Images␊ + ␊ + Full style: ![text][image0]␊ + ␊ + Collapsed style: ![image1][]␊ + ␊ + Shortcut style: ![image2]␊ + ␊ + Image in link: [![text][image3]](link) [![image4][]](link) [![image5]](link)␊ + ␊ + Image in shortcut link: [![text][image6]][unique6] [![image7][]][unique7] [![image8]][unique8]␊ + ␊ + Wrapped in brackets: [![text][unique9]]␊ + ␊ + Embedded [in ![text][unique10] brackets]␊ + ␊ + ## Invalid Images␊ + ␊ + Image only: ![text][missing] {MD052}␊ + ␊ + Image in link: [![text][missing]][label] {MD052}␊ + ␊ + ## Non-Images␊ + ␊ + Escaped left text: !\\[text][wrong]␊ + ␊ + Escaped right text: ![text\\][wrong]␊ + ␊ + Escaped left label: ![text]\\[wrong]␊ + ␊ + Escaped right label: ![text][wrong\\]␊ + ␊ + ## Valid Footnotes␊ + ␊ + Footnote[^1]␊ + ␊ + ## Invalid Footnotes␊ + ␊ + Missing[^2]␊ + ␊ + ## Valid Labels␊ + ␊ + [label]: https://example.com/label␊ + [ label with spaces ]: https://example.com/label-with-spaces␊ + [image]:https://example.com/image␊ + [image0]: https://example.com/image0␊ + [image1]: https://example.com/image1␊ + [image2]: https://example.com/image2␊ + [image3]: https://example.com/image3␊ + [image4]: https://example.com/image4␊ + [image5]: https://example.com/image5␊ + [image6]: https://example.com/image6␊ + [image7]: https://example.com/image7␊ + [image8]: https://example.com/image8␊ + [\`code\`]: https://example.com/code␊ + [multi line full text]: https://example.com/multi-line-full-text␊ + [multi line full label]: https://example.com/multi-line-full-label␊ + [multi line collapsed label]: https://example.com/multi-line-collapsed-label␊ + [multi line shortcut label]: https://example.com/multi-line-shortcut-label␊ + [blockquote multi line full text]: https://example.com/blockquote-multi-line-full-text␊ + [blockquote multi line full label]: https://example.com/blockquote-multi-line-full-label␊ + [blockquote multi line collapsed label]: https://example.com/blockquote-multi-line-collapsed-label␊ + [blockquote multi line shortcut label]: https://example.com/blockquote-multi-line-shortcut-label␊ + [blockquote blockquote multi line shortcut label]: https://example.com/blockquote-blockquote-multi-line-shortcut-label␊ + [colon]: https://example.com/colon␊ + [multi-line-label]:␊ + https://example.com/multi-line-label␊ + [link-in-label]: https://example.com/path?[brackets][]␊ + [unique0]: https://example.com/unique0␊ + [unique1]: https://example.com/unique1␊ + [unique2]: https://example.com/unique2␊ + [unique3]: https://example.com/unique3␊ + [unique4]: https://example.com/unique4␊ + [unique5]: https://example.com/unique5␊ + [unique6]: https://example.com/unique6␊ + [unique7]: https://example.com/unique7␊ + [unique8]: https://example.com/unique8␊ + [unique9]: https://example.com/unique9␊ + [unique10]: https://example.com/unique10␊ + [^1]: {MD034}␊ + ␊ + ## Ignored Labels␊ + ␊ + [//]: # (This is a technique for putting comments in Markdown)␊ + ␊ + [//]: <> (Here is another variant)␊ + ␊ + ## Invalid Labels␊ + ␊ + Duplicate/unused:␊ + ␊ + [blank-line-filler-0]: https://example.com␊ + [blank-line-filler-1]: https://example.com␊ + ␊ + [blank-line-filler-0][] [blank-line-filler-1][]␊ + ␊ + [Duplicate unused multi-line label {MD053}]:␊ + https://example.com/duplicate-unused-multi-line-label␊ + ␊ + [Duplicate unused multi-line label {MD053}]:␊ + https://example.com/duplicate-unused-multi-line-label␊ + ␊ + \\[Escaped left]: text␊ + ␊ + [Escaped right\\]: text␊ + ␊ + ## Valid Links and Images after Labels␊ + ␊ + Link and image: [text][label] [![text][image]][label]␊ + ␊ + ## More Invalid Links and Images after Labels␊ + ␊ + Bad link with image [![text][image]][missing] {MD052}␊ + ␊ + ## Shortcut One-Way Handling␊ + ␊ + Validates the label: [shortcut]␊ + ␊ + [shortcut]: https://example.com/shortcut␊ + ␊ + Not flagged due to ambiguity: [ignored]␊ + ␊ + ## Open Bracket Pairs␊ + ␊ + Unmatched [ in text␊ + ␊ + Hidden reference: [hidden][] {MD052}␊ + ␊ + ## Link references inside reference definitions␊ + ␊ + Text with a [^footnote] in it␊ + ␊ + [^footnote]: Footnote with an [embedded-reference][] in it␊ + ␊ + [embedded-reference]: https://example.com/embedded-reference␊ + ␊ + ## GitHub Flavored Markdown Task List Items␊ + ␊ + - [ ] Unchecked task list item␊ + - [x] Checked task list item␊ + `, + } + +## reference-links-ignored-definitions-empty.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[oops]: https://example.com/{M...', + errorDetail: 'Unused link or image reference definition: "oops"', + errorRange: [ + 1, + 35, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 6, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + { + errorContext: '[//]: <> ({MD053})', + errorDetail: 'Unused link or image reference definition: "//"', + errorRange: [ + 1, + 18, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 7, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + ], + fixed: `# Reference Links Ignored Definitions (Empty)␊ + ␊ + Used reference link: [label]␊ + ␊ + [label]: https://example.com/label␊ + ␊ + ␊ + `, + } + +## reference-links-ignored-definitions.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[oops]: https://example.com/{M...', + errorDetail: 'Unused link or image reference definition: "oops"', + errorRange: [ + 1, + 35, + ], + fixInfo: { + deleteCount: -1, + }, + lineNumber: 6, + ruleDescription: 'Link and image reference definitions should be needed', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md053.md', + ruleNames: [ + 'MD053', + 'link-image-reference-definitions', + ], + severity: 'error', + }, + ], + fixed: `# Reference Links Ignored Definitions␊ + ␊ + Used reference link: [label]␊ + ␊ + [label]: https://example.com/label␊ + [okay]: https://example.com/ignored␊ + [yep]: https://example.com/ignored␊ + ␊ + ␊ + `, + } + +## required-headings-all-optional-at-least-one.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + #### four␊ + ␊ + ##### Five␊ + ␊ + ###### SiX␊ + ␊ + ␊ + `, + } + +## required-headings-all-optional.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + #### four␊ + ␊ + ##### Five␊ + ␊ + ###### SiX␊ + ␊ + ␊ + `, + } + +## required-headings-all-present.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + ## four␊ + ␊ + ## Five␊ + ␊ + ### SiX␊ + ␊ + ␊ + `, + } + +## required-headings-match-case.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Title␊ + ␊ + ## First Heading␊ + ␊ + ## Second Heading␊ + ␊ + ### Random heading␊ + ␊ + ## Third Heading␊ + ␊ + ␊ + `, + } + +## required-headings-missing-first.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: # One; Actual: ## Two {MD043}', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `text␊ + ␊ + ## Two {MD043}␊ + ␊ + ### Three␊ + ␊ + ␊ + `, + } + +## required-headings-missing-last-zero-or-more.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '### Five', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + ## four␊ + ␊ + ## Five␊ + ␊ + ### SiX␊ + ␊ + #### FOO␊ + ␊ + {MD043:30}␊ + ␊ + ␊ + `, + } + +## required-headings-missing-last.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '### Three', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + editColumn: 16, + insertText: `␊ + `, + }, + lineNumber: 17, + ruleDescription: 'Files should end with a single newline character', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', + ruleNames: [ + 'MD047', + 'single-trailing-newline', + ], + severity: 'error', + }, + ], + fixed: `One␊ + ===␊ + ␊ + Two␊ + ---␊ + ␊ + ␊ + ␊ + {MD043} {MD047}␊ + `, + } + +## required-headings-missing-middle-zero-or-more.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '### FOO', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + ## four␊ + ␊ + ## Five␊ + ␊ + ### SiX␊ + ␊ + #### 7␊ + ␊ + {MD043:30}␊ + ␊ + ␊ + `, + } + +## required-headings-missing-middle.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: h2; Actual: h3', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Heading levels should only increment by one level at a time', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md', + ruleNames: [ + 'MD001', + 'heading-increment', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: ## Two; Actual: ### Three {MD001} {MD043}', + errorRange: null, + fixInfo: null, + lineNumber: 3, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# One #␊ + ␊ + ### Three {MD001} {MD043} ###␊ + ␊ + #### Four ####␊ + ␊ + ␊ + `, + } + +## required-headings-none-one-or-more.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '+', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `Text␊ + ␊ + Text␊ + ␊ + {MD043:15}␊ + ␊ + ␊ + `, + } + +## required-headings-none-zero-or-more.md + +> Snapshot 1 + + { + errors: [], + fixed: `Text␊ + ␊ + Text␊ + ␊ + Text␊ + ␊ + ␊ + `, + } + +## required-headings-none.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: [None]; Actual: # One {MD043}', + errorRange: null, + fixInfo: null, + lineNumber: 1, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# One {MD043}␊ + ␊ + ## Two␊ + ␊ + ### Three␊ + ␊ + ␊ + `, + } + +## required-headings-one-or-more.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '#### 7', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + ## four␊ + ␊ + ## Five␊ + ␊ + ### SiX␊ + ␊ + #### 7␊ + ␊ + {MD043:30}␊ + ␊ + ␊ + `, + } + +## required-headings-optional-first.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### Three␊ + ␊ + #### Four␊ + ␊ + ␊ + `, + } + +## required-headings-optional-last.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### Three␊ + ␊ + #### Four␊ + ␊ + ␊ + `, + } + +## required-headings-optional-middle.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One #␊ + ␊ + ## Two ##␊ + ␊ + ### Three ###␊ + ␊ + #### Four ####␊ + ␊ + ##### Five #####␊ + ␊ + ␊ + `, + } + +## required-headings-optional-redundant.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### Three␊ + ␊ + #### Four␊ + ␊ + ␊ + `, + } + +## required-headings-question-extra.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '?', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# Project Name␊ + ␊ + ## Description␊ + ␊ + ␊ + ␊ + {MD043:+1}␊ + `, + } + +## required-headings-question-first.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Project Name␊ + ␊ + ## Description␊ + ␊ + ## Examples␊ + ␊ + ␊ + `, + } + +## required-headings-question-last.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Project Name␊ + ␊ + ## Description␊ + ␊ + ## Examples␊ + ␊ + ␊ + `, + } + +## required-headings-question-middle.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Project Name␊ + ␊ + ## Description␊ + ␊ + ## Examples␊ + ␊ + ␊ + `, + } + +## required-headings-question-missing.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '## Examples', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# Project Name␊ + ␊ + ## Examples␊ + ␊ + ␊ + ␊ + {MD043:+1}␊ + `, + } + +## required-headings-wrong-match-case.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: ## Second Heading; Actual: ## SECOND HEADING', + errorRange: null, + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Required heading structure', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md043.md', + ruleNames: [ + 'MD043', + 'required-headings', + ], + severity: 'error', + }, + ], + fixed: `# Title␊ + ␊ + ## First Heading␊ + ␊ + ## SECOND HEADING␊ + ␊ + {MD043:5}␊ + ␊ + ### Random heading␊ + ␊ + ## Third Heading␊ + ␊ + ␊ + `, + } + +## required-headings-zero-or-more-last.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + ␊ + `, + } + +## required-headings-zero-or-more.md + +> Snapshot 1 + + { + errors: [], + fixed: `# One␊ + ␊ + ## Two␊ + ␊ + ### THREE␊ + ␊ + ## four␊ + ␊ + ## Five␊ + ␊ + ### SiX␊ + ␊ + #### 7␊ + ␊ + ␊ + `, + } + +## reversed-link-issue-with-markdownlint-12.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: '(?<1>\\[^"\'\\]*)["\']', + errorRange: [ + 12, + 18, + ], + fixInfo: { + deleteCount: 18, + editColumn: 12, + insertText: '[?<1>\\[^"\'\\]*]("\')', + }, + lineNumber: 5, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3; Too many cells, extra data will be missing', + errorRange: [ + 42, + 16, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + ], + fixed: `# reversed-link-issue-with-markdownlint-12␊ + ␊ + |Pattern|Description|␊ + |-------------|-----------------|␊ + |\`(?:\\["'\\][?<1>\\[^"'\\]*]("')|(?<1>\\S+))\`|{MD011}{MD056}|␊ + ␊ + |Pattern|Description|␊ + |-------------|-----------------|␊ + |\`(?:\\["'\\](?<1>\\[^"'\\]*)["']\\|(?<1>\\S+))\`|...|␊ + `, + } + +## reversed_link.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: '(this website)[https://www.example.com]', + errorRange: [ + 7, + 39, + ], + fixInfo: { + deleteCount: 39, + editColumn: 7, + insertText: '[this website](https://www.example.com)', + }, + lineNumber: 5, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(issues)[https://www.example.com/one]', + errorRange: [ + 5, + 37, + ], + fixInfo: { + deleteCount: 37, + editColumn: 5, + insertText: '[issues](https://www.example.com/one)', + }, + lineNumber: 21, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(same text)[https://www.example.com/two]', + errorRange: [ + 5, + 40, + ], + fixInfo: { + deleteCount: 40, + editColumn: 5, + insertText: '[same text](https://www.example.com/two)', + }, + lineNumber: 22, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(issues)[https://www.example.com/three]', + errorRange: [ + 5, + 39, + ], + fixInfo: { + deleteCount: 39, + editColumn: 5, + insertText: '[issues](https://www.example.com/three)', + }, + lineNumber: 24, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(same line)[https://www.example.com/four]', + errorRange: [ + 52, + 41, + ], + fixInfo: { + deleteCount: 41, + editColumn: 52, + insertText: '[same line](https://www.example.com/four)', + }, + lineNumber: 24, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(reversed)[link]', + errorRange: [ + 1, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 1, + insertText: '[reversed](link)', + }, + lineNumber: 28, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(reversed)[link]', + errorRange: [ + 6, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 6, + insertText: '[reversed](link)', + }, + lineNumber: 35, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '([a-zA-Z]|\\\\.[a-zA-Z.])[a-zA-Z0-9._]', + errorRange: [ + 17, + 36, + ], + fixInfo: { + deleteCount: 36, + editColumn: 17, + insertText: '[[a-zA-Z]|\\\\.[a-zA-Z.]](a-zA-Z0-9._)', + }, + lineNumber: 39, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '([\\/.])[\\w\\-.\\/=]', + errorRange: [ + 12, + 17, + ], + fixInfo: { + deleteCount: 17, + editColumn: 12, + insertText: '[[\\/.]](\\w\\-.\\/=)', + }, + lineNumber: 41, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(^|\\/)[!.]', + errorRange: [ + 15, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 15, + insertText: '[^|\\/](!.)', + }, + lineNumber: 45, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(xxx)[xxx]', + errorRange: [ + 4, + 10, + ], + fixInfo: { + deleteCount: 10, + editColumn: 4, + insertText: '[xxx](xxx)', + }, + lineNumber: 57, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(reversed)[link]', + errorRange: [ + 6, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 6, + insertText: '[reversed](link)', + }, + lineNumber: 73, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(reversed)[link]', + errorRange: [ + 28, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 28, + insertText: '[reversed](link)', + }, + lineNumber: 73, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: '(reversed)[link]', + errorRange: [ + 11, + 16, + ], + fixInfo: { + deleteCount: 16, + editColumn: 11, + insertText: '[reversed](link)', + }, + lineNumber: 79, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + ], + fixed: `# reversed_link␊ + ␊ + Go to [this website](https://www.example.com)␊ + ␊ + Go to [this website](https://www.example.com) {MD011}␊ + ␊ + Go to (this)[website](https://www.example.com)␊ + ␊ + However, this shouldn't trigger inside code blocks:␊ + ␊ + myObj.getFiles("test")[0]␊ + ␊ + Nor code fences:␊ + ␊ + \`\`\`js␊ + myObj.getFiles(test)[0];␊ + \`\`\`␊ + ␊ + Nor inline code: \`myobj.getFiles("test")[0]\`␊ + ␊ + Two [issues](https://www.example.com/one) in {MD011}␊ + the [same text](https://www.example.com/two). {MD011}␊ + ␊ + Two [issues](https://www.example.com/three) on the [same line](https://www.example.com/four). {MD011}␊ + ␊ + \`code code␊ + code\`␊ + [reversed](link) {MD011}␊ + ␊ + text␊ + text \`code␊ + code code␊ + code\` text␊ + text␊ + text [reversed](link) text {MD011}␊ + ␊ + ## Escaped JavaScript Content␊ + ␊ + var IDENT_RE = '[[a-zA-Z]|\\\\.[a-zA-Z.]](a-zA-Z0-9._)*'; {MD011}␊ + ␊ + begin: /\\B([[\\/.]](\\w\\-.\\/=)+)+/, {MD011}␊ + ␊ + {begin: '%r\\\\(', end: '\\\\)[a-z]*'}␊ + ␊ + return /(?:(?:[^|\\/](!.))|[*?+()|\\[\\]{}]|[+@]\\()/.test(str); {MD011}␊ + ␊ + ## Escaped Parens␊ + ␊ + (reversed)[link]␊ + ␊ + a ) a ( a )[a]~␊ + ␊ + a
) a ( a )[a]~
␊ + ␊ + ## Backslash Escapes␊ + ␊ + xxx[xxx](xxx) {MD011}␊ + ␊ + xxx\\(xxx)[xxx]␊ + ␊ + xxx(xxx\\)[xxx]␊ + ␊ + xxx(xxx)\\[xxx]␊ + ␊ + xxx(xxx)[xxx\\]␊ + ␊ + ## Consecutive Links␊ + ␊ + text [link](destination) text [link](destination) text␊ + text [link](destination)[link](destination) text␊ + text [link](destination)[link](destination)[link](destination) text␊ + ␊ + text [reversed](link) text [reversed](link) text {MD011}␊ + ␊ + ## Nested Parens␊ + ␊ + Text (text \`func()[index]\`) text␊ + ␊ + Text (text[reversed](link) text {MD011}␊ + ␊ + ## Empty Content␊ + ␊ + Text ()[text] text␊ + ␊ + Text (text()[text] text␊ + ␊ + ␊ + `, + } + +## short-headings.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '#A', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + editColumn: 2, + insertText: ' ', + }, + lineNumber: 5, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '##G', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + editColumn: 3, + insertText: ' ', + }, + lineNumber: 25, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '#MM', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + editColumn: 2, + insertText: ' ', + }, + lineNumber: 45, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '##SS', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + editColumn: 3, + insertText: ' ', + }, + lineNumber: 65, + ruleDescription: 'No space after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md', + ruleNames: [ + 'MD018', + 'no-missing-space-atx', + ], + severity: 'error', + }, + { + errorContext: '# C', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 11, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## I', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 31, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '# OO', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 51, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '## UU', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 71, + ruleDescription: 'Multiple spaces after hash on atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md', + ruleNames: [ + 'MD019', + 'no-multiple-space-atx', + ], + severity: 'error', + }, + { + errorContext: '#D#', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + insertText: '# D #', + }, + lineNumber: 15, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '##J##', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 5, + editColumn: 1, + insertText: '## J ##', + }, + lineNumber: 35, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '#PP#', + errorDetail: null, + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 4, + editColumn: 1, + insertText: '# PP #', + }, + lineNumber: 55, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '##VV##', + errorDetail: null, + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + insertText: '## VV ##', + }, + lineNumber: 75, + ruleDescription: 'No space inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md', + ruleNames: [ + 'MD020', + 'no-missing-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '# F #', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 21, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '# F #', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 21, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## L ##', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 41, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## L ##', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 41, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '# RR #', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 61, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '# RR #', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 61, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## XX ##', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 81, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + { + errorContext: '## XX ##', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 81, + ruleDescription: 'Multiple spaces inside hashes on closed atx style heading', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md', + ruleNames: [ + 'MD021', + 'no-multiple-space-closed-atx', + ], + severity: 'error', + }, + ], + fixed: `# Short Headings␊ + ␊ + ␊ + ␊ + # A␊ + ␊ + {MD018:5}␊ + ␊ + # B␊ + ␊ + # C␊ + ␊ + {MD019:11}␊ + ␊ + # D #␊ + ␊ + {MD020:15}␊ + ␊ + # E #␊ + ␊ + # F #␊ + ␊ + {MD021:21}␊ + ␊ + ## G␊ + ␊ + {MD018:25}␊ + ␊ + ## H␊ + ␊ + ## I␊ + ␊ + {MD019:31}␊ + ␊ + ## J ##␊ + ␊ + {MD020:35}␊ + ␊ + ## K ##␊ + ␊ + ## L ##␊ + ␊ + {MD021:41}␊ + ␊ + # MM␊ + ␊ + {MD018:45}␊ + ␊ + # NN␊ + ␊ + # OO␊ + ␊ + {MD019:51}␊ + ␊ + # PP #␊ + ␊ + {MD020:55}␊ + ␊ + # QQ #␊ + ␊ + # RR #␊ + ␊ + {MD021:61}␊ + ␊ + ## SS␊ + ␊ + {MD018:65}␊ + ␊ + ## TT␊ + ␊ + ## UU␊ + ␊ + {MD019:71}␊ + ␊ + ## VV ##␊ + ␊ + {MD020:75}␊ + ␊ + ## WW ##␊ + ␊ + ## XX ##␊ + ␊ + {MD021:81}␊ + `, + } + +## simple-table.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + | Head |␊ + | ---- |␊ + | Cell |␊ + | ==== |␊ + | Foot |␊ + `, + } + +## spaces-inside-emphasis-markers-multiple-lines.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 36, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 40, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 42, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 48, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 49, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 51, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 16, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 16, + }, + lineNumber: 51, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 51, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 52, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + }, + lineNumber: 52, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 22, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 22, + }, + lineNumber: 52, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 55, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 57, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 61, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 64, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 65, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 66, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 69, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 69, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 71, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 72, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** b', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 74, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'd **', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 75, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '*', + }, + lineNumber: 103, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + insertText: '*', + }, + lineNumber: 103, + ruleDescription: 'Emphasis style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md049.md', + ruleNames: [ + 'MD049', + 'emphasis-style', + ], + severity: 'error', + }, + ], + fixed: `# Space Inside Emphasis Markers, Multiple Lines␊ + ␊ + Text *emphasis␊ + emphasis* text␊ + ␊ + Text *emphasis* *emphasis␊ + emphasis* *emphasis* text␊ + ␊ + Text *emphasis* text *emphasis␊ + emphasis* text *emphasis* text␊ + ␊ + Text *emphasis* *emphasis␊ + emphasis* *emphasis* *emphasis␊ + emphasis* text *emphasis␊ + emphasis* text *emphasis* text␊ + ␊ + Text text␊ + text *emphasis␊ + emphasis emphasis␊ + emphasis* text␊ + text text␊ + ␊ + Text * asterisk␊ + ␊ + Text * asterisk␊ + ␊ + * Item *emphasis* item␊ + * Item *emphasis* item␊ + * Item *emphasis␊ + emphasis* item␊ + * Item *emphasis* item␊ + ␊ + * Item * asterisk␊ + * Item * asterisk␊ + ␊ + Text *emphasis {MD037}␊ + emphasis* text␊ + ␊ + Text *emphasis␊ + emphasis* text {MD037}␊ + ␊ + Text *emphasis {MD037}␊ + emphasis* text {MD037}␊ + ␊ + Text *emphasis * *emphasis␊ + emphasis* * emphasis* text␊ + ␊ + Text *emphasis* *emphasis {MD037}␊ + emphasis* *emphasis* text {MD037}␊ + ␊ + Text *emphasis* *emphasis {MD037}␊ + emphasis* *emphasis* text {MD037}␊ + ␊ + Text text␊ + text *emphasis {MD037}␊ + emphasis emphasis␊ + emphasis* text {MD037}␊ + text text␊ + ␊ + * Item *emphasis* item␊ + * Item *emphasis {MD037}␊ + emphasis* item␊ + * Item *emphasis␊ + emphasis* item {MD037}␊ + * Item *emphasis {MD037}␊ + emphasis* item {MD037}␊ + * Item *emphasis* item␊ + * Item item item␊ + item *emphasis* item {MD037}␊ + ␊ + Text *emphasis {MD037}␊ + emphasis* text {MD037}␊ + ␊ + Text **bold {MD037}␊ + bold** text {MD037}␊ + ␊ + Emphasis \`inside␊ + of * code *␊ + blocks\` is okay.␊ + ␊ + Emphasis \`* inside\`␊ + code␊ + \`blocks *\` is okay.␊ + ␊ + Emphasis \`inside *\`␊ + code␊ + \`* blocks\` is okay.␊ + ␊ + Emphasis \`inside␊ + _ code _␊ + blocks\` is okay.␊ + ␊ + Emphasis \`_ inside\`␊ + code␊ + \`blocks _\` is okay.␊ + ␊ + Emphasis \`inside _\`␊ + code␊ + \`_ blocks\` is okay.␊ + ␊ + Mixed \`code_span\`␊ + scenarios␊ + are *also* okay. {MD049}␊ + ␊ + Mixed \`code*span\`␊ + scenarios␊ + are *also* okay.␊ + ␊ + This paragraph␊ + contains *a* mix␊ + of \`*\` emphasis␊ + scenarios and *should*␊ + not trigger \`*\` any␊ + violations at *all*.␊ + ␊ + This paragraph␊ + contains \`a * slightly␊ + more complicated␊ + multi-line emphasis␊ + scenario * that␊ + should * not trigger␊ + violations * either\`.␊ + ␊ + ␊ + *text␊ + \`\`\`text␊ + \`\`\`␊ + text *␊ + ␊ + `, + } + +## spaces-inside-link-text.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 3, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ "link" ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ "link" ]', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ `link` ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 7, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ `link` ]', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 7, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ *link* ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 9, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ *link* ]', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 9, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ __link__ ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 11, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ __link__ ]', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 11, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link "link" ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 13, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link "link" ]', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 13, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link `link` ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link `link` ]', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 15, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ *link* link ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ *link* link ]', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + ], + fixed: `# Spaces Inside Link Text␊ + ␊ + [link](https://example.com/) {MD039}␊ + ␊ + ["link"](https://example.com/) {MD039}␊ + ␊ + [\`link\`](https://example.com/) {MD039}␊ + ␊ + [*link*](https://example.com/) {MD039}␊ + ␊ + [__link__](https://example.com/) {MD039}␊ + ␊ + [link "link"](https://example.com/) {MD039}␊ + ␊ + [link \`link\`](https://example.com/) {MD039}␊ + ␊ + [*link* link](https://example.com/) {MD039}␊ + ␊ + `, + } + +## spaces_after_list_marker.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 11, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 12, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 3', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 3, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 13, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 1', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 17, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 1', + errorRange: [ + 5, + 2, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + insertText: ' ', + }, + lineNumber: 18, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 2', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 2, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 37, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 4', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 4, + editColumn: 2, + insertText: ' ', + }, + lineNumber: 41, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 59, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 60, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2', + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 61, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 65, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 67, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: ' ', + }, + lineNumber: 68, + ruleDescription: 'Spaces after list markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md030.md', + ruleNames: [ + 'MD030', + 'list-marker-space', + ], + severity: 'error', + }, + ], + fixed: `# spaces_after_list_marker␊ + ␊ + Normal list␊ + ␊ + * Foo␊ + * Bar␊ + * Baz␊ + ␊ + List with incorrect spacing␊ + ␊ + * Foo {MD030}␊ + * Bar {MD030}␊ + * Baz {MD030}␊ + ␊ + List with children:␊ + ␊ + * Foo {MD030}␊ + * Bar {MD030}␊ + * Baz␊ + ␊ + List with children and correct spacing:␊ + ␊ + * Foo␊ + * Bar␊ + * Baz (This sublist has no children)␊ + ␊ + List with Multiple paragraphs and correct spacing␊ + ␊ + * Foo␊ + ␊ + Here is the second paragraph␊ + ␊ + * All items in the list need the same indent␊ + ␊ + List with multiple paragraphs and incorrect spacing␊ + ␊ + * Foo {MD030}␊ + ␊ + Here is the second paragraph␊ + ␊ + * Bar {MD030}␊ + ␊ + List with code blocks:␊ + ␊ + * Foo␊ + ␊ + Here is some code␊ + ␊ + * Bar␊ + ␊ + Ordered lists:␊ + ␊ + 1. Foo␊ + 1. Bar␊ + 1. Baz␊ + ␊ + And with incorrect spacing:␊ + ␊ + 1. Foo {MD030}␊ + 1. Bar {MD030}␊ + 1. Baz {MD030}␊ + ␊ + Ordered lists with children:␊ + ␊ + 1. Foo {MD030}␊ + * Hi␊ + 1. Bar {MD030}␊ + 1. Baz {MD030}␊ + ␊ + Ordered lists with children (correct spacing), and with something other than␊ + the first item determining that the entire list has children:␊ + ␊ + 1. Foo␊ + 1. Bar␊ + * Hi␊ + 1. Baz␊ + ␊ + ␊ + `, + } + +## spaces_inside_codespan_elements.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: '` codespan element with space ...', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 5, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '...ment with space inside right `', + errorDetail: null, + errorRange: [ + 42, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 42, + }, + lineNumber: 7, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` code``', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``code ``', + errorDetail: null, + errorRange: [ + 12, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 12, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`` code``', + errorDetail: null, + errorRange: [ + 24, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 24, + }, + lineNumber: 39, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``code ``', + errorDetail: null, + errorRange: [ + 28, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 28, + }, + lineNumber: 41, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``` ` multiple leading spaces...', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 65, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '...iling spaces not allowed ` ``', + errorDetail: null, + errorRange: [ + 42, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 42, + }, + lineNumber: 69, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`link) text `', + errorDetail: null, + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 83, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`link) text `', + errorDetail: null, + errorRange: [ + 34, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 34, + }, + lineNumber: 95, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code`', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 103, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '`code `', + errorDetail: null, + errorRange: [ + 33, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 33, + }, + lineNumber: 105, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code `', + errorDetail: null, + errorRange: [ + 38, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 38, + }, + lineNumber: 114, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code `', + errorDetail: null, + errorRange: [ + 43, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 43, + }, + lineNumber: 116, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code `', + errorDetail: null, + errorRange: [ + 31, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 31, + }, + lineNumber: 118, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '` code `', + errorDetail: null, + errorRange: [ + 37, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 37, + }, + lineNumber: 118, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``` ` multiple leading {MD038...', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 132, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '...iling spaces not allowed ` ``', + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + }, + lineNumber: 139, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``` Code {MD038} ```', + errorDetail: null, + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 1, + }, + lineNumber: 153, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '``` Code {MD038} ```', + errorDetail: null, + errorRange: [ + 1, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 1, + }, + lineNumber: 163, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '[link](#link`link)', + errorDetail: null, + errorRange: [ + 6, + 18, + ], + fixInfo: null, + lineNumber: 81, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[link](#link`link)', + errorDetail: null, + errorRange: [ + 11, + 18, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[link(link](#link`link)', + errorDetail: null, + errorRange: [ + 6, + 23, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[link)link](#link`link)', + errorDetail: null, + errorRange: [ + 6, + 23, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[link](#link[link`link)', + errorDetail: null, + errorRange: [ + 6, + 23, + ], + fixInfo: null, + lineNumber: 91, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + { + errorContext: '[link](#link]link`link)', + errorDetail: null, + errorRange: [ + 6, + 23, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Link fragments should be valid', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', + ruleNames: [ + 'MD051', + 'link-fragments', + ], + severity: 'error', + }, + ], + fixed: `# spaces_inside_codespan_elements␊ + ␊ + \`normal codespan element\`␊ + ␊ + \`codespan element with space inside left\` {MD038}␊ + ␊ + \`codespan element with space inside right\` {MD038}␊ + ␊ + \` codespan element with spaces inside \` (allowed per spec)␊ + ␊ + empty \`\` codespan element␊ + ␊ + single space \` \` codespan element␊ + ␊ + \`,\`, \`.\`␊ + ␊ + \`,\`, \`code\`␊ + ␊ + \`[\`, \`(\`, \`+\`, \`*\`, \`/\`, \`-\`, \`,\`, \`.\`␊ + ␊ + \`code\` code \`anything\`␊ + ␊ + text \`code\` code \`anything\` text␊ + ␊ + text \`code\` text \`anything\` code \`end\`␊ + ␊ + text \`anything\` code \`code\` text \`end\`␊ + ␊ + text \`anything\` text \`anything\` code \`anything\` \`code\`␊ + ␊ + text \`\`code\`\` text \`\`code\`\` text␊ + ␊ + text \`\`code\`\` text {MD038}␊ + ␊ + text \`\`code\`\` text {MD038}␊ + ␊ + text \`\`\`code\`\`\` text \`\`\`code\`\`\` text␊ + ␊ + text \`\`\`code\`\`\` text \`\`code\`\` text {MD038}␊ + ␊ + text \`\`\`code\`\`\` text \`\`code\`\` text {MD038}␊ + ␊ + \`\`embedded \` backtick\`\` text \`code\`␊ + ␊ + \`backslash does not escape \\\` backtick in code span \`␊ + ␊ + escaped \\\` backtick is ignored outside \`code span\`␊ + ␊ + \`code\` then escaped \\\` backtick␊ + ␊ + \`\`code\`\` then escaped \\\` backtick then \`code\`␊ + ␊ + multiple \\\` escaped backticks \\\` in text␊ + ␊ + \\\` escaped backtick \\\` at start of text␊ + ␊ + text and \`\`\\\`code with ignored escaped \\\` backticks\`\`␊ + ␊ + \`\` \` \`\` text \`code\`␊ + ␊ + \` \`\` \` text \`code\`␊ + ␊ + \`\`\` \` surrounding space allowed for backtick \`\`\` text \`code\`␊ + ␊ + \`\`\` \` multiple leading spaces not allowed\`\`\` text \`code\` {MD038}␊ + ␊ + \`\` surrounding space allowed for backtick \` \`\` text \`code\`␊ + ␊ + \`\`multiple trailing spaces not allowed \` \`\` text \`code\` {MD038}␊ + ␊ + \`\` \` leading and trailing space allowed for backtick \` \`\` text \`code\`␊ + ␊ + Text [link](https://example.com/link\`link) text \`code\`.␊ + ␊ + Text [link](https://example.com/link\`\`\`link) text \`\`\`code\`\`\`.␊ + ␊ + Text [link](https://example.com/link\`link\`link\`link) text \`code\`.␊ + ␊ + Text [link](https://example.com/link "title\`title") text \`code\`.␊ + ␊ + Text [link](#link\`link) text \`code\`. {MD051}␊ + ␊ + Text [link] (#link\`link) text\`code\`. {MD038}␊ + ␊ + Text [link[link](#link\`link) text \`code\`. {MD051}␊ + ␊ + Text [link(link](#link\`link) text \`code\`. {MD051}␊ + ␊ + Text [link)link](#link\`link) text \`code\`. {MD051}␊ + ␊ + Text [link](#link[link\`link) text \`code\`. {MD051}␊ + ␊ + Text [link](#link]link\`link) text \`code\`. {MD051}␊ + ␊ + Text [link](#link(link\`link) text\`code\`. {MD038}␊ + ␊ + Text [\`link\`](xref:custom.link\`1) text \`code\`.␊ + ␊ + Text \`\`code [link](#link\`link) code\`\` text \`code\`.␊ + ␊ + No space, start or end: \`code\`␊ + ␊ + Start space, no end space: \`code\` {MD038}␊ + ␊ + No start space, end space: \`code\` {MD038}␊ + ␊ + Single start and end space: \` code \` (explicitly allowed/trimmed by the specification)␊ + ␊ + All spaces: \` \` \` \` \` \` \` \`␊ + ␊ + All line endings: \`␊ + \`␊ + ␊ + Double start and single end space: \` code \` {MD038}␊ + ␊ + Single start and double end spaces: \` code \` {MD038}␊ + ␊ + Double start and end spaces: \`code\` {MD038}␊ + ␊ + Spaces before and after: \` codecode \`␊ + As above, with an internal space: \` code code \`␊ + As above, practical example with a backtick: \`\` Ctrl + \` \`\`␊ + As above, no internal space: \`\` Ctrl+\` \`\`␊ + Again, 3 characters: \` abc \`␊ + Again, 2 characters: \` ab \`␊ + Again, 1 character: \` a \`␊ + Many internal spaces: \` code code code code code code \`␊ + ␊ + text \`\`\` \` surrounding space␊ + allowed for backtick \`\`\` text␊ + ␊ + text \`\`\` \` multiple leading {MD038}␊ + spaces not allowed\`\`\` text␊ + ␊ + text \`\` surrounding space␊ + allowed for backtick \` \`\` text␊ + ␊ + text \`\`multiple trailing spaces␊ + not allowed \` \`\` text {MD038}␊ + ␊ + text \`\` \` leading and trailing␊ + space allowed for backtick \` \`\` text␊ + ␊ + ␊ + ␊ + Text␊ + \`\`\`␊ + Code␊ + \`\`\`␊ + ␊ + Text␊ + \`\`\`␊ + Code {MD038}␊ + \`\`\`␊ + ␊ + Text␊ + \`\`\`␊ + Code␊ + \`\`\`␊ + ␊ + Text␊ + \`\`\`␊ + Code {MD038}␊ + \`\`\`␊ + Text␊ + ␊ + Text␊ + \`\`\`␊ + Code␊ + \`\`\`␊ + Text␊ + ␊ + ␊ + `, + } + +## spaces_inside_emphasis_markers.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Element: b', + errorRange: [ + 10, + 3, + ], + fixInfo: null, + lineNumber: 380, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: p', + errorRange: [ + 1, + 3, + ], + fixInfo: null, + lineNumber: 382, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: p', + errorRange: [ + 10, + 39, + ], + fixInfo: null, + lineNumber: 386, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: img', + errorRange: [ + 10, + 41, + ], + fixInfo: null, + lineNumber: 388, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: p', + errorRange: [ + 10, + 24, + ], + fixInfo: null, + lineNumber: 390, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** s', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g **', + errorDetail: null, + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '*** s', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 21, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ***', + errorDetail: null, + errorRange: [ + 31, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 31, + }, + lineNumber: 21, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '_ e', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 23, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's _', + errorDetail: null, + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 23, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '__ s', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g __', + errorDetail: null, + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '___ s', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ___', + errorDetail: null, + errorRange: [ + 31, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 31, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* b', + errorDetail: null, + errorRange: [ + 26, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 26, + }, + lineNumber: 29, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 42, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 42, + }, + lineNumber: 29, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** b', + errorDetail: null, + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g **', + errorDetail: null, + errorRange: [ + 41, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 41, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '*** b', + errorDetail: null, + errorRange: [ + 43, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 43, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ***', + errorDetail: null, + errorRange: [ + 70, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 70, + }, + lineNumber: 33, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '_ b', + errorDetail: null, + errorRange: [ + 26, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 26, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's _', + errorDetail: null, + errorRange: [ + 42, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 42, + }, + lineNumber: 35, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '__ b', + errorDetail: null, + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 37, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g __', + errorDetail: null, + errorRange: [ + 41, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 41, + }, + lineNumber: 37, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '___ b', + errorDetail: null, + errorRange: [ + 43, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 43, + }, + lineNumber: 39, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ___', + errorDetail: null, + errorRange: [ + 70, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 70, + }, + lineNumber: 39, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* b', + errorDetail: null, + errorRange: [ + 36, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 36, + }, + lineNumber: 41, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 52, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 52, + }, + lineNumber: 41, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '_ b', + errorDetail: null, + errorRange: [ + 31, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 31, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's _', + errorDetail: null, + errorRange: [ + 47, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 47, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* b', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 45, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* b', + errorDetail: null, + errorRange: [ + 12, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 12, + }, + lineNumber: 47, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n _', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 49, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* w', + errorDetail: null, + errorRange: [ + 25, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 25, + }, + lineNumber: 51, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** S', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 57, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '*** S', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 59, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '_ E', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 61, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '__ S', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 63, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '___ S', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 65, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 67, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g **', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 69, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ***', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 71, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's _', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 73, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g __', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 75, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ___', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 77, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 79, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** s', + errorDetail: null, + errorRange: [ + 22, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 22, + }, + lineNumber: 81, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '*** s', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 83, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '_ e', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 85, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '__ s', + errorDetail: null, + errorRange: [ + 22, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 22, + }, + lineNumber: 87, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '___ s', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 89, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 91, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g **', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 93, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ***', + errorDetail: null, + errorRange: [ + 43, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 43, + }, + lineNumber: 95, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's _', + errorDetail: null, + errorRange: [ + 30, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 30, + }, + lineNumber: 97, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g __', + errorDetail: null, + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 99, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's ___', + errorDetail: null, + errorRange: [ + 43, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 43, + }, + lineNumber: 101, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e **', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 103, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'n **', + errorDetail: null, + errorRange: [ + 26, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 26, + }, + lineNumber: 103, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 't **', + errorDetail: null, + errorRange: [ + 43, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 43, + }, + lineNumber: 103, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** a', + errorDetail: null, + errorRange: [ + 41, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 41, + }, + lineNumber: 105, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 't **', + errorDetail: null, + errorRange: [ + 44, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 44, + }, + lineNumber: 105, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* a', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 107, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 's *', + errorDetail: null, + errorRange: [ + 23, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 23, + }, + lineNumber: 107, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* i', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 111, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'm *', + errorDetail: null, + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + }, + lineNumber: 112, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* i', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 113, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'm *', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 113, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* s', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 116, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e *', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 117, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + }, + lineNumber: 118, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'e *', + errorDetail: null, + errorRange: [ + 19, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 19, + }, + lineNumber: 118, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '*** s', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 127, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** i', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 133, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'h ***', + errorDetail: null, + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + }, + lineNumber: 135, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'h *', + errorDetail: null, + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 137, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g **', + errorDetail: null, + errorRange: [ + 19, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 19, + }, + lineNumber: 139, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** *', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 145, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* i', + errorDetail: null, + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + }, + lineNumber: 147, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** *', + errorDetail: null, + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + }, + lineNumber: 149, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* **', + errorDetail: null, + errorRange: [ + 16, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 16, + }, + lineNumber: 155, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* **', + errorDetail: null, + errorRange: [ + 19, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 19, + }, + lineNumber: 161, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'h *', + errorDetail: null, + errorRange: [ + 9, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 9, + }, + lineNumber: 163, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 167, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'h *', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 169, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '** s', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 171, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g **', + errorDetail: null, + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 173, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* t', + errorDetail: null, + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + }, + lineNumber: 353, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 't *', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 354, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '_ t', + errorDetail: null, + errorRange: [ + 17, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 17, + }, + lineNumber: 356, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 't _', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 357, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* H', + errorDetail: null, + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 380, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'L *', + errorDetail: null, + errorRange: [ + 26, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 26, + }, + lineNumber: 380, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '* H', + errorDetail: null, + errorRange: [ + 35, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 35, + }, + lineNumber: 390, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'L *', + errorDetail: null, + errorRange: [ + 40, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 40, + }, + lineNumber: 390, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + ␊ + ␊ + Line with *Normal emphasis*␊ + ␊ + Line with **Normal strong**␊ + ␊ + Line with ***Normal strong and emphasis***␊ + ␊ + Line with _Normal emphasis_␊ + ␊ + Line with __Normal strong__␊ + ␊ + Line with ___Normal strong and emphasis___␊ + ␊ + Broken *emphasis* with spaces in {MD037}␊ + ␊ + Broken **strong** with spaces in {MD037}␊ + ␊ + Broken ***strong and emphasis*** with spaces in {MD037}␊ + ␊ + Broken _emphasis_ with spaces in {MD037}␊ + ␊ + Broken __strong__ with spaces in {MD037}␊ + ␊ + Broken ___strong and emphasis___ with spaces in {MD037}␊ + ␊ + Mixed *ok emphasis* and *broken emphasis* {MD037}␊ + ␊ + Mixed **ok strong** and **broken strong** {MD037}␊ + ␊ + Mixed ***ok strong and emphasis*** and ***broken strong and emphasis*** {MD037}␊ + ␊ + Mixed _ok emphasis_ and _broken emphasis_ {MD037}␊ + ␊ + Mixed __ok strong__ and __broken strong__ {MD037}␊ + ␊ + Mixed ___ok strong and emphasis___ and ___broken strong and emphasis___ {MD037}␊ + ␊ + Mixed *ok emphasis* **ok strong** *broken emphasis* {MD037}␊ + ␊ + Multiple *broken emphasis* _broken emphasis_ {MD037}␊ + ␊ + One-sided *broken emphasis* {MD037}␊ + ␊ + One-sided *broken emphasis* {MD037}␊ + ␊ + Will _flag on_words with underscores before them. {MD037}␊ + ␊ + The same goes for words*with asterisks* after them. {MD037}␊ + ␊ + But not with escaped\\* asterisks\\* \\_and \\_underscores.␊ + ␊ + * Emphasis* with left space is recognized as a list␊ + ␊ + **Strong** with left space {MD037}␊ + ␊ + ***Strong and emphasis*** with left space {MD037}␊ + ␊ + _Emphasis_ with left space {MD037}␊ + ␊ + __Strong__ with left space {MD037}␊ + ␊ + ___Strong and emphasis___ with left space {MD037}␊ + ␊ + *Emphasis* with right space {MD037}␊ + ␊ + **Strong** with right space {MD037}␊ + ␊ + ***Strong and emphasis*** with right space {MD037}␊ + ␊ + _Emphasis_ with right space {MD037}␊ + ␊ + __Strong__ with right space {MD037}␊ + ␊ + ___Strong and emphasis___ with right space {MD037}␊ + ␊ + {MD037} Left space *emphasis*␊ + ␊ + {MD037} Left space **strong**␊ + ␊ + {MD037} Left space ***strong and emphasis***␊ + ␊ + {MD037} Left space _emphasis_␊ + ␊ + {MD037} Left space __strong__␊ + ␊ + {MD037} Left space ___strong and emphasis___␊ + ␊ + {MD037} Right space *emphasis*␊ + ␊ + {MD037} Right space **strong**␊ + ␊ + {MD037} Right space ***strong and emphasis***␊ + ␊ + {MD037} Right space _emphasis_␊ + ␊ + {MD037} Right space __strong__␊ + ␊ + {MD037} Right space ___strong and emphasis___␊ + ␊ + **Multiple** spaces **in** emphasis **at** once. {MD037}␊ + ␊ + **Multiple ** spaces ** in** emphasis **at** once. {MD037}␊ + ␊ + This is *an ambiguous* scenario {MD037}␊ + ␊ + * List item *with emphasis* on the␊ + first and *second lines*.␊ + * List *item* {MD037}␊ + * List *item* {MD037}␊ + * List *item* {MD037}␊ + * List item with␊ + *hanging* emphasis␊ + and *some* lines {MD037}␊ + with *space* problems {MD037}␊ + throughout *the* content {MD037}␊ + ␊ + Uncommon scenarios from the CommonMark specification (and some variations):␊ + ***strong emph***␊ + ***strong** in emph*␊ + ***emph* in strong**␊ + **in strong *emph***␊ + *in emph **strong***␊ + ␊ + ***strong emph*** {MD037}␊ + ␊ + *** strong** in emph* {possible MD037}␊ + ␊ + *** emph* in strong** {possible MD037}␊ + ␊ + **in strong *emph*** {MD037}␊ + ␊ + ***strong emph*** {MD037}␊ + ␊ + ***strong** in emph* {MD037}␊ + ␊ + ***emph* in strong** {MD037}␊ + ␊ + **in strong *emph *** {possible MD037}␊ + ␊ + *in emph **strong *** {possible MD037}␊ + ␊ + ***strong emph*** {MD037}␊ + ␊ + ** *strong**in emph* {MD037}␊ + ␊ + ***emph* in strong** {MD037}␊ + ␊ + **in strong * emph*** (internal spaces are not detected)␊ + ␊ + *in emph ** strong*** (internal spaces are not detected)␊ + ␊ + ***strong emph*** {MD037}␊ + ␊ + ***strong ** in emph* (internal spaces are not detected)␊ + ␊ + ***emph * in strong** (internal spaces are not detected)␊ + ␊ + **in strong *emph*** {MD037}␊ + ␊ + *in emph**strong* ** {MD037}␊ + ␊ + Text *emph***strong** text␊ + ␊ + Text *emph***strong** text {MD037}␊ + ␊ + Text *emph***strong** text {MD037}␊ + ␊ + Text *emph***strong** text {MD037}␊ + ␊ + Text *emph***strong** text {MD037}␊ + ␊ + \`\`\`markdown␊ + Violations * are * allowed in code blocks where emphasis does not apply.␊ + \`\`\`␊ + ␊ + Emphasis \`inside * code * blocks\` is okay.␊ + ␊ + Emphasis \`* inside\` code \`blocks *\` is okay.␊ + ␊ + Emphasis \`inside *\` code \`* blocks\` is okay.␊ + ␊ + Emphasis \`inside _ code _ blocks\` is okay.␊ + ␊ + Emphasis \`_ inside\` code \`blocks _\` is okay.␊ + ␊ + Emphasis \`inside _\` code \`_ blocks\` is okay.␊ + ␊ + Mixed \`code_span\` scenarios are _also_ okay.␊ + ␊ + Mixed \`code*span\` scenarios are *also* okay.␊ + ␊ + Mixed \`code*span\` scenarios are _also_ okay.␊ + ␊ + Mixed \`code_span\` scenarios are *also* okay.␊ + ␊ + [Link](under_score) followed by _underscore_␊ + ␊ + [Link](un_der_score) followed by _underscore_␊ + ␊ + [Link](un_der_sco_re) followed by _underscore_␊ + ␊ + [Link](star*star) followed by *star*␊ + ␊ + * [Link](star*star) followed by *star*␊ + ␊ + Text [Link](under_score) text _underscore_ text [Link](st*ar) text *star* text␊ + ␊ + [Link [link] link](under_score) followed by _underscore_␊ + ␊ + **under_score** text *under_score*␊ + ␊ + *under_score* text **under_score**␊ + ␊ + __star*star__ text _star*star_␊ + ␊ + _star*star_ text __star*star__␊ + ␊ + *_emphasis* text *emphasis*␊ + ␊ + *emphasis_* text *emphasis*␊ + ␊ + *emphasis* text *_emphasis*␊ + ␊ + *emphasis* text *emphasis_*␊ + ␊ + text \\\\*emphasis* text *emphasis* text␊ + ␊ + text *emphasis\\\\* text *emphasis* text␊ + ␊ + text *emphasis* text \\\\*emphasis* text␊ + ␊ + text *emphasis* text *emphasis\\\\* text␊ + ␊ + text *star*_underscore_ text **star**_underscore_ text␊ + ␊ + text **star**_underscore_ text *star*_underscore_ text␊ + ␊ + text **star**_underscore_ text **star**_underscore_ text␊ + ␊ + text *star*_underscore_ text *star*__underscore__ text␊ + ␊ + text *star*__underscore__ text *star*_underscore_ text␊ + ␊ + text *star*__underscore__ text *star*__underscore__ text␊ + ␊ + text _underscore_*star* text __underscore__*star* text␊ + ␊ + text __underscore__*star* text _underscore_*star* text␊ + ␊ + text __underscore__*star* text __underscore__*star* text␊ + ␊ + text _underscore_*star* text _underscore_**star** text␊ + ␊ + text _underscore_**star** text _underscore_*star* text␊ + ␊ + text _underscore_**star** text _underscore_**star** text␊ + ␊ + > * List with *emphasis* in blockquote␊ + >␊ + > > * List with *emphasis* in blockquote␊ + ␊ + \`* text *\`␊ + ␊ + \`** text **\`␊ + ␊ + \`*** text ***\`␊ + ␊ + \`**** text ****\`␊ + ␊ + \`***** text *****\`␊ + ␊ + \`****** text ******\`␊ + ␊ + \`******* text *******\`␊ + ␊ + under_score␊ + _underscore_␊ + ␊ + st*ar␊ + *star*␊ + ␊ + under_score␊ + *star*␊ + ␊ + st*ar␊ + _underscore_␊ + ␊ + *star*␊ + _underscore_␊ + ␊ + _underscore_␊ + *star*␊ + ␊ + _underscore␊ + _*star*␊ + ␊ + *star␊ + *_underscore_␊ + ␊ + [reference_link]␊ + _first_ and _second_␊ + ␊ + [reference_link]␊ + *first* and *second*␊ + ␊ + [reference*link]␊ + _first_ and _second_␊ + ␊ + [reference*link]␊ + *first* and *second*␊ + ␊ + text [reference_link] under _ score text␊ + ␊ + text [reference*link] star * star text␊ + ␊ + [reference_link]: https://example.com␊ + [reference*link]: https://example.com␊ + ␊ + ***text␊ + *text*␊ + ***␊ + ␊ + *** text␊ + *text*␊ + ***␊ + ␊ + *** text␊ + \\*text\\*␊ + ***␊ + ␊ + *** text␊ + **text**␊ + ***␊ + ␊ + | Table | Table |␊ + | ----- | ----- |␊ + | star | x * y |␊ + | under | x _ y |␊ + ␊ + | Table | Table |␊ + | ----- | ----- |␊ + | star | x * y |␊ + | star | x * y |␊ + | under | x _ y |␊ + | under | x _ y |␊ + ␊ + | Table | Table |␊ + | ----- | ------------------------- |␊ + | star | text *text* text |␊ + | star | text *text* text {MD037} |␊ + | star | text *text* text {MD037} |␊ + | under | text _text_ text |␊ + | under | text _text_ text {MD037} |␊ + | under | text _text_ text {MD037} |␊ + ␊ + | Table | Table |␊ + | ----- | ----- |␊ + | x * y | x * y |␊ + | x** y | x** y |␊ + | x _ y | x _ y |␊ + | x__ y | x__ y |␊ + ␊ + \`\`\`yaml /* autogenerated */␊ + # YAML...␊ + \`\`\`␊ + ␊ + new_value from *old_value* and *older_value*.␊ + ␊ + :ballot_box_with_check: _Emoji syntax_␊ + ␊ + some_snake_case_function() is _called_␊ + ␊ + _~/.ssh/id_rsa_ and _emphasis_␊ + ␊ + Partial *em*phasis of a *wo*rd.␊ + ␊ + Emphasis inside *HTML* content {MD033} {MD037}␊ + ␊ +

{MD033}␊ + Emphasis inside * HTML * content␊ +

␊ + ␊ + Emphasis

{MD033}␊ + ␊ + Emphasis inside * attribute * content {MD033}␊ + ␊ + Emphasis

*HTML*

{MD033} {MD037}␊ + ␊ + Embedded underscore is okay:␊ + Text _emphas_i_s_ text _emphasis_␊ + `, + } + +## spaces_inside_link_text.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 60, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 34, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 34, + }, + lineNumber: 63, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 69, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 38, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 38, + }, + lineNumber: 74, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: '[ ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 17, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[foo ]', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 19, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ foo]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 21, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ foo ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 23, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ foo ]', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 23, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ "foo" ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ "foo" ]', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 25, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ `foo` ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ `foo` ]', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 27, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ *foo* ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 29, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ *foo* ]', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 29, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ __foo__ ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ __foo__ ]', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 31, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[- ]', + errorDetail: null, + errorRange: [ + 27, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 27, + }, + lineNumber: 37, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[- ]', + errorDetail: null, + errorRange: [ + 28, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 28, + }, + lineNumber: 41, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[- ]', + errorDetail: null, + errorRange: [ + 28, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 28, + }, + lineNumber: 43, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[error ]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 49, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link with leading space]', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 51, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[link with trailing space ]', + errorDetail: null, + errorRange: [ + 38, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 38, + }, + lineNumber: 53, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link with leading and traili...', + errorDetail: null, + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 55, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '...h leading and trailing space ]', + errorDetail: null, + errorRange: [ + 51, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 51, + }, + lineNumber: 55, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link with leading space]', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link with leading space]', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 60, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[link with trailing space ]', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 63, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[link with trailing space ]', + errorDetail: null, + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 67, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link with leading and traili...', + errorDetail: null, + errorRange: [ + 10, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 10, + }, + lineNumber: 69, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '...h leading and trailing space ]', + errorDetail: null, + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 71, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link with leading and traili...', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 74, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '...h leading and trailing space ]', + errorDetail: null, + errorRange: null, + fixInfo: null, + lineNumber: 74, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[link ]', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 81, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 83, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 85, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ link ]', + errorDetail: null, + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + }, + lineNumber: 85, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ref ]', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 89, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ ref]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 91, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ ref ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 93, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ ref ]', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 93, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ref ]', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 97, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ ref]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 99, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ ref ]', + errorDetail: null, + errorRange: [ + 2, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 2, + }, + lineNumber: 101, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[ ref ]', + errorDetail: null, + errorRange: [ + 6, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 6, + }, + lineNumber: 101, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + ], + fixed: `# Spaces Inside Link Text␊ + ␊ + [](http://bar/)␊ + ␊ + [foo](https://bar/)␊ + ␊ + ["foo"](https://bar/)␊ + ␊ + [\`foo\`](https://bar/)␊ + ␊ + [*foo*](https://bar/)␊ + ␊ + [__foo__](https://bar/)␊ + ␊ + [foo "bar"](https://baz/)␊ + ␊ + [](https://bar/) {MD039}␊ + ␊ + [foo](https://bar/) {MD039}␊ + ␊ + [foo](https://bar/) {MD039}␊ + ␊ + [foo](https://bar/) {MD039}␊ + ␊ + ["foo"](https://bar/) {MD039}␊ + ␊ + [\`foo\`](https://bar/) {MD039}␊ + ␊ + [*foo*](https://bar/) {MD039}␊ + ␊ + [__foo__](https://bar/) {MD039}␊ + ␊ + The following shouldn't break anything:␊ + [![Screenshot.png](/images/Screenshot.png)](/images/Screenshot.png)␊ + ␊ + function CodeButNotCode(input) {␊ + return input.replace(/[-]([a-z])/g, "one"); // {MD039}␊ + }␊ + ␊ + function MoreCodeButNotCode(input) {␊ + input = input.replace(/[-]([a-z])/g, "two"); // {MD039}␊ + input = input.toLowerCase();␊ + input = input.replace(/[-]([a-z])/g, "three"); // {MD039}␊ + return input;␊ + }␊ + ␊ + [Links](ending) ␊ + [with](spaces) ␊ + [error]({MD039})␊ + ␊ + Non-wrapped [link with leading space](https://example.com) {MD039}␊ + ␊ + Non-wrapped [link with trailing space](https://example.com) {MD039}␊ + ␊ + Non-wrapped [link with leading and trailing space](https://example.com) {MD039}␊ + ␊ + Wrapped [␊ + link with leading space](https://example.com) {MD039}␊ + ␊ + Wrapped [␊ + link with leading space](https://example.com) {MD009:-1} {MD039:-1}␊ + ␊ + Wrapped [link with trailing space␊ + ](https://example.com) {MD009:-1} {MD039:-1}␊ + ␊ + Wrapped [link with trailing space␊ + ](https://example.com) {MD039}␊ + ␊ + Wrapped [␊ + link with leading and trailing space␊ + ](https://example.com) {MD009:-2} {MD039:-2} {MD039}␊ + ␊ + Wrapped [␊ + link with leading and trailing space␊ + ](https://example.com) {MD009:-1} {MD039:-1}␊ + ␊ + [][ref]␊ + ␊ + [link][ref]␊ + ␊ + [link][ref] {MD039}␊ + ␊ + [link][ref] {MD039}␊ + ␊ + [link][ref] {MD039}␊ + ␊ + [ref]␊ + ␊ + [ref] {MD039}␊ + ␊ + [ref] {MD039}␊ + ␊ + [ref] {MD039}␊ + ␊ + [ref][]␊ + ␊ + [ref][] {MD039}␊ + ␊ + [ref][] {MD039}␊ + ␊ + [ref][] {MD039}␊ + ␊ + [ref]: https://example.com␊ + ␊ + Not a link, just [ text in ] brackets␊ + ␊ + Images are ![ not links ](image.jpg)␊ + ␊ + `, + } + +## strong_style_asterisk.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '**', + }, + lineNumber: 9, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 7, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 7, + insertText: '**', + }, + lineNumber: 9, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 6, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 6, + insertText: '**', + }, + lineNumber: 11, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + insertText: '**', + }, + lineNumber: 11, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 9, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 9, + insertText: '**', + }, + lineNumber: 13, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: underscore', + errorRange: [ + 14, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 14, + insertText: '**', + }, + lineNumber: 13, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + ], + fixed: `# Strong style asterisk␊ + ␊ + **This** is fine␊ + ␊ + This **is** fine␊ + ␊ + This is **fine**␊ + ␊ + **This** is not␊ + ␊ + This **is** not␊ + ␊ + This is **not**␊ + ␊ + {MD050:-2} {MD050:-4} {MD050:-6}␊ + ␊ + Internal emphasis is preserved:␊ + apple**banana**cherry, apple**banana**, **banana**cherry␊ + apple__banana__cherry, apple__banana__, __banana__cherry␊ + ␊ + ␊ + `, + } + +## strong_style_underscore.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 1, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 1, + insertText: '__', + }, + lineNumber: 9, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 7, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 7, + insertText: '__', + }, + lineNumber: 9, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 6, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 6, + insertText: '__', + }, + lineNumber: 11, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + insertText: '__', + }, + lineNumber: 11, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 9, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 9, + insertText: '__', + }, + lineNumber: 13, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: underscore; Actual: asterisk', + errorRange: [ + 14, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 14, + insertText: '__', + }, + lineNumber: 13, + ruleDescription: 'Strong style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md050.md', + ruleNames: [ + 'MD050', + 'strong-style', + ], + severity: 'error', + }, + ], + fixed: `# Strong style underscore␊ + ␊ + __This__ is fine␊ + ␊ + This __is__ fine␊ + ␊ + This is __fine__␊ + ␊ + __This__ is not␊ + ␊ + This __is__ not␊ + ␊ + This is __not__␊ + ␊ + {MD050:-2} {MD050:-4} {MD050:-6}␊ + ␊ + Internal emphasis is preserved:␊ + apple**banana**cherry, apple**banana**, **banana**cherry␊ + apple__banana__cherry, apple__banana__, __banana__cherry␊ + ␊ + ␊ + `, + } + +## sublist-bullet-style.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '+', + }, + lineNumber: 7, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 20, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: plus', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '*', + }, + lineNumber: 21, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 7, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 7, + insertText: '-', + }, + lineNumber: 23, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '+', + }, + lineNumber: 27, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + insertText: '-', + }, + lineNumber: 31, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: dash', + errorRange: [ + 3, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 3, + insertText: '*', + }, + lineNumber: 32, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: asterisk', + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + insertText: '+', + }, + lineNumber: 33, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: asterisk', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: '-', + }, + lineNumber: 49, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: '-', + }, + lineNumber: 50, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: dash; Actual: plus', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + insertText: '-', + }, + lineNumber: 58, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: plus; Actual: dash', + errorRange: [ + 13, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 13, + insertText: '+', + }, + lineNumber: 66, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: asterisk; Actual: plus', + errorRange: [ + 15, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 15, + insertText: '*', + }, + lineNumber: 75, + ruleDescription: 'Unordered list style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md', + ruleNames: [ + 'MD004', + 'ul-style', + ], + severity: 'error', + }, + ], + fixed: `# sublist-bullet-style␊ + ␊ + 1. item␊ + 1. item␊ + + item␊ + 1. item␊ + + item {MD004}␊ + ␊ + - item␊ + * item␊ + + item␊ + - item␊ + + item␊ + * item␊ + - item␊ + * item␊ + + item␊ + - item␊ + ␊ + - item {MD004}␊ + * item {MD004}␊ + + item␊ + - item {MD004}␊ + ␊ + - item␊ + * item␊ + + item {MD004}␊ + - item␊ + * item␊ + ␊ + - item {MD004}␊ + * item {MD004}␊ + + item {MD004}␊ + ␊ + - item␊ + 1. item␊ + + item␊ + 1. item␊ + * item␊ + ␊ + 1. item␊ + * item␊ + ␊ + - item␊ + * item␊ + + item␊ + - item␊ + * item␊ + - item {MD004}␊ + - item {MD004}␊ + ␊ + - item␊ + * item␊ + + item␊ + - item␊ + * item␊ + - item␊ + - item {MD004}␊ + ␊ + - item␊ + * item␊ + + item␊ + - item␊ + * item␊ + - item␊ + + item {MD004}␊ + ␊ + - item␊ + * item␊ + + item␊ + - item␊ + * item␊ + - item␊ + + item␊ + * item {MD004}␊ + ␊ + ␊ + `, + } + +## table-column-count.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 29, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 30, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 31, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 73, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 74, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 75, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 111, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 20, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 20, + }, + lineNumber: 112, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 29, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 29, + }, + lineNumber: 113, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 105, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 105, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 106, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 106, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 107, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 107, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 2; Too few cells, row will be missing data', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 62, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2; Too many cells, extra data will be missing', + errorRange: [ + 9, + 9, + ], + fixInfo: null, + lineNumber: 84, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 4; Too many cells, extra data will be missing', + errorRange: [ + 18, + 15, + ], + fixInfo: null, + lineNumber: 91, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3; Too many cells, extra data will be missing', + errorRange: [ + 18, + 8, + ], + fixInfo: null, + lineNumber: 92, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 4; Too many cells, extra data will be missing', + errorRange: [ + 27, + 8, + ], + fixInfo: null, + lineNumber: 99, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 5; Too many cells, extra data will be missing', + errorRange: [ + 27, + 15, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3; Too many cells, extra data will be missing', + errorRange: [ + 17, + 6, + ], + fixInfo: null, + lineNumber: 107, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3; Too many cells, extra data will be missing', + errorRange: [ + 19, + 11, + ], + fixInfo: null, + lineNumber: 113, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2; Too many cells, extra data will be missing', + errorRange: [ + 9, + 8, + ], + fixInfo: null, + lineNumber: 121, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 1; Actual: 2; Too many cells, extra data will be missing', + errorRange: [ + 9, + 8, + ], + fixInfo: null, + lineNumber: 123, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 3; Too many cells, extra data will be missing', + errorRange: [ + 18, + 8, + ], + fixInfo: null, + lineNumber: 129, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 130, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 4; Too many cells, extra data will be missing', + errorRange: [ + 27, + 8, + ], + fixInfo: null, + lineNumber: 138, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 3; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 139, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Count␊ + ␊ + ## Expected␊ + ␊ + | Table |␊ + |-------|␊ + | Cell |␊ + | Cell |␊ + | Cell |␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + ␊ + | Table | Header | Header |␊ + |-------|--------|--------|␊ + | Cell | Cell | Cell |␊ + | Cell | Cell | Cell |␊ + | Cell | Cell | Cell |␊ + ␊ + Table | Header␊ + -------|--------␊ + Cell | Cell␊ + ␊ + {MD055:-4} {MD055:-3} {MD055:-2}␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell |␊ + ␊ + {MD009:-4} {MD009:-3} {MD009:-2}␊ + ␊ + ## Blank␊ + ␊ + | Table |␊ + |-------|␊ + | |␊ + | Cell |␊ + ␊ + | Table | Header | Header |␊ + |-------|--------|--------|␊ + | | Cell | Cell |␊ + | Cell | | Cell |␊ + | Cell | Cell | |␊ + | | | |␊ + ␊ + ## Too Few␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell |␊ + | Cell | Cell |␊ + | Cell |␊ + ␊ + {MD056:-4} {MD056:-2}␊ + ␊ + | Table | Header | Header |␊ + |-------|--------|--------|␊ + | Cell |␊ + | Cell | Cell |␊ + | Cell | Cell | Cell |␊ + ␊ + {MD056:-4} {MD056:-3}␊ + ␊ + Table | Header␊ + -------|--------␊ + Cell␊ + ␊ + {MD055:-4} {MD055:-3} {MD055:-2} {MD056:-2}␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell |␊ + ␊ + {MD009:-4} {MD009:-3} {MD009:-2} {MD056:-2}␊ + ␊ + ## Too Many␊ + ␊ + | Table |␊ + |-------|␊ + | Cell |␊ + | Cell | Cell |␊ + | Cell |␊ + ␊ + {MD056:-3}␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell | Cell | Cell |␊ + | Cell | Cell | Cell |␊ + | Cell | Cell |␊ + ␊ + {MD056:-4} {MD056:-3}␊ + ␊ + | Table | Header | Header |␊ + |-------|--------|--------|␊ + | Cell | Cell | Cell | Cell |␊ + | Cell | Cell | Cell |␊ + | Cell | Cell | Cell | Cell | Cell |␊ + ␊ + {MD056:-4} {MD056:-2}␊ + ␊ + Table | Header␊ + -------|--------␊ + Cell | Cell | Cell␊ + ␊ + {MD055:-4} {MD055:-3} {MD055:-2} {MD056:-2}␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell | Cell |␊ + ␊ + {MD009:-4} {MD009:-3} {MD009:-2} {MD056:-2}␊ + ␊ + ## Mixed␊ + ␊ + | Table |␊ + |-------|␊ + | Cell | Cell |␊ + | Cell |␊ + | Cell | Cell |␊ + ␊ + {MD056:-4} {MD056:-2}␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell | Cell |␊ + | Cell |␊ + | Cell | Cell |␊ + ␊ + {MD056:-4} {MD056:-3}␊ + ␊ + | Table | Header | Header |␊ + |-------|--------|--------|␊ + | Cell | Cell | Cell |␊ + | Cell | Cell | Cell | Cell |␊ + | Cell |␊ + ␊ + {MD056:-3} {MD056:-2}␊ + `, + } + +## table-column-style-aligned-delimiter.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 36, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 80, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for option "aligned_delimiter"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 102, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Style - Aligned Delimiter␊ + ␊ + ## Aligned / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + ␊ + ## Aligned / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + ␊ + ## Compact / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | ------- | ------- |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + | Heading | Heading | Heading |␊ + | - | - | - |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-5}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | -------- | ------ |␊ + | Text text | Text text text | Text |␊ + ␊ + {MD060:-3}␊ + ␊ + ## Compact / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | ------- | -------␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + Heading | Heading | Heading␊ + -- | -- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-5}␊ + ␊ + Heading | Heading | Heading␊ + ------- | -------- | ------␊ + Text text | Text text text | Text␊ + ␊ + {MD060:-3}␊ + ␊ + ## Tight / Edge Pipes␊ + ␊ + |Heading|Heading|Heading|␊ + |-------|-------|-------|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + |Heading|Heading|Heading|␊ + |-|-|-|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + {MD060:-5}␊ + ␊ + |Heading|Heading|Heading|␊ + |-------|--------|------|␊ + |Text text|Text text text|Text|␊ + ␊ + {MD060:-3}␊ + ␊ + ## Tight / No Edge Pipes␊ + ␊ + Heading|Heading|Heading␊ + -------|-------|-------␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + Heading|Heading|Heading␊ + -|-|-␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + {MD060:-5}␊ + ␊ + Heading|Heading|Heading␊ + -------|--------|------␊ + Text text|Text text text|Text␊ + ␊ + {MD060:-3}␊ + ␊ + ␊ + `, + } + +## table-column-style-aligned.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 24, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 27, + 1, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 40, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 40, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 37, + 1, + ], + fixInfo: null, + lineNumber: 40, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 46, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 46, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 46, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 47, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 47, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 27, + 1, + ], + fixInfo: null, + lineNumber: 47, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 48, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 48, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 37, + 1, + ], + fixInfo: null, + lineNumber: 48, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 29, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 66, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 66, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 74, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 74, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 80, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 80, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 81, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 82, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 82, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 83, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 83, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 91, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 91, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 91, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 92, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 92, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 92, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 98, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 98, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 98, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 99, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 99, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 99, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 100, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 100, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 100, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 106, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 107, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 107, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 108, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 27, + 1, + ], + fixInfo: null, + lineNumber: 108, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 108, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 109, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 109, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 117, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 117, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 118, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 118, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 124, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 124, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 125, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 125, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 126, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 126, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 132, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 133, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 133, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 134, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 134, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 135, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 135, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Style - Aligned␊ + ␊ + ## Aligned / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | -------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text tex | Text |␊ + ␊ + {MD060:-5} {MD060:-3} {MD060:-2}␊ + ␊ + ## Aligned / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + ␊ + Heading | Heading | Heading␊ + ------- | -------- | --------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text tex | Text␊ + ␊ + {MD060:-5} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | ------- | ------- |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + | Heading | Heading | Heading |␊ + | - | - | - |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + | Heading | Heading | Heading |␊ + | - | --- | - |␊ + | Text | Text text | Text |␊ + | Text | Text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | ------- | -------␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading | Heading | Heading␊ + -- | -- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading | Heading | Heading␊ + -- | --- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Tight / Edge Pipes␊ + ␊ + |Heading|Heading|Heading|␊ + |-------|-------|-------|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + |Heading|Heading|Heading|␊ + |-|-|-|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + |Heading|Heading |Heading|␊ + |-------|-------|------- |␊ + | Text|Text text |Text|␊ + |Text text |Text text text|Text|␊ + |Text| Text |Text|␊ + ␊ + {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Tight / No Edge Pipes␊ + ␊ + Heading|Heading|Heading␊ + -------|-------|-------␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading|Heading|Heading␊ + -|-|-␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading|Heading |Heading␊ + -------|-------| -------␊ + Text |Text text|Text␊ + Text text|Text text text|Text␊ + Text| Text |Text␊ + ␊ + {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ␊ + `, + } + +## table-column-style-compact.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 55, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 29, + 1, + ], + fixInfo: null, + lineNumber: 56, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 76, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 76, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 88, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 88, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 88, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 88, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 88, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 88, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 101, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 102, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 102, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 102, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 102, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 102, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 103, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 103, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 103, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 103, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 104, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 104, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 27, + 1, + ], + fixInfo: null, + lineNumber: 104, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 27, + 1, + ], + fixInfo: null, + lineNumber: 104, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 104, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 105, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 105, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 105, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 105, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 111, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 111, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 111, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 111, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 112, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 112, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 112, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 112, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 113, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 113, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 113, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 113, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 114, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 114, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 114, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 114, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 115, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 115, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 115, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 115, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 120, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 120, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 120, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 120, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 121, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 121, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 121, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 121, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 122, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 122, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 122, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 122, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 123, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 123, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 123, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 123, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 128, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 128, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 128, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 129, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 129, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 129, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 130, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 130, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 130, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 25, + 1, + ], + fixInfo: null, + lineNumber: 130, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the left for style "compact"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 131, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe is missing space to the right for style "compact"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 131, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Style - Compact␊ + ␊ + ## Aligned / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + ␊ + {MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | -------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text tex | Text |␊ + ␊ + {MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Aligned / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + ␊ + {MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading | Heading | Heading␊ + ------- | -------- | --------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text tex | Text␊ + ␊ + {MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | ------- | ------- |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + | Heading | Heading | Heading |␊ + | - | - | - |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + | Heading | Heading | Heading |␊ + | - | --- | - |␊ + | Text | Text text | Text |␊ + | Text | Text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | ------- | -------␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + Heading | Heading | Heading␊ + -- | -- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + Heading | Heading | Heading␊ + -- | --- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2}␊ + ␊ + ## Tight / Edge Pipes␊ + ␊ + |Heading|Heading|Heading|␊ + |-------|-------|-------|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + |Heading|Heading|Heading|␊ + |-|-|-|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + |Heading|Heading |Heading|␊ + |-------|-------|------- |␊ + | Text|Text text |Text|␊ + |Text text |Text text text|Text|␊ + |Text| Text |Text|␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Tight / No Edge Pipes␊ + ␊ + Heading|Heading|Heading␊ + -------|-------|-------␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading|Heading|Heading␊ + -|-|-␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading|Heading |Heading␊ + -------|-------| -------␊ + Text |Text text|Text␊ + Text text|Text text text|Text␊ + Text| Text |Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ␊ + `, + } + +## table-column-style-default.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 24, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 28, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 30, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 29, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 73, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the right for style "compact"', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 93, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 94, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 95, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 97, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 115, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 116, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 117, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 119, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Style - Default␊ + ␊ + ## Aligned / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | -------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text tex | Text |␊ + ␊ + {MD060:-5} {MD060:-3} {MD060:-2}␊ + ␊ + ## Aligned / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + ␊ + Heading | Heading | Heading␊ + ------- | -------- | --------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text tex | Text␊ + ␊ + {MD060:-5} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | ------- | ------- |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + | Heading | Heading | Heading |␊ + | - | - | - |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + | Heading | Heading | Heading |␊ + | - | --- | - |␊ + | Text | Text text | Text |␊ + | Text | Text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | ------- | -------␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + Heading | Heading | Heading␊ + -- | -- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + Heading | Heading | Heading␊ + -- | --- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2}␊ + ␊ + ## Tight / Edge Pipes␊ + ␊ + |Heading|Heading|Heading|␊ + |-------|-------|-------|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + |Heading|Heading|Heading|␊ + |-|-|-|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + |Heading|Heading |Heading|␊ + |-------|-------|------- |␊ + | Text|Text text |Text|␊ + |Text text |Text text text|Text|␊ + |Text| Text |Text|␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Tight / No Edge Pipes␊ + ␊ + Heading|Heading|Heading␊ + -------|-------|-------␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + Heading|Heading|Heading␊ + -|-|-␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + Heading|Heading |Heading␊ + -------|-------| -------␊ + Text |Text text|Text␊ + Text text|Text text text|Text␊ + Text| Text |Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2}␊ + ␊ + ␊ + `, + } + +## table-column-style-emoji.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has extra space to the left for style "compact"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Style - Emoji␊ + ␊ + ## Aligned␊ + ␊ + | Response | Emoji |␊ + | -------- | ----- |␊ + | Yes | ✅ |␊ + | No | ❎ |␊ + | Oops | ❌ |␊ + ␊ + {MD060:-2}␊ + ␊ + ## Compact␊ + ␊ + | Response | Emoji |␊ + | --- | --- |␊ + | Yes | ✅ |␊ + | No | ❎ |␊ + | Oops | ❌ |␊ + ␊ + {MD060:-2}␊ + ␊ + ## Tight␊ + ␊ + |Response|Emoji|␊ + |---|---|␊ + |Yes|✅|␊ + |No|❎|␊ + |Oops|❌ |␊ + ␊ + {MD060:-2}␊ + `, + } + +## table-column-style-irregular-trailing-pipe.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 35, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 40, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 35, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 40, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 35, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 37, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 38, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 39, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 37, + 1, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 38, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe does not align with header for style "aligned"', + errorRange: [ + 38, + 1, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Style - Irregular Trailing Pipe␊ + ␊ + ## Aligned / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text | Text text |␊ + | Text | Text text | Text |␊ + ␊ + {MD060:-3}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text text text |␊ + | Text | Text | Text |␊ + | Text | Text text | Text text |␊ + ␊ + {MD060:-2} {MD060:-4}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text text text |␊ + | Text | Text text | Text text |␊ + ␊ + {MD060:-2} {MD060:-3}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text | Text |␊ + | Text | Text text | Text |␊ + ␊ + {MD060:-3}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ---- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + ␊ + {MD060:-2} {MD060:-3} {MD060:-4}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ----------- |␊ + | Text | Text text | Text text |␊ + | Text | Text text | Text text |␊ + ␊ + {MD060:-4}␊ + ␊ + | Heading | Heading |␊ + | ------- | ------- |␊ + | Text | Text |␊ + | Text | Text text text text |␊ + | Text | Text text text text text |␊ + ␊ + {MD060:-2} {MD060:-3}␊ + ␊ + ## Aligned / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text␊ + Text | Text | Text text␊ + Text | Text text | Text␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text text text␊ + Text | Text | Text␊ + Text | Text text | Text text␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text text text␊ + Text | Text text | Text text␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text␊ + Text | Text | Text␊ + Text | Text text | Text␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | ----␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | ---------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + ␊ + Heading | Heading␊ + ------- | -------␊ + Text | Text␊ + Text | Text text text text␊ + Text | Text text text text text␊ + ␊ + ␊ + `, + } + +## table-column-style-tight.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 9, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 24, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 24, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 33, + 1, + ], + fixInfo: null, + lineNumber: 16, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 27, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 31, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 32, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 33, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 10, + 1, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 35, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 27, + 1, + ], + fixInfo: null, + lineNumber: 43, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 37, + 1, + ], + fixInfo: null, + lineNumber: 44, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 45, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 49, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 50, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 27, + 1, + ], + fixInfo: null, + lineNumber: 51, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 30, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 37, + 1, + ], + fixInfo: null, + lineNumber: 52, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 8, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 53, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 57, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 22, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 32, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 23, + 1, + ], + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 59, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 60, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 60, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 60, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 60, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 60, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 29, + 1, + ], + fixInfo: null, + lineNumber: 60, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 31, + 1, + ], + fixInfo: null, + lineNumber: 61, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 67, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 68, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 69, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 70, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 70, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 70, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 70, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 71, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 75, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 76, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 76, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 76, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 76, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 77, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 78, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 78, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 78, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 78, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 79, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 83, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 83, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 83, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 83, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 84, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 4, + 1, + ], + fixInfo: null, + lineNumber: 84, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 84, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 84, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 9, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 85, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 11, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 28, + 1, + ], + fixInfo: null, + lineNumber: 86, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 7, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 87, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 105, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 26, + 1, + ], + fixInfo: null, + lineNumber: 106, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 107, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 107, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 108, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 109, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 13, + 1, + ], + fixInfo: null, + lineNumber: 109, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 128, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 6, + 1, + ], + fixInfo: null, + lineNumber: 129, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the right for style "tight"', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 131, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Table pipe has space to the left for style "tight"', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 131, + ruleDescription: 'Table column style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md', + ruleNames: [ + 'MD060', + 'table-column-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Column Style - Tight␊ + ␊ + ## Aligned / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | -------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text |␊ + | Text | Text tex | Text |␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Aligned / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | --------- | -------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading | Heading | Heading␊ + ------- | -------- | --------␊ + Text | Text text | Text␊ + Text | Text text | Text␊ + Text | Text tex | Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / Edge Pipes␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | ------- | ------- |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + | Heading | Heading | Heading |␊ + | - | - | - |␊ + | Text | Text text | Text |␊ + | Text text | Text text text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + | Heading | Heading | Heading |␊ + | - | --- | - |␊ + | Text | Text text | Text |␊ + | Text | Text | Text |␊ + | Text | Text | Text |␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Compact / No Edge Pipes␊ + ␊ + Heading | Heading | Heading␊ + ------- | ------- | -------␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading | Heading | Heading␊ + -- | -- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + Heading | Heading | Heading␊ + -- | --- | --␊ + Text | Text text | Text␊ + Text text | Text text text | Text␊ + Text | Text | Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Tight / Edge Pipes␊ + ␊ + |Heading|Heading|Heading|␊ + |-------|-------|-------|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + |Heading|Heading|Heading|␊ + |-|-|-|␊ + |Text|Text text|Text|␊ + |Text text|Text text text|Text|␊ + |Text|Text|Text|␊ + ␊ + |Heading|Heading |Heading|␊ + |-------|-------|------- |␊ + | Text|Text text |Text|␊ + |Text text |Text text text|Text|␊ + |Text| Text |Text|␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2}␊ + ␊ + ## Tight / No Edge Pipes␊ + ␊ + Heading|Heading|Heading␊ + -------|-------|-------␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + Heading|Heading|Heading␊ + -|-|-␊ + Text|Text text|Text␊ + Text text|Text text text|Text␊ + Text|Text|Text␊ + ␊ + Heading|Heading |Heading␊ + -------|-------| -------␊ + Text |Text text|Text␊ + Text text|Text text text|Text␊ + Text| Text |Text␊ + ␊ + {MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2}␊ + ␊ + ␊ + `, + } + +## table-column-style-trailing-spaces.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Table Column Style - Trailing Spaces␊ + ␊ + ## Aligned␊ + ␊ + | Heading | Heading | Heading |␊ + | ------- | --------- | ------- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text | ␊ + | Text | Text text | Text | ␊ + | Text | Text text | Text | ␊ + ␊ + ## Compact␊ + ␊ + | Heading | Heading | Heading |␊ + | --- | --- | --- |␊ + | Text | Text text | Text |␊ + | Text | Text text | Text | ␊ + | Text | Text text | Text | ␊ + | Text | Text text | Text | ␊ + ␊ + ## Tight␊ + ␊ + |Heading|Heading|Heading|␊ + |---|---|---|␊ + |Text|Text text|Text|␊ + |Text|Text text|Text| ␊ + |Text|Text text|Text| ␊ + |Text|Text text|Text| ␊ + ␊ + ␊ + `, + } + +## table-column-style-wide-characters.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Table Column Style - Wide Characters␊ + ␊ + ## Emoji␊ + ␊ + | AB | CD |␊ + | -- | -- |␊ + | EF | GH |␊ + | ✅ | KL |␊ + | MN | ✅ |␊ + | ✅ | ✅ |␊ + ␊ + | ✅ | CD |␊ + | -- | -- |␊ + | EF | GH |␊ + | ✅ | KL |␊ + | MN | ✅ |␊ + | ✅ | ✅ |␊ + ␊ + | AB | ✅ |␊ + | -- | -- |␊ + | EF | GH |␊ + | ✅ | KL |␊ + | MN | ✅ |␊ + | ✅ | ✅ |␊ + ␊ + | ✅ | ✅ |␊ + | -- | -- |␊ + | EF | GH |␊ + | ✅ | KL |␊ + | MN | ✅ |␊ + | ✅ | ✅ |␊ + ␊ + ## Hello World␊ + ␊ + | Language | Translation |␊ + |---------------------|----------------|␊ + | Emoji | 👋🌎 |␊ + | Portuguese (Brazil) | Olá mundo |␊ + | Turkish | Merhaba dünya |␊ + | Chinese (Mandarin) | 你好,世界 |␊ + | Japanese | こんにちは世界 |␊ + | Korean | 안녕 세상 |␊ + ␊ + ## ANSI Escape Codes␊ + ␊ + | Style | Escape codes |␊ + | --------- | ------------------------------------------------------- |␊ + | Bold | \\u001B[1m大胆な\\u001B[22m |␊ + | Underline | \\u001B[4mUnderline\\u001B[0m |␊ + | Link | \\u001B]8;;https://example.com\\u0007Link\\u001B]8;;\\u0007 |␊ + ␊ + ␊ + `, + } + +## table-content-with-issues.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: '(link)[https://example.com]', + errorRange: [ + 3, + 27, + ], + fixInfo: { + deleteCount: 27, + editColumn: 3, + insertText: '[link](https://example.com)', + }, + lineNumber: 6, + ruleDescription: 'Reversed link syntax', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md', + ruleNames: [ + 'MD011', + 'no-reversed-links', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Element: hr', + errorRange: [ + 3, + 4, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Inline HTML', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md', + ruleNames: [ + 'MD033', + 'no-inline-html', + ], + severity: 'error', + }, + { + errorContext: 'https://example.com', + errorDetail: null, + errorRange: [ + 3, + 19, + ], + fixInfo: { + deleteCount: 19, + editColumn: 3, + insertText: '', + }, + lineNumber: 8, + ruleDescription: 'Bare URL used', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md', + ruleNames: [ + 'MD034', + 'no-bare-urls', + ], + severity: 'error', + }, + { + errorContext: '* e', + errorDetail: null, + errorRange: [ + 4, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 4, + }, + lineNumber: 9, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: 'g __', + errorDetail: null, + errorRange: [ + 11, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 11, + }, + lineNumber: 10, + ruleDescription: 'Spaces inside emphasis markers', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md', + ruleNames: [ + 'MD037', + 'no-space-in-emphasis', + ], + severity: 'error', + }, + { + errorContext: '` code`', + errorDetail: null, + errorRange: [ + 5, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 5, + }, + lineNumber: 11, + ruleDescription: 'Spaces inside code span elements', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md', + ruleNames: [ + 'MD038', + 'no-space-in-code', + ], + severity: 'error', + }, + { + errorContext: '[link ]', + errorDetail: null, + errorRange: [ + 8, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 8, + }, + lineNumber: 12, + ruleDescription: 'Spaces inside link text', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md', + ruleNames: [ + 'MD039', + 'no-space-in-links', + ], + severity: 'error', + }, + { + errorContext: '[link]()', + errorDetail: null, + errorRange: [ + 3, + 8, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'No empty links', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md042.md', + ruleNames: [ + 'MD042', + 'no-empty-links', + ], + severity: 'error', + }, + { + errorContext: '[link ]', + errorDetail: null, + errorRange: [ + 4, + 5, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + { + errorContext: '[link]', + errorDetail: null, + errorRange: [ + 4, + 4, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Link text should be descriptive', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md059.md', + ruleNames: [ + 'MD059', + 'descriptive-link-text', + ], + severity: 'error', + }, + ], + fixed: `# Table Content With Issues␊ + ␊ + | Content | Issue |␊ + |------------------------------|-----------------|␊ + | Text | N/A |␊ + | [link](https://example.com) | {MD011} |␊ + |
| {MD033} |␊ + | | {MD034} |␊ + | *emphasis* | {MD037} |␊ + | __strong__ | {MD037} |␊ + | \`code\` | {MD038} |␊ + | [link](https://example.com) | {MD039} {MD059} |␊ + | [link]() | {MD042} {MD059} |␊ + `, + } + +## table-issue-with-markdown-it-12.md + +> Snapshot 1 + + { + errors: [], + fixed: `# table-issue-with-markdown-it-12␊ + ␊ + | \`CLIEngine\` | \`ESLint\` |␊ + | :------------------------------------------- | :--------------------------------- |␊ + | \`executeOnFiles(patterns)\` | \`lintFiles(patterns)\` |␊ + ␊ + ␊ + `, + } + +## table-pipe-style-explicit-both.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Explicit Both␊ + ␊ + ## Style: both␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: none {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: leading {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + ␊ + ## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + ␊ + ␊ + `, + } + +## table-pipe-style-explicit-leading.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Explicit Leading␊ + ␊ + ## Style: both {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: none {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: leading␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + ␊ + ## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + ␊ + ␊ + `, + } + +## table-pipe-style-explicit-none.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Explicit None␊ + ␊ + ## Style: both {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: none␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: leading {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + ␊ + ## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + ␊ + ␊ + `, + } + +## table-pipe-style-explicit-trailing.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 5, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 6, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 7, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Explicit Trailing␊ + ␊ + ## Style: both {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: none {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: leading {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + ␊ + ## Style: trailing␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + ␊ + ␊ + `, + } + +## table-pipe-style-implicit-both.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Implicit Both␊ + ␊ + ## Style: both␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: none {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: leading {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + ␊ + ## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + `, + } + +## table-pipe-style-implicit-leading.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_only; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Implicit Leading␊ + ␊ + ## Style: leading␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + ␊ + ## Style: both {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: none {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + `, + } + +## table-pipe-style-implicit-none.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_and_trailing; Unexpected trailing pipe', + errorRange: [ + 19, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Implicit None␊ + ␊ + ## Style: none␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: both {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: leading {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + ␊ + ## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + `, + } + +## table-pipe-style-implicit-trailing.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 11, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_and_trailing; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 13, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 17, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 12, + 1, + ], + fixInfo: null, + lineNumber: 19, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 23, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Unexpected leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: trailing_only; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 14, + 1, + ], + fixInfo: null, + lineNumber: 25, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style Implicit Trailing␊ + ␊ + ## Style: trailing␊ + ␊ + Table | Heading |␊ + ----- | ------- |␊ + Cell | Cell |␊ + ␊ + ## Style: both {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading |␊ + | ----- | ------- |␊ + | Cell | Cell |␊ + ␊ + ## Style: none {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + Table | Heading␊ + ----- | -------␊ + Cell | Cell␊ + ␊ + ## Style: leading {MD055:+2} {MD055:+3} {MD055:+4}␊ + ␊ + | Table | Heading␊ + | ----- | -------␊ + | Cell | Cell␊ + `, + } + +## table-pipe-style.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 149, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 21, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 21, + }, + lineNumber: 151, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: '> {MD055} | {MD027} |', + errorDetail: null, + errorRange: [ + 3, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 3, + }, + lineNumber: 133, + ruleDescription: 'Multiple spaces after blockquote symbol', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md027.md', + ruleNames: [ + 'MD027', + 'no-multiple-space-blockquote', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 12, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 15, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 18, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 24, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 29, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 34, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 40, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 40, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 41, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 42, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 46, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 17, + 1, + ], + fixInfo: null, + lineNumber: 46, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 47, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 18, + 1, + ], + fixInfo: null, + lineNumber: 47, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 2, + 1, + ], + fixInfo: null, + lineNumber: 48, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 15, + 1, + ], + fixInfo: null, + lineNumber: 48, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 54, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 58, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 65, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 72, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 78, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 82, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 89, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 16, + 1, + ], + fixInfo: null, + lineNumber: 96, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 102, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 106, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 113, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 3, + 1, + ], + fixInfo: null, + lineNumber: 120, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe', + errorRange: [ + 1, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe', + errorRange: [ + 21, + 1, + ], + fixInfo: null, + lineNumber: 131, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe', + errorRange: [ + 5, + 1, + ], + fixInfo: null, + lineNumber: 133, + ruleDescription: 'Table pipe style', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md055.md', + ruleNames: [ + 'MD055', + 'table-pipe-style', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 2; Actual: 1; Too few cells, row will be missing data', + errorRange: [ + 20, + 1, + ], + fixInfo: null, + lineNumber: 127, + ruleDescription: 'Table column count', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md056.md', + ruleNames: [ + 'MD056', + 'table-column-count', + ], + severity: 'error', + }, + ], + fixed: `# Table Pipe Style␊ + ␊ + ␊ + ␊ + ## Missing in Header Row␊ + ␊ + | Table | {MD055}␊ + |-------|---------|␊ + ␊ + Table | {MD055} |␊ + |-------|---------|␊ + ␊ + Table | {MD055}␊ + |-------|---------|␊ + ␊ + ## Missing in Separator Row␊ + ␊ + | Table | Header |␊ + |-------|--------␊ + ␊ + {MD055:-2}␊ + ␊ + | Table | Header |␊ + -------|--------|␊ + ␊ + {MD055:-2}␊ + ␊ + | Table | Header |␊ + -------|--------␊ + ␊ + {MD055:-2}␊ + ␊ + ## Missing Leading and Trailing␊ + ␊ + {MD055} | Header␊ + ---------|--------␊ + {MD055} | Cell␊ + ␊ + {MD055:-3}␊ + ␊ + {MD055} | Header␊ + --------:|:------:␊ + {MD055} | Cell␊ + ␊ + {MD055:-3}␊ + ␊ + | Table | Header |␊ + |--------:|:-------|␊ + {MD055} | Cell␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + {MD055} | Cell␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + | Cell | Cell |␊ + {MD055} | Cell␊ + | Cell | Cell |␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + {MD055} | Cell␊ + ␊ + ## Missing Trailing␊ + ␊ + | Table | Header |␊ + |--------:|:-------|␊ + | {MD055} | Cell␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + | {MD055} | Cell␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + | Cell | Cell |␊ + | {MD055} | Cell␊ + | Cell | Cell |␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + | {MD055} | Cell␊ + ␊ + ## Missing Leading␊ + ␊ + | Table | Header |␊ + |--------:|:-------|␊ + {MD055} | Cell |␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + {MD055} | Cell |␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + | Cell | Cell |␊ + {MD055} | Cell |␊ + | Cell | Cell |␊ + ␊ + | Table | Header |␊ + |---------|--------|␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + {MD055} | Cell |␊ + ␊ + ## Followed by Text␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell |␊ + {MD055} {MD056} Text␊ + ␊ + ## Table inside Blockquote␊ + ␊ + > | Table | {MD055}␊ + > |---------|---------|␊ + > {MD055} | {MD027} |␊ + ␊ + ## Well-Formed␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell |␊ + ␊ + | Table | Header |␊ + |-------|--------|␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + | Cell | Cell |␊ + ␊ + ## Leading and Trailing Spaces␊ + ␊ + | Table | {MD009} |␊ + |-------|---------|␊ + | Cell | {MD009} |␊ + `, + } + +## texmath-content-in-lists.md + +> Snapshot 1 + + { + errors: [], + fixed: `# texmath-content-in-lists␊ + ␊ + Text␊ + ␊ + - Item␊ + $$␊ + e = mc^2␊ + $$␊ + ␊ + Text␊ + ␊ + - Item␊ + ␊ + $$␊ + e = mc^2␊ + $$␊ + ␊ + Text␊ + ␊ + - Item␊ + ␊ + $$␊ + e = mc^2␊ + e = mc^2␊ + $$␊ + ␊ + Text␊ + ␊ + - Item␊ + ␊ + $$␊ + $$␊ + ␊ + Text␊ + ␊ + - Item␊ + ␊ + - Item␊ + ␊ + $$␊ + e = mc^2␊ + $$␊ + ␊ + - Item␊ + ␊ + Text␊ + ␊ + - $$␊ + e = mc^2␊ + $$␊ + ␊ + Text␊ + ␊ + - $e = mc^2$␊ + ␊ + Text␊ + ␊ + - Item␊ + - $e = mc^2$␊ + ␊ + Text␊ + ␊ + - Item␊ + - $e = mc^2$␊ + - Item␊ + ␊ + Text␊ + `, + } + +## texmath-content.md + +> Snapshot 1 + + { + errors: [], + fixed: `# texmath-content␊ + ␊ + ## Inline␊ + ␊ + text $ x * y * z $ text␊ + ␊ + text $$ x * y * z $$ text␊ + ␊ + ## Block␊ + ␊ + $$␊ + x * y * z␊ + $$␊ + ␊ + text␊ + ␊ + $$␊ + x * y = x * y␊ + $$␊ + ␊ + ## Content␊ + ␊ + $$␊ + ␊ + Text (reversed)[link] text␊ + ␊ + Text [invalid](#link) text␊ + ␊ + Text [link](not-descriptive-link-text) text␊ + ␊ + Text javascript text␊ + ␊ + $$␊ + ␊ + Text $ (reversed)[link] $ text␊ + ␊ + Text $ [invalid](#link) $ text␊ + ␊ + Text $ [link](not-descriptive-link-text) $ text␊ + ␊ + Text $ javascript $ text␊ + ␊ + ␊ + `, + } + +## token-map-spans.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Token Map Spans␊ + ␊ + Text *emphasis* text __strong__ text \`code\` text [link](https://example.com).␊ + ␊ + Paragraph with *emphasis␊ + spanning lines* and __strong␊ + spanning lines__ and \`code␊ + spanning lines\` and [link␊ + spanning lines](https://example.com).␊ + ␊ + > Blockquote␊ + > [link](https://example.com)␊ + > > Nested␊ + > > blockquote␊ + > > [link](https://example.com)␊ + ␊ + Heading␊ + -------␊ + ␊ + \`\`\`lang␊ + Fenced␊ + code␊ + \`\`\`␊ + ␊ + Indented␊ + code␊ + ␊ + 1. List␊ + 2. List␊ + - Sub-list␊ + - Sub-list␊ + 3. List␊ + ␊ + | Table | Column 1 | Column 2 | Column 3 | Column 4 |␊ + |-------|------------|------------|----------|-----------------------------|␊ + | Text | *emphasis* | __strong__ | \`code\` | [link](https://example.com) |␊ + | Text | *emphasis* | __strong__ | \`code\` | [link](https://example.com) |␊ + ␊ + ␊ + `, + } + +## trailing-spaces-in-code-default.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 4, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 14, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 14, + }, + lineNumber: 6, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 14, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 14, + }, + lineNumber: 7, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Trailing Spaces in Code - Default␊ + ␊ + const a = 10;␊ + const b = 10;␊ + const c = 10; ␊ + const d = 10;␊ + const e = 10;␊ + ␊ + {MD009:-5} {MD009:-3} {MD009:-2}␊ + ␊ + const a = 10;␊ + const b = 10; ␊ + const c = 10; ␊ + const d = 10; ␊ + const e = 10; ␊ + ␊ + \`\`\`js␊ + const a = 10;␊ + const b = 10; ␊ + const c = 10; ␊ + const d = 10; ␊ + const e = 10; ␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## trailing-spaces-in-code-false.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 4, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 14, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 14, + }, + lineNumber: 6, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 14, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 14, + }, + lineNumber: 7, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Trailing Spaces in Code - False␊ + ␊ + const a = 10;␊ + const b = 10;␊ + const c = 10; ␊ + const d = 10;␊ + const e = 10;␊ + ␊ + {MD009:-5} {MD009:-3} {MD009:-2}␊ + ␊ + const a = 10;␊ + const b = 10; ␊ + const c = 10; ␊ + const d = 10; ␊ + const e = 10; ␊ + ␊ + \`\`\`js␊ + const a = 10;␊ + const b = 10; ␊ + const c = 10; ␊ + const d = 10; ␊ + const e = 10; ␊ + \`\`\`␊ + ␊ + ␊ + `, + } + +## trailing-spaces-in-code-true.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 4, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 14, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 14, + }, + lineNumber: 6, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 14, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 14, + }, + lineNumber: 7, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 18, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 18, + }, + lineNumber: 12, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 18, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 18, + }, + lineNumber: 14, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 18, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 18, + }, + lineNumber: 15, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 14, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 14, + }, + lineNumber: 21, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 14, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 14, + }, + lineNumber: 23, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 14, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 14, + }, + lineNumber: 24, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Trailing Spaces in Code - True␊ + ␊ + const a = 10;␊ + const b = 10;␊ + const c = 10; ␊ + const d = 10;␊ + const e = 10;␊ + ␊ + {MD009:-5} {MD009:-3} {MD009:-2}␊ + ␊ + const a = 10;␊ + const b = 10;␊ + const c = 10; ␊ + const d = 10;␊ + const e = 10;␊ + ␊ + {MD009:-5} {MD009:-3} {MD009:-2}␊ + ␊ + \`\`\`js␊ + const a = 10;␊ + const b = 10;␊ + const c = 10; ␊ + const d = 10;␊ + const e = 10;␊ + \`\`\`␊ + ␊ + {MD009:-6} {MD009:-4} {MD009:-3}␊ + ␊ + ␊ + `, + } + +## trailing-spaces-in-lists-allowed-strict.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 16, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 18, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 6', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + }, + lineNumber: 35, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 6', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + }, + lineNumber: 37, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 5', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 1, + }, + lineNumber: 50, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 57, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 58, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 60, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 61, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + 1. text␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + ␊ + {MD009:16}␊ + {MD009:18}␊ + ␊ + 1. text␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + ␊ + 1. text␊ + - text␊ + ␊ + text␊ + - text␊ + ␊ + text␊ + - text␊ + text␊ + ␊ + - text␊ + text␊ + ␊ + {MD009:35}␊ + {MD009:37}␊ + {MD009:50}␊ + ␊ + 1. text␊ + text␊ + ␊ + ␊ + 1. text␊ + ␊ + ␊ + {MD009:57}␊ + {MD009:58}␊ + {MD009:60}␊ + {MD009:61}␊ + ␊ + ␊ + `, + } + +## trailing-spaces-in-lists-allowed.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 16, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 18, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 6', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + }, + lineNumber: 35, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 6', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + }, + lineNumber: 37, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 5', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 1, + }, + lineNumber: 50, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 57, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 58, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 60, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 61, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + 1. text␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + ␊ + {MD009:16}␊ + {MD009:18}␊ + ␊ + 1. text␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + ␊ + 1. text␊ + - text␊ + ␊ + text␊ + - text␊ + ␊ + text␊ + - text␊ + text␊ + ␊ + - text␊ + text␊ + ␊ + {MD009:35}␊ + {MD009:37}␊ + {MD009:50}␊ + ␊ + 1. text␊ + text␊ + ␊ + ␊ + 1. text␊ + ␊ + ␊ + {MD009:57}␊ + {MD009:58}␊ + {MD009:60}␊ + {MD009:61}␊ + ␊ + ␊ + `, + } + +## trailing-spaces-in-lists-default.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 9, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 16, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 1, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 1, + }, + lineNumber: 18, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 6', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + }, + lineNumber: 29, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 6', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + }, + lineNumber: 36, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 6', + errorRange: [ + 1, + 6, + ], + fixInfo: { + deleteCount: 6, + editColumn: 1, + }, + lineNumber: 38, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 5', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 1, + }, + lineNumber: 44, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 5', + errorRange: [ + 1, + 5, + ], + fixInfo: { + deleteCount: 5, + editColumn: 1, + }, + lineNumber: 51, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# Heading␊ + ␊ + 1. text␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + ␊ + {MD009:9}␊ + {MD009:16}␊ + {MD009:18}␊ + ␊ + 1. text␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + ␊ + text␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + text␊ + ␊ + 1. text␊ + ␊ + 1. text␊ + - text␊ + ␊ + text␊ + - text␊ + ␊ + text␊ + - text␊ + text␊ + ␊ + - text␊ + text␊ + ␊ + {MD009:29}␊ + {MD009:36}␊ + {MD009:38}␊ + {MD009:44}␊ + {MD009:51}␊ + `, + } + +## trailing_spaces_br.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 46, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 46, + }, + lineNumber: 3, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 3', + errorRange: [ + 44, + 3, + ], + fixInfo: { + deleteCount: 3, + editColumn: 44, + }, + lineNumber: 5, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 4', + errorRange: [ + 43, + 4, + ], + fixInfo: { + deleteCount: 4, + editColumn: 43, + }, + lineNumber: 6, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 1', + errorRange: [ + 1, + 1, + ], + fixInfo: { + deleteCount: 1, + editColumn: 1, + }, + lineNumber: 7, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + severity: 'error', + }, + ], + fixed: `# trailing_spaces_br␊ + ␊ + This line has a single trailing space {MD009}␊ + This line has two trailing spaces and should be allowed ␊ + This line has three trailing spaces {MD009}␊ + This line has four trailing spaces {MD009}␊ + ␊ + {MD009:7}␊ + `, + } + +## unclosed-html-comment-in-code-span.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Heading␊ + ␊ + \`␊ + `, + } diff --git a/test/snapshots/markdownlint-test-scenarios.mjs.snap b/test/snapshots/markdownlint-test-scenarios.mjs.snap new file mode 100644 index 00000000..7ec9f46c Binary files /dev/null and b/test/snapshots/markdownlint-test-scenarios.mjs.snap differ diff --git a/test/spaces-inside-emphasis-markers-multiple-lines.md b/test/spaces-inside-emphasis-markers-multiple-lines.md new file mode 100644 index 00000000..41b6d5b6 --- /dev/null +++ b/test/spaces-inside-emphasis-markers-multiple-lines.md @@ -0,0 +1,129 @@ +# Space Inside Emphasis Markers, Multiple Lines + +Text *emphasis +emphasis* text + +Text *emphasis* *emphasis +emphasis* *emphasis* text + +Text *emphasis* text *emphasis +emphasis* text *emphasis* text + +Text *emphasis* *emphasis +emphasis* *emphasis* *emphasis +emphasis* text *emphasis +emphasis* text *emphasis* text + +Text text +text *emphasis +emphasis emphasis +emphasis* text +text text + +Text * asterisk + +Text * asterisk + +* Item *emphasis* item +* Item *emphasis* item +* Item *emphasis + emphasis* item +* Item *emphasis* item + +* Item * asterisk +* Item * asterisk + +Text * emphasis {MD037} +emphasis* text + +Text *emphasis +emphasis * text {MD037} + +Text * emphasis {MD037} +emphasis * text {MD037} + +Text *emphasis * *emphasis +emphasis* * emphasis* text + +Text *emphasis* * emphasis {MD037} +emphasis * *emphasis* text {MD037} + +Text * emphasis * * emphasis {MD037} +emphasis * * emphasis * text {MD037} + +Text text +text * emphasis {MD037} +emphasis emphasis +emphasis * text {MD037} +text text + +* Item *emphasis* item +* Item * emphasis {MD037} + emphasis* item +* Item *emphasis + emphasis * item {MD037} +* Item * emphasis {MD037} + emphasis * item {MD037} +* Item *emphasis* item +* Item item item + item * emphasis * item {MD037} + +Text * emphasis {MD037} +emphasis * text {MD037} + +Text ** bold {MD037} +bold ** text {MD037} + +Emphasis `inside +of * code * +blocks` is okay. + +Emphasis `* inside` +code +`blocks *` is okay. + +Emphasis `inside *` +code +`* blocks` is okay. + +Emphasis `inside +_ code _ +blocks` is okay. + +Emphasis `_ inside` +code +`blocks _` is okay. + +Emphasis `inside _` +code +`_ blocks` is okay. + +Mixed `code_span` +scenarios +are _also_ okay. {MD049} + +Mixed `code*span` +scenarios +are *also* okay. + +This paragraph +contains *a* mix +of `*` emphasis +scenarios and *should* +not trigger `*` any +violations at *all*. + +This paragraph +contains `a * slightly +more complicated +multi-line emphasis +scenario * that +should * not trigger +violations * either`. + + +*text +```text +``` +text * + diff --git a/test/spaces-inside-link-text.md b/test/spaces-inside-link-text.md new file mode 100644 index 00000000..aba63ed7 --- /dev/null +++ b/test/spaces-inside-link-text.md @@ -0,0 +1,21 @@ +# Spaces Inside Link Text + +[ link ](https://example.com/) {MD039} + +[ "link" ](https://example.com/) {MD039} + +[ `link` ](https://example.com/) {MD039} + +[ *link* ](https://example.com/) {MD039} + +[ __link__ ](https://example.com/) {MD039} + +[ link "link" ](https://example.com/) {MD039} + +[ link `link` ](https://example.com/) {MD039} + +[ *link* link ](https://example.com/) {MD039} + + \ No newline at end of file diff --git a/test/spaces_after_list_marker.json b/test/spaces_after_list_marker.json deleted file mode 100644 index c4004d43..00000000 --- a/test/spaces_after_list_marker.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "default": true, - "MD007": { - "indent": 4 - }, - "MD030": { - "ul_multi": 3, - "ol_multi": 2 - } -} diff --git a/test/spaces_after_list_marker.md b/test/spaces_after_list_marker.md index f9eee739..f02df0b2 100644 --- a/test/spaces_after_list_marker.md +++ b/test/spaces_after_list_marker.md @@ -1,3 +1,5 @@ +# spaces_after_list_marker + Normal list * Foo @@ -34,7 +36,7 @@ List with multiple paragraphs and incorrect spacing * Foo {MD030} - Here is the second paragraph + Here is the second paragraph * Bar {MD030} @@ -72,3 +74,13 @@ the first item determining that the entire list has children: 1. Bar * Hi 1. Baz + + diff --git a/test/spaces_inside_codespan_elements.md b/test/spaces_inside_codespan_elements.md index 9f34fd3d..53830f37 100644 --- a/test/spaces_inside_codespan_elements.md +++ b/test/spaces_inside_codespan_elements.md @@ -1,7 +1,173 @@ +# spaces_inside_codespan_elements + `normal codespan element` ` codespan element with space inside left` {MD038} `codespan element with space inside right ` {MD038} -` codespan element with spaces inside ` {MD038} +` codespan element with spaces inside ` (allowed per spec) + +empty `` codespan element + +single space ` ` codespan element + +`,`, `.` + +`,`, `code` + +`[`, `(`, `+`, `*`, `/`, `-`, `,`, `.` + +`code` code `anything` + +text `code` code `anything` text + +text `code` text `anything` code `end` + +text `anything` code `code` text `end` + +text `anything` text `anything` code `anything` `code` + +text ``code`` text ``code`` text + +text `` code`` text {MD038} + +text ``code `` text {MD038} + +text ```code``` text ```code``` text + +text ```code``` text `` code`` text {MD038} + +text ```code``` text ``code `` text {MD038} + +``embedded ` backtick`` text `code` + +`backslash does not escape \` backtick in code span ` + +escaped \` backtick is ignored outside `code span` + +`code` then escaped \` backtick + +``code`` then escaped \` backtick then `code` + +multiple \` escaped backticks \` in text + +\` escaped backtick \` at start of text + +text and ``\`code with ignored escaped \` backticks`` + +`` ` `` text `code` + +` `` ` text `code` + +``` ` surrounding space allowed for backtick ``` text `code` + +``` ` multiple leading spaces not allowed``` text `code` {MD038} + +`` surrounding space allowed for backtick ` `` text `code` + +``multiple trailing spaces not allowed ` `` text `code` {MD038} + +`` ` leading and trailing space allowed for backtick ` `` text `code` + +Text [link](https://example.com/link`link) text `code`. + +Text [link](https://example.com/link```link) text ```code```. + +Text [link](https://example.com/link`link`link`link) text `code`. + +Text [link](https://example.com/link "title`title") text `code`. + +Text [link](#link`link) text `code`. {MD051} + +Text [link] (#link`link) text `code`. {MD038} + +Text [link[link](#link`link) text `code`. {MD051} + +Text [link(link](#link`link) text `code`. {MD051} + +Text [link)link](#link`link) text `code`. {MD051} + +Text [link](#link[link`link) text `code`. {MD051} + +Text [link](#link]link`link) text `code`. {MD051} + +Text [link](#link(link`link) text `code`. {MD038} + +Text [`link`](xref:custom.link`1) text `code`. + +Text ``code [link](#link`link) code`` text `code`. + +No space, start or end: `code` + +Start space, no end space: ` code` {MD038} + +No start space, end space: `code ` {MD038} + +Single start and end space: ` code ` (explicitly allowed/trimmed by the specification) + +All spaces: ` ` ` ` ` ` ` ` + +All line endings: ` +` + +Double start and single end space: ` code ` {MD038} + +Single start and double end spaces: ` code ` {MD038} + +Double start and end spaces: ` code ` {MD038} + +Spaces before and after: ` codecode ` +As above, with an internal space: ` code code ` +As above, practical example with a backtick: `` Ctrl + ` `` +As above, no internal space: `` Ctrl+` `` +Again, 3 characters: ` abc ` +Again, 2 characters: ` ab ` +Again, 1 character: ` a ` +Many internal spaces: ` code code code code code code ` + +text ``` ` surrounding space +allowed for backtick ``` text + +text ``` ` multiple leading {MD038} +spaces not allowed``` text + +text `` surrounding space +allowed for backtick ` `` text + +text ``multiple trailing spaces +not allowed ` `` text {MD038} + +text `` ` leading and trailing +space allowed for backtick ` `` text + + + +Text +``` +Code +``` + +Text + ``` + Code {MD038} + ``` + +Text + ``` +Code + ``` + +Text + ``` + Code {MD038} + ``` +Text + +Text + ``` +Code + ``` +Text + + diff --git a/test/spaces_inside_emphasis_markers.md b/test/spaces_inside_emphasis_markers.md index e2c95115..c93471d4 100644 --- a/test/spaces_inside_emphasis_markers.md +++ b/test/spaces_inside_emphasis_markers.md @@ -1,27 +1,43 @@ +# Heading + + + Line with *Normal emphasis* Line with **Normal strong** +Line with ***Normal strong and emphasis*** + Line with _Normal emphasis_ Line with __Normal strong__ +Line with ___Normal strong and emphasis___ + Broken * emphasis * with spaces in {MD037} Broken ** strong ** with spaces in {MD037} +Broken *** strong and emphasis *** with spaces in {MD037} + Broken _ emphasis _ with spaces in {MD037} Broken __ strong __ with spaces in {MD037} +Broken ___ strong and emphasis ___ with spaces in {MD037} + Mixed *ok emphasis* and * broken emphasis * {MD037} Mixed **ok strong** and ** broken strong ** {MD037} +Mixed ***ok strong and emphasis*** and *** broken strong and emphasis *** {MD037} + Mixed _ok emphasis_ and _ broken emphasis _ {MD037} Mixed __ok strong__ and __ broken strong __ {MD037} +Mixed ___ok strong and emphasis___ and ___ broken strong and emphasis ___ {MD037} + Mixed *ok emphasis* **ok strong** * broken emphasis * {MD037} Multiple * broken emphasis * _ broken emphasis _ {MD037} @@ -30,6 +46,348 @@ One-sided *broken emphasis * {MD037} One-sided * broken emphasis* {MD037} -Don't _flag on _words with underscores before them. +Will _flag on _words with underscores before them. {MD037} -The same goes for words* with asterisks* after them. +The same goes for words* with asterisks* after them. {MD037} + +But not with escaped\* asterisks\* \_and \_underscores. + +* Emphasis* with left space is recognized as a list + +** Strong** with left space {MD037} + +*** Strong and emphasis*** with left space {MD037} + +_ Emphasis_ with left space {MD037} + +__ Strong__ with left space {MD037} + +___ Strong and emphasis___ with left space {MD037} + +*Emphasis * with right space {MD037} + +**Strong ** with right space {MD037} + +***Strong and emphasis *** with right space {MD037} + +_Emphasis _ with right space {MD037} + +__Strong __ with right space {MD037} + +___Strong and emphasis ___ with right space {MD037} + +{MD037} Left space * emphasis* + +{MD037} Left space ** strong** + +{MD037} Left space *** strong and emphasis*** + +{MD037} Left space _ emphasis_ + +{MD037} Left space __ strong__ + +{MD037} Left space ___ strong and emphasis___ + +{MD037} Right space *emphasis * + +{MD037} Right space **strong ** + +{MD037} Right space ***strong and emphasis *** + +{MD037} Right space _emphasis _ + +{MD037} Right space __strong __ + +{MD037} Right space ___strong and emphasis ___ + +**Multiple ** spaces **in ** emphasis **at ** once. {MD037} + +**Multiple ** spaces ** in** emphasis ** at ** once. {MD037} + +This is * an ambiguous * scenario {MD037} + +* List item *with emphasis* on the + first and *second lines*. +* List * item* {MD037} +* List *item * {MD037} +* List * item * {MD037} +* List item with + *hanging* emphasis + and * some* lines {MD037} + with *space * problems {MD037} + throughout * the * content {MD037} + +Uncommon scenarios from the CommonMark specification (and some variations): +***strong emph*** +***strong** in emph* +***emph* in strong** +**in strong *emph*** +*in emph **strong*** + +*** strong emph*** {MD037} + +*** strong** in emph* {possible MD037} + +*** emph* in strong** {possible MD037} + +** in strong *emph*** {MD037} + +***strong emph *** {MD037} + +***strong** in emph * {MD037} + +***emph* in strong ** {MD037} + +**in strong *emph *** {possible MD037} + +*in emph **strong *** {possible MD037} + +** *strong emph*** {MD037} + +** *strong** in emph* {MD037} + +** *emph* in strong** {MD037} + +**in strong * emph*** (internal spaces are not detected) + +*in emph ** strong*** (internal spaces are not detected) + +***strong emph* ** {MD037} + +***strong ** in emph* (internal spaces are not detected) + +***emph * in strong** (internal spaces are not detected) + +**in strong *emph* ** {MD037} + +*in emph **strong* ** {MD037} + +Text *emph***strong** text + +Text * emph***strong** text {MD037} + +Text *emph ***strong** text {MD037} + +Text *emph*** strong** text {MD037} + +Text *emph***strong ** text {MD037} + +```markdown +Violations * are * allowed in code blocks where emphasis does not apply. +``` + +Emphasis `inside * code * blocks` is okay. + +Emphasis `* inside` code `blocks *` is okay. + +Emphasis `inside *` code `* blocks` is okay. + +Emphasis `inside _ code _ blocks` is okay. + +Emphasis `_ inside` code `blocks _` is okay. + +Emphasis `inside _` code `_ blocks` is okay. + +Mixed `code_span` scenarios are _also_ okay. + +Mixed `code*span` scenarios are *also* okay. + +Mixed `code*span` scenarios are _also_ okay. + +Mixed `code_span` scenarios are *also* okay. + +[Link](under_score) followed by _underscore_ + +[Link](un_der_score) followed by _underscore_ + +[Link](un_der_sco_re) followed by _underscore_ + +[Link](star*star) followed by *star* + +* [Link](star*star) followed by *star* + +Text [Link](under_score) text _underscore_ text [Link](st*ar) text *star* text + +[Link [link] link](under_score) followed by _underscore_ + +**under_score** text *under_score* + +*under_score* text **under_score** + +__star*star__ text _star*star_ + +_star*star_ text __star*star__ + +*_emphasis* text *emphasis* + +*emphasis_* text *emphasis* + +*emphasis* text *_emphasis* + +*emphasis* text *emphasis_* + +text \\*emphasis* text *emphasis* text + +text *emphasis\\* text *emphasis* text + +text *emphasis* text \\*emphasis* text + +text *emphasis* text *emphasis\\* text + +text *star*_underscore_ text **star**_underscore_ text + +text **star**_underscore_ text *star*_underscore_ text + +text **star**_underscore_ text **star**_underscore_ text + +text *star*_underscore_ text *star*__underscore__ text + +text *star*__underscore__ text *star*_underscore_ text + +text *star*__underscore__ text *star*__underscore__ text + +text _underscore_*star* text __underscore__*star* text + +text __underscore__*star* text _underscore_*star* text + +text __underscore__*star* text __underscore__*star* text + +text _underscore_*star* text _underscore_**star** text + +text _underscore_**star** text _underscore_*star* text + +text _underscore_**star** text _underscore_**star** text + +> * List with *emphasis* in blockquote +> +> > * List with *emphasis* in blockquote + +`* text *` + +`** text **` + +`*** text ***` + +`**** text ****` + +`***** text *****` + +`****** text ******` + +`******* text *******` + +under_score +_underscore_ + +st*ar +*star* + +under_score +*star* + +st*ar +_underscore_ + +*star* +_underscore_ + +_underscore_ +*star* + +_underscore +_*star* + +*star +*_underscore_ + +[reference_link] +_first_ and _second_ + +[reference_link] +*first* and *second* + +[reference*link] +_first_ and _second_ + +[reference*link] +*first* and *second* + +text [reference_link] under _ score text + +text [reference*link] star * star text + +[reference_link]: https://example.com +[reference*link]: https://example.com + +***text +*text* +*** + +*** text +*text* +*** + +*** text +\*text\* +*** + +*** text +**text** +*** + +| Table | Table | +| ----- | ----- | +| star | x * y | +| under | x _ y | + +| Table | Table | +| ----- | ----- | +| star | x * y | +| star | x * y | +| under | x _ y | +| under | x _ y | + +| Table | Table | +| ----- | ------------------------- | +| star | text *text* text | +| star | text * text* text {MD037} | +| star | text *text * text {MD037} | +| under | text _text_ text | +| under | text _ text_ text {MD037} | +| under | text _text _ text {MD037} | + +| Table | Table | +| ----- | ----- | +| x * y | x * y | +| x** y | x** y | +| x _ y | x _ y | +| x__ y | x__ y | + +```yaml /* autogenerated */ +# YAML... +``` + +new_value from *old_value* and *older_value*. + +:ballot_box_with_check: _Emoji syntax_ + +some_snake_case_function() is _called_ + +_~/.ssh/id_rsa_ and _emphasis_ + +Partial *em*phasis of a *wo*rd. + +Emphasis inside * HTML * content {MD033} {MD037} + +

{MD033} +Emphasis inside * HTML * content +

+ +Emphasis

{MD033} + +Emphasis inside * attribute * content {MD033} + +Emphasis

* HTML *

{MD033} {MD037} + +Embedded underscore is okay: +Text _emphas_i_s_ text _emphasis_ diff --git a/test/spaces_inside_link_text.md b/test/spaces_inside_link_text.md index 5cbb9bd5..41932da0 100644 --- a/test/spaces_inside_link_text.md +++ b/test/spaces_inside_link_text.md @@ -1,10 +1,111 @@ -[foo](http://bar/) +# Spaces Inside Link Text -[foo ](http://bar/) {MD039} +[](http://bar/) -[ foo](http://bar/) {MD039} +[foo](https://bar/) -[ foo ](http://bar/) {MD039} +["foo"](https://bar/) + +[`foo`](https://bar/) + +[*foo*](https://bar/) + +[__foo__](https://bar/) + +[foo "bar"](https://baz/) + +[ ](https://bar/) {MD039} + +[foo ](https://bar/) {MD039} + +[ foo](https://bar/) {MD039} + +[ foo ](https://bar/) {MD039} + +[ "foo" ](https://bar/) {MD039} + +[ `foo` ](https://bar/) {MD039} + +[ *foo* ](https://bar/) {MD039} + +[ __foo__ ](https://bar/) {MD039} The following shouldn't break anything: [![Screenshot.png](/images/Screenshot.png)](/images/Screenshot.png) + +function CodeButNotCode(input) { + return input.replace(/[- ]([a-z])/g, "one"); // {MD039} +} + +function MoreCodeButNotCode(input) { + input = input.replace(/[- ]([a-z])/g, "two"); // {MD039} + input = input.toLowerCase(); + input = input.replace(/[- ]([a-z])/g, "three"); // {MD039} + return input; +} + +[Links](ending) +[with](spaces) +[error ]({MD039}) + +Non-wrapped [ link with leading space](https://example.com) {MD039} + +Non-wrapped [link with trailing space ](https://example.com) {MD039} + +Non-wrapped [ link with leading and trailing space ](https://example.com) {MD039} + +Wrapped [ + link with leading space](https://example.com) {MD039} + +Wrapped [ +link with leading space](https://example.com) {MD009:-1} {MD039:-1} + +Wrapped [link with trailing space +](https://example.com) {MD009:-1} {MD039:-1} + +Wrapped [link with trailing space + ](https://example.com) {MD039} + +Wrapped [ +link with leading and trailing space + ](https://example.com) {MD009:-2} {MD039:-2} {MD039} + +Wrapped [ + link with leading and trailing space +](https://example.com) {MD009:-1} {MD039:-1} + +[][ref] + +[link][ref] + +[link ][ref] {MD039} + +[ link][ref] {MD039} + +[ link ][ref] {MD039} + +[ref] + +[ref ] {MD039} + +[ ref] {MD039} + +[ ref ] {MD039} + +[ref][] + +[ref ][] {MD039} + +[ ref][] {MD039} + +[ ref ][] {MD039} + +[ref]: https://example.com + +Not a link, just [ text in ] brackets + +Images are ![ not links ](image.jpg) + + \ No newline at end of file diff --git a/test/strong_style_asterisk.md b/test/strong_style_asterisk.md new file mode 100644 index 00000000..b08dd21f --- /dev/null +++ b/test/strong_style_asterisk.md @@ -0,0 +1,25 @@ +# Strong style asterisk + +**This** is fine + +This **is** fine + +This is **fine** + +__This__ is not + +This __is__ not + +This is __not__ + +{MD050:-2} {MD050:-4} {MD050:-6} + +Internal emphasis is preserved: +apple**banana**cherry, apple**banana**, **banana**cherry +apple__banana__cherry, apple__banana__, __banana__cherry + + diff --git a/test/strong_style_underscore.md b/test/strong_style_underscore.md new file mode 100644 index 00000000..d9e6e4c5 --- /dev/null +++ b/test/strong_style_underscore.md @@ -0,0 +1,25 @@ +# Strong style underscore + +__This__ is fine + +This __is__ fine + +This is __fine__ + +**This** is not + +This **is** not + +This is **not** + +{MD050:-2} {MD050:-4} {MD050:-6} + +Internal emphasis is preserved: +apple**banana**cherry, apple**banana**, **banana**cherry +apple__banana__cherry, apple__banana__, __banana__cherry + + diff --git a/test/sublist-bullet-style.md b/test/sublist-bullet-style.md new file mode 100644 index 00000000..7e66cd52 --- /dev/null +++ b/test/sublist-bullet-style.md @@ -0,0 +1,81 @@ +# sublist-bullet-style + +1. item + 1. item + + item + 1. item + - item {MD004} + +- item + * item + + item + - item + + item + * item +- item + * item + + item + - item + ++ item {MD004} + + item {MD004} + + item + + item {MD004} + +- item + * item + * item {MD004} + - item + * item + ++ item {MD004} + - item {MD004} + * item {MD004} + +- item + 1. item + + item + 1. item + * item + +1. item + * item + +- item + * item + + item + - item + * item + * item {MD004} + + item {MD004} + +- item + * item + + item + - item + * item + - item + + item {MD004} + +- item + * item + + item + - item + * item + - item + - item {MD004} + +- item + * item + + item + - item + * item + - item + + item + + item {MD004} + + diff --git a/test/table-column-count.md b/test/table-column-count.md new file mode 100644 index 00000000..79cbb4a4 --- /dev/null +++ b/test/table-column-count.md @@ -0,0 +1,141 @@ +# Table Column Count + +## Expected + +| Table | +|-------| +| Cell | +| Cell | +| Cell | + +| Table | Header | +|-------|--------| +| Cell | Cell | +| Cell | Cell | +| Cell | Cell | + +| Table | Header | Header | +|-------|--------|--------| +| Cell | Cell | Cell | +| Cell | Cell | Cell | +| Cell | Cell | Cell | + + Table | Header +-------|-------- + Cell | Cell + +{MD055:-4} {MD055:-3} {MD055:-2} + + | Table | Header | + |-------|--------| + | Cell | Cell | + +{MD009:-4} {MD009:-3} {MD009:-2} + +## Blank + +| Table | +|-------| +| | +| Cell | + +| Table | Header | Header | +|-------|--------|--------| +| | Cell | Cell | +| Cell | | Cell | +| Cell | Cell | | +| | | | + +## Too Few + +| Table | Header | +|-------|--------| +| Cell | +| Cell | Cell | +| Cell | + +{MD056:-4} {MD056:-2} + +| Table | Header | Header | +|-------|--------|--------| +| Cell | +| Cell | Cell | +| Cell | Cell | Cell | + +{MD056:-4} {MD056:-3} + + Table | Header +-------|-------- + Cell + +{MD055:-4} {MD055:-3} {MD055:-2} {MD056:-2} + + | Table | Header | + |-------|--------| + | Cell | + +{MD009:-4} {MD009:-3} {MD009:-2} {MD056:-2} + +## Too Many + +| Table | +|-------| +| Cell | +| Cell | Cell | +| Cell | + +{MD056:-3} + +| Table | Header | +|-------|--------| +| Cell | Cell | Cell | Cell | +| Cell | Cell | Cell | +| Cell | Cell | + +{MD056:-4} {MD056:-3} + +| Table | Header | Header | +|-------|--------|--------| +| Cell | Cell | Cell | Cell | +| Cell | Cell | Cell | +| Cell | Cell | Cell | Cell | Cell | + +{MD056:-4} {MD056:-2} + + Table | Header +-------|-------- + Cell | Cell | Cell + +{MD055:-4} {MD055:-3} {MD055:-2} {MD056:-2} + + | Table | Header | + |-------|--------| + | Cell | Cell | Cell | + +{MD009:-4} {MD009:-3} {MD009:-2} {MD056:-2} + +## Mixed + +| Table | +|-------| +| Cell | Cell | +| Cell | +| Cell | Cell | + +{MD056:-4} {MD056:-2} + +| Table | Header | +|-------|--------| +| Cell | Cell | Cell | +| Cell | +| Cell | Cell | + +{MD056:-4} {MD056:-3} + +| Table | Header | Header | +|-------|--------|--------| +| Cell | Cell | Cell | +| Cell | Cell | Cell | Cell | +| Cell | + +{MD056:-3} {MD056:-2} diff --git a/test/table-column-style-aligned-delimiter.md b/test/table-column-style-aligned-delimiter.md new file mode 100644 index 00000000..dbc37f74 --- /dev/null +++ b/test/table-column-style-aligned-delimiter.md @@ -0,0 +1,112 @@ +# Table Column Style - Aligned Delimiter + +## Aligned / Edge Pipes + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | + +## Aligned / No Edge Pipes + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text +Text | Text text | Text +Text | Text text | Text + +## Compact / Edge Pipes + +| Heading | Heading | Heading | +| ------- | ------- | ------- | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +| Heading | Heading | Heading | +| - | - | - | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +{MD060:-5} + +| Heading | Heading | Heading | +| ------- | -------- | ------ | +| Text text | Text text text | Text | + +{MD060:-3} + +## Compact / No Edge Pipes + +Heading | Heading | Heading +------- | ------- | ------- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +Heading | Heading | Heading +-- | -- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-5} + +Heading | Heading | Heading +------- | -------- | ------ +Text text | Text text text | Text + +{MD060:-3} + +## Tight / Edge Pipes + +|Heading|Heading|Heading| +|-------|-------|-------| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +|Heading|Heading|Heading| +|-|-|-| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +{MD060:-5} + +|Heading|Heading|Heading| +|-------|--------|------| +|Text text|Text text text|Text| + +{MD060:-3} + +## Tight / No Edge Pipes + +Heading|Heading|Heading +-------|-------|------- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +Heading|Heading|Heading +-|-|- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +{MD060:-5} + +Heading|Heading|Heading +-------|--------|------ +Text text|Text text text|Text + +{MD060:-3} + + diff --git a/test/table-column-style-aligned.md b/test/table-column-style-aligned.md new file mode 100644 index 00000000..1cc12c61 --- /dev/null +++ b/test/table-column-style-aligned.md @@ -0,0 +1,144 @@ +# Table Column Style - Aligned + +## Aligned / Edge Pipes + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | + +| Heading | Heading | Heading | +| ------- | -------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text tex | Text | + +{MD060:-5} {MD060:-3} {MD060:-2} + +## Aligned / No Edge Pipes + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text +Text | Text text | Text +Text | Text text | Text + +Heading | Heading | Heading +------- | -------- | -------- +Text | Text text | Text +Text | Text text | Text +Text | Text tex | Text + +{MD060:-5} {MD060:-3} {MD060:-2} + +## Compact / Edge Pipes + +| Heading | Heading | Heading | +| ------- | ------- | ------- | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +{MD060:-4} {MD060:-3} {MD060:-2} + +| Heading | Heading | Heading | +| - | - | - | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +{MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +| Heading | Heading | Heading | +| - | --- | - | +| Text | Text text | Text | +| Text | Text | Text | +| Text | Text | Text | + +{MD060:-4} {MD060:-3} {MD060:-2} + +## Compact / No Edge Pipes + +Heading | Heading | Heading +------- | ------- | ------- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-4} {MD060:-3} {MD060:-2} + +Heading | Heading | Heading +-- | -- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading | Heading | Heading +-- | --- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Tight / Edge Pipes + +|Heading|Heading|Heading| +|-------|-------|-------| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +{MD060:-4} {MD060:-3} {MD060:-2} + +|Heading|Heading|Heading| +|-|-|-| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +{MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +|Heading|Heading |Heading| +|-------|-------|------- | +| Text|Text text |Text| +|Text text |Text text text|Text| +|Text| Text |Text| + +{MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Tight / No Edge Pipes + +Heading|Heading|Heading +-------|-------|------- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +{MD060:-4} {MD060:-3} {MD060:-2} + +Heading|Heading|Heading +-|-|- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +{MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading|Heading |Heading +-------|-------| ------- +Text |Text text|Text +Text text|Text text text|Text +Text| Text |Text + +{MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + + diff --git a/test/table-column-style-compact.md b/test/table-column-style-compact.md new file mode 100644 index 00000000..071a6f32 --- /dev/null +++ b/test/table-column-style-compact.md @@ -0,0 +1,140 @@ +# Table Column Style - Compact + +## Aligned / Edge Pipes + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | + +{MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2} + +| Heading | Heading | Heading | +| ------- | -------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text tex | Text | + +{MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2} + +## Aligned / No Edge Pipes + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text +Text | Text text | Text +Text | Text text | Text + +{MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading | Heading | Heading +------- | -------- | -------- +Text | Text text | Text +Text | Text text | Text +Text | Text tex | Text + +{MD060:-6} {MD060:-4} {MD060:-3} {MD060:-2} + +## Compact / Edge Pipes + +| Heading | Heading | Heading | +| ------- | ------- | ------- | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +| Heading | Heading | Heading | +| - | - | - | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +| Heading | Heading | Heading | +| - | --- | - | +| Text | Text text | Text | +| Text | Text | Text | +| Text | Text | Text | + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Compact / No Edge Pipes + +Heading | Heading | Heading +------- | ------- | ------- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +Heading | Heading | Heading +-- | -- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +Heading | Heading | Heading +-- | --- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2} + +## Tight / Edge Pipes + +|Heading|Heading|Heading| +|-------|-------|-------| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +|Heading|Heading|Heading| +|-|-|-| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +|Heading|Heading |Heading| +|-------|-------|------- | +| Text|Text text |Text| +|Text text |Text text text|Text| +|Text| Text |Text| + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Tight / No Edge Pipes + +Heading|Heading|Heading +-------|-------|------- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading|Heading|Heading +-|-|- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading|Heading |Heading +-------|-------| ------- +Text |Text text|Text +Text text|Text text text|Text +Text| Text |Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + + diff --git a/test/table-column-style-default.md b/test/table-column-style-default.md new file mode 100644 index 00000000..1034f04d --- /dev/null +++ b/test/table-column-style-default.md @@ -0,0 +1,125 @@ +# Table Column Style - Default + +## Aligned / Edge Pipes + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | + +| Heading | Heading | Heading | +| ------- | -------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text tex | Text | + +{MD060:-5} {MD060:-3} {MD060:-2} + +## Aligned / No Edge Pipes + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text +Text | Text text | Text +Text | Text text | Text + +Heading | Heading | Heading +------- | -------- | -------- +Text | Text text | Text +Text | Text text | Text +Text | Text tex | Text + +{MD060:-5} {MD060:-3} {MD060:-2} + +## Compact / Edge Pipes + +| Heading | Heading | Heading | +| ------- | ------- | ------- | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +| Heading | Heading | Heading | +| - | - | - | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +| Heading | Heading | Heading | +| - | --- | - | +| Text | Text text | Text | +| Text | Text | Text | +| Text | Text | Text | + +{MD060:-4} {MD060:-3} {MD060:-2} + +## Compact / No Edge Pipes + +Heading | Heading | Heading +------- | ------- | ------- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +Heading | Heading | Heading +-- | -- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +Heading | Heading | Heading +-- | --- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2} + +## Tight / Edge Pipes + +|Heading|Heading|Heading| +|-------|-------|-------| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +|Heading|Heading|Heading| +|-|-|-| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +|Heading|Heading |Heading| +|-------|-------|------- | +| Text|Text text |Text| +|Text text |Text text text|Text| +|Text| Text |Text| + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Tight / No Edge Pipes + +Heading|Heading|Heading +-------|-------|------- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +Heading|Heading|Heading +-|-|- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +Heading|Heading |Heading +-------|-------| ------- +Text |Text text|Text +Text text|Text text text|Text +Text| Text |Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2} + + diff --git a/test/table-column-style-emoji.md b/test/table-column-style-emoji.md new file mode 100644 index 00000000..7fc0ffc5 --- /dev/null +++ b/test/table-column-style-emoji.md @@ -0,0 +1,31 @@ +# Table Column Style - Emoji + +## Aligned + +| Response | Emoji | +| -------- | ----- | +| Yes | ✅ | +| No | ❎ | +| Oops | ❌ | + +{MD060:-2} + +## Compact + +| Response | Emoji | +| --- | --- | +| Yes | ✅ | +| No | ❎ | +| Oops | ❌ | + +{MD060:-2} + +## Tight + +|Response|Emoji| +|---|---| +|Yes|✅| +|No|❎| +|Oops|❌ | + +{MD060:-2} diff --git a/test/table-column-style-irregular-trailing-pipe.md b/test/table-column-style-irregular-trailing-pipe.md new file mode 100644 index 00000000..0a36e24d --- /dev/null +++ b/test/table-column-style-irregular-trailing-pipe.md @@ -0,0 +1,104 @@ +# Table Column Style - Irregular Trailing Pipe + +## Aligned / Edge Pipes + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text | Text text | +| Text | Text text | Text | + +{MD060:-3} + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text text text | +| Text | Text | Text | +| Text | Text text | Text text | + +{MD060:-2} {MD060:-4} + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text text text | +| Text | Text text | Text text | + +{MD060:-2} {MD060:-3} + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text | Text | +| Text | Text text | Text | + +{MD060:-3} + +| Heading | Heading | Heading | +| ------- | --------- | ---- | +| Text | Text text | Text | +| Text | Text text | Text | + +{MD060:-2} {MD060:-3} {MD060:-4} + +| Heading | Heading | Heading | +| ------- | --------- | ----------- | +| Text | Text text | Text text | +| Text | Text text | Text text | + +{MD060:-4} + +| Heading | Heading | +| ------- | ------- | +| Text | Text | +| Text | Text text text text | +| Text | Text text text text text | + +{MD060:-2} {MD060:-3} + +## Aligned / No Edge Pipes + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text +Text | Text | Text text +Text | Text text | Text + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text text text +Text | Text | Text +Text | Text text | Text text + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text text text +Text | Text text | Text text + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text +Text | Text | Text +Text | Text text | Text + +Heading | Heading | Heading +------- | --------- | ---- +Text | Text text | Text +Text | Text text | Text + +Heading | Heading | Heading +------- | --------- | --------- +Text | Text text | Text +Text | Text text | Text + +Heading | Heading +------- | ------- +Text | Text +Text | Text text text text +Text | Text text text text text + + diff --git a/test/table-column-style-tight.md b/test/table-column-style-tight.md new file mode 100644 index 00000000..85e952d1 --- /dev/null +++ b/test/table-column-style-tight.md @@ -0,0 +1,140 @@ +# Table Column Style - Tight + +## Aligned / Edge Pipes + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +| Heading | Heading | Heading | +| ------- | -------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text tex | Text | + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Aligned / No Edge Pipes + +Heading | Heading | Heading +------- | --------- | ------- +Text | Text text | Text +Text | Text text | Text +Text | Text text | Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading | Heading | Heading +------- | -------- | -------- +Text | Text text | Text +Text | Text text | Text +Text | Text tex | Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Compact / Edge Pipes + +| Heading | Heading | Heading | +| ------- | ------- | ------- | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +| Heading | Heading | Heading | +| - | - | - | +| Text | Text text | Text | +| Text text | Text text text | Text | +| Text | Text | Text | + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +| Heading | Heading | Heading | +| - | --- | - | +| Text | Text text | Text | +| Text | Text | Text | +| Text | Text | Text | + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Compact / No Edge Pipes + +Heading | Heading | Heading +------- | ------- | ------- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading | Heading | Heading +-- | -- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +Heading | Heading | Heading +-- | --- | -- +Text | Text text | Text +Text text | Text text text | Text +Text | Text | Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Tight / Edge Pipes + +|Heading|Heading|Heading| +|-------|-------|-------| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +|Heading|Heading|Heading| +|-|-|-| +|Text|Text text|Text| +|Text text|Text text text|Text| +|Text|Text|Text| + +|Heading|Heading |Heading| +|-------|-------|------- | +| Text|Text text |Text| +|Text text |Text text text|Text| +|Text| Text |Text| + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-3} {MD060:-2} + +## Tight / No Edge Pipes + +Heading|Heading|Heading +-------|-------|------- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +Heading|Heading|Heading +-|-|- +Text|Text text|Text +Text text|Text text text|Text +Text|Text|Text + +Heading|Heading |Heading +-------|-------| ------- +Text |Text text|Text +Text text|Text text text|Text +Text| Text |Text + +{MD060:-6} {MD060:-5} {MD060:-4} {MD060:-2} + + diff --git a/test/table-column-style-trailing-spaces.md b/test/table-column-style-trailing-spaces.md new file mode 100644 index 00000000..fe72c2e8 --- /dev/null +++ b/test/table-column-style-trailing-spaces.md @@ -0,0 +1,35 @@ +# Table Column Style - Trailing Spaces + +## Aligned + +| Heading | Heading | Heading | +| ------- | --------- | ------- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | + +## Compact + +| Heading | Heading | Heading | +| --- | --- | --- | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | +| Text | Text text | Text | + +## Tight + +|Heading|Heading|Heading| +|---|---|---| +|Text|Text text|Text| +|Text|Text text|Text| +|Text|Text text|Text| +|Text|Text text|Text| + + diff --git a/test/table-column-style-wide-characters.md b/test/table-column-style-wide-characters.md new file mode 100644 index 00000000..abb30238 --- /dev/null +++ b/test/table-column-style-wide-characters.md @@ -0,0 +1,57 @@ +# Table Column Style - Wide Characters + +## Emoji + +| AB | CD | +| -- | -- | +| EF | GH | +| ✅ | KL | +| MN | ✅ | +| ✅ | ✅ | + +| ✅ | CD | +| -- | -- | +| EF | GH | +| ✅ | KL | +| MN | ✅ | +| ✅ | ✅ | + +| AB | ✅ | +| -- | -- | +| EF | GH | +| ✅ | KL | +| MN | ✅ | +| ✅ | ✅ | + +| ✅ | ✅ | +| -- | -- | +| EF | GH | +| ✅ | KL | +| MN | ✅ | +| ✅ | ✅ | + +## Hello World + +| Language | Translation | +|---------------------|----------------| +| Emoji | 👋🌎 | +| Portuguese (Brazil) | Olá mundo | +| Turkish | Merhaba dünya | +| Chinese (Mandarin) | 你好,世界 | +| Japanese | こんにちは世界 | +| Korean | 안녕 세상 | + +## ANSI Escape Codes + +| Style | Escape codes | +| --------- | ------------------------------------------------------- | +| Bold | \u001B[1m大胆な\u001B[22m | +| Underline | \u001B[4mUnderline\u001B[0m | +| Link | \u001B]8;;https://example.com\u0007Link\u001B]8;;\u0007 | + + diff --git a/test/table-content-with-issues.md b/test/table-content-with-issues.md new file mode 100644 index 00000000..ee2229eb --- /dev/null +++ b/test/table-content-with-issues.md @@ -0,0 +1,13 @@ +# Table Content With Issues + +| Content | Issue | +|------------------------------|-----------------| +| Text | N/A | +| (link)[https://example.com] | {MD011} | +|
| {MD033} | +| https://example.com | {MD034} | +| * emphasis* | {MD037} | +| __strong __ | {MD037} | +| ` code` | {MD038} | +| [link ](https://example.com) | {MD039} {MD059} | +| [link]() | {MD042} {MD059} | diff --git a/test/table-issue-with-markdown-it-12.md b/test/table-issue-with-markdown-it-12.md new file mode 100644 index 00000000..b5e7d4fd --- /dev/null +++ b/test/table-issue-with-markdown-it-12.md @@ -0,0 +1,7 @@ +# table-issue-with-markdown-it-12 + +| `CLIEngine` | `ESLint` | +| :------------------------------------------- | :--------------------------------- | +| `executeOnFiles(patterns)` | `lintFiles(patterns)` | + + diff --git a/test/table-pipe-style-explicit-both.md b/test/table-pipe-style-explicit-both.md new file mode 100644 index 00000000..6dd95859 --- /dev/null +++ b/test/table-pipe-style-explicit-both.md @@ -0,0 +1,31 @@ +# Table Pipe Style Explicit Both + +## Style: both + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: none {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading +----- | ------- +Cell | Cell + +## Style: leading {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading +| ----- | ------- +| Cell | Cell + +## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading | +----- | ------- | +Cell | Cell | + + diff --git a/test/table-pipe-style-explicit-leading.md b/test/table-pipe-style-explicit-leading.md new file mode 100644 index 00000000..d33e55e6 --- /dev/null +++ b/test/table-pipe-style-explicit-leading.md @@ -0,0 +1,31 @@ +# Table Pipe Style Explicit Leading + +## Style: both {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: none {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading +----- | ------- +Cell | Cell + +## Style: leading + +| Table | Heading +| ----- | ------- +| Cell | Cell + +## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading | +----- | ------- | +Cell | Cell | + + diff --git a/test/table-pipe-style-explicit-none.md b/test/table-pipe-style-explicit-none.md new file mode 100644 index 00000000..512d9085 --- /dev/null +++ b/test/table-pipe-style-explicit-none.md @@ -0,0 +1,31 @@ +# Table Pipe Style Explicit None + +## Style: both {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: none + +Table | Heading +----- | ------- +Cell | Cell + +## Style: leading {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading +| ----- | ------- +| Cell | Cell + +## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading | +----- | ------- | +Cell | Cell | + + diff --git a/test/table-pipe-style-explicit-trailing.md b/test/table-pipe-style-explicit-trailing.md new file mode 100644 index 00000000..211c7b5d --- /dev/null +++ b/test/table-pipe-style-explicit-trailing.md @@ -0,0 +1,31 @@ +# Table Pipe Style Explicit Trailing + +## Style: both {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: none {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading +----- | ------- +Cell | Cell + +## Style: leading {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading +| ----- | ------- +| Cell | Cell + +## Style: trailing + +Table | Heading | +----- | ------- | +Cell | Cell | + + diff --git a/test/table-pipe-style-implicit-both.md b/test/table-pipe-style-implicit-both.md new file mode 100644 index 00000000..1a3c8023 --- /dev/null +++ b/test/table-pipe-style-implicit-both.md @@ -0,0 +1,25 @@ +# Table Pipe Style Implicit Both + +## Style: both + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: none {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading +----- | ------- +Cell | Cell + +## Style: leading {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading +| ----- | ------- +| Cell | Cell + +## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading | +----- | ------- | +Cell | Cell | diff --git a/test/table-pipe-style-implicit-leading.md b/test/table-pipe-style-implicit-leading.md new file mode 100644 index 00000000..2d0a8307 --- /dev/null +++ b/test/table-pipe-style-implicit-leading.md @@ -0,0 +1,25 @@ +# Table Pipe Style Implicit Leading + +## Style: leading + +| Table | Heading +| ----- | ------- +| Cell | Cell + +## Style: both {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: none {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading +----- | ------- +Cell | Cell + +## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading | +----- | ------- | +Cell | Cell | diff --git a/test/table-pipe-style-implicit-none.md b/test/table-pipe-style-implicit-none.md new file mode 100644 index 00000000..3faa6de1 --- /dev/null +++ b/test/table-pipe-style-implicit-none.md @@ -0,0 +1,25 @@ +# Table Pipe Style Implicit None + +## Style: none + +Table | Heading +----- | ------- +Cell | Cell + +## Style: both {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: leading {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading +| ----- | ------- +| Cell | Cell + +## Style: trailing {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading | +----- | ------- | +Cell | Cell | diff --git a/test/table-pipe-style-implicit-trailing.md b/test/table-pipe-style-implicit-trailing.md new file mode 100644 index 00000000..bd16af60 --- /dev/null +++ b/test/table-pipe-style-implicit-trailing.md @@ -0,0 +1,25 @@ +# Table Pipe Style Implicit Trailing + +## Style: trailing + +Table | Heading | +----- | ------- | +Cell | Cell | + +## Style: both {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading | +| ----- | ------- | +| Cell | Cell | + +## Style: none {MD055:+2} {MD055:+3} {MD055:+4} + +Table | Heading +----- | ------- +Cell | Cell + +## Style: leading {MD055:+2} {MD055:+3} {MD055:+4} + +| Table | Heading +| ----- | ------- +| Cell | Cell diff --git a/test/table-pipe-style.md b/test/table-pipe-style.md new file mode 100644 index 00000000..00ce1f48 --- /dev/null +++ b/test/table-pipe-style.md @@ -0,0 +1,151 @@ +# Table Pipe Style + + + +## Missing in Header Row + +| Table | {MD055} +|-------|---------| + + Table | {MD055} | +|-------|---------| + + Table | {MD055} +|-------|---------| + +## Missing in Separator Row + +| Table | Header | +|-------|-------- + +{MD055:-2} + +| Table | Header | + -------|--------| + +{MD055:-2} + +| Table | Header | + -------|-------- + +{MD055:-2} + +## Missing Leading and Trailing + + {MD055} | Header +---------|-------- + {MD055} | Cell + +{MD055:-3} + + {MD055} | Header +--------:|:------: + {MD055} | Cell + +{MD055:-3} + +| Table | Header | +|--------:|:-------| + {MD055} | Cell + +| Table | Header | +|---------|--------| + {MD055} | Cell +| Cell | Cell | +| Cell | Cell | + +| Table | Header | +|---------|--------| +| Cell | Cell | + {MD055} | Cell +| Cell | Cell | + +| Table | Header | +|---------|--------| +| Cell | Cell | +| Cell | Cell | + {MD055} | Cell + +## Missing Trailing + +| Table | Header | +|--------:|:-------| +| {MD055} | Cell + +| Table | Header | +|---------|--------| +| {MD055} | Cell +| Cell | Cell | +| Cell | Cell | + +| Table | Header | +|---------|--------| +| Cell | Cell | +| {MD055} | Cell +| Cell | Cell | + +| Table | Header | +|---------|--------| +| Cell | Cell | +| Cell | Cell | +| {MD055} | Cell + +## Missing Leading + +| Table | Header | +|--------:|:-------| + {MD055} | Cell | + +| Table | Header | +|---------|--------| + {MD055} | Cell | +| Cell | Cell | +| Cell | Cell | + +| Table | Header | +|---------|--------| +| Cell | Cell | + {MD055} | Cell | +| Cell | Cell | + +| Table | Header | +|---------|--------| +| Cell | Cell | +| Cell | Cell | + {MD055} | Cell | + +## Followed by Text + +| Table | Header | +|-------|--------| +| Cell | Cell | +{MD055} {MD056} Text + +## Table inside Blockquote + +> | Table | {MD055} +> |---------|---------| +> {MD055} | {MD027} | + +## Well-Formed + +| Table | Header | +|-------|--------| +| Cell | Cell | + +| Table | Header | +|-------|--------| +| Cell | Cell | +| Cell | Cell | +| Cell | Cell | + +## Leading and Trailing Spaces + + | Table | {MD009} | + |-------|---------| + | Cell | {MD009} | diff --git a/test/texmath-content-in-lists.md b/test/texmath-content-in-lists.md new file mode 100644 index 00000000..35874935 --- /dev/null +++ b/test/texmath-content-in-lists.md @@ -0,0 +1,67 @@ +# texmath-content-in-lists + +Text + +- Item + $$ + e = mc^2 + $$ + +Text + +- Item + + $$ + e = mc^2 + $$ + +Text + +- Item + + $$ + e = mc^2 + e = mc^2 + $$ + +Text + +- Item + + $$ + $$ + +Text + +- Item + +- Item + + $$ + e = mc^2 + $$ + +- Item + +Text + +- $$ + e = mc^2 + $$ + +Text + +- $e = mc^2$ + +Text + +- Item +- $e = mc^2$ + +Text + +- Item +- $e = mc^2$ +- Item + +Text diff --git a/test/texmath-content.md b/test/texmath-content.md new file mode 100644 index 00000000..e27a360c --- /dev/null +++ b/test/texmath-content.md @@ -0,0 +1,49 @@ +# texmath-content + +## Inline + +text $ x * y * z $ text + +text $$ x * y * z $$ text + +## Block + +$$ +x * y * z +$$ + +text + +$$ +x * y = x * y +$$ + +## Content + +$$ + +Text (reversed)[link] text + +Text [invalid](#link) text + +Text [link](not-descriptive-link-text) text + +Text javascript text + +$$ + +Text $ (reversed)[link] $ text + +Text $ [invalid](#link) $ text + +Text $ [link](not-descriptive-link-text) $ text + +Text $ javascript $ text + + diff --git a/test/token-map-spans.md b/test/token-map-spans.md new file mode 100644 index 00000000..8b90329d --- /dev/null +++ b/test/token-map-spans.md @@ -0,0 +1,43 @@ +# Token Map Spans + +Text *emphasis* text __strong__ text `code` text [link](https://example.com). + +Paragraph with *emphasis +spanning lines* and __strong +spanning lines__ and `code +spanning lines` and [link +spanning lines](https://example.com). + +> Blockquote +> [link](https://example.com) +> > Nested +> > blockquote +> > [link](https://example.com) + +Heading +------- + +```lang +Fenced +code +``` + + Indented + code + +1. List +2. List + - Sub-list + - Sub-list +3. List + +| Table | Column 1 | Column 2 | Column 3 | Column 4 | +|-------|------------|------------|----------|-----------------------------| +| Text | *emphasis* | __strong__ | `code` | [link](https://example.com) | +| Text | *emphasis* | __strong__ | `code` | [link](https://example.com) | + + diff --git a/test/trailing-spaces-in-code-default.md b/test/trailing-spaces-in-code-default.md new file mode 100644 index 00000000..cad8c611 --- /dev/null +++ b/test/trailing-spaces-in-code-default.md @@ -0,0 +1,27 @@ +# Trailing Spaces in Code - Default + +const a = 10; +const b = 10; +const c = 10; +const d = 10; +const e = 10; + +{MD009:-5} {MD009:-3} {MD009:-2} + + const a = 10; + const b = 10; + const c = 10; + const d = 10; + const e = 10; + +```js +const a = 10; +const b = 10; +const c = 10; +const d = 10; +const e = 10; +``` + + diff --git a/test/trailing-spaces-in-code-false.md b/test/trailing-spaces-in-code-false.md new file mode 100644 index 00000000..d217f231 --- /dev/null +++ b/test/trailing-spaces-in-code-false.md @@ -0,0 +1,30 @@ +# Trailing Spaces in Code - False + +const a = 10; +const b = 10; +const c = 10; +const d = 10; +const e = 10; + +{MD009:-5} {MD009:-3} {MD009:-2} + + const a = 10; + const b = 10; + const c = 10; + const d = 10; + const e = 10; + +```js +const a = 10; +const b = 10; +const c = 10; +const d = 10; +const e = 10; +``` + + diff --git a/test/trailing-spaces-in-code-true.md b/test/trailing-spaces-in-code-true.md new file mode 100644 index 00000000..f7a27c08 --- /dev/null +++ b/test/trailing-spaces-in-code-true.md @@ -0,0 +1,34 @@ +# Trailing Spaces in Code - True + +const a = 10; +const b = 10; +const c = 10; +const d = 10; +const e = 10; + +{MD009:-5} {MD009:-3} {MD009:-2} + + const a = 10; + const b = 10; + const c = 10; + const d = 10; + const e = 10; + +{MD009:-5} {MD009:-3} {MD009:-2} + +```js +const a = 10; +const b = 10; +const c = 10; +const d = 10; +const e = 10; +``` + +{MD009:-6} {MD009:-4} {MD009:-3} + + diff --git a/test/trailing-spaces-in-lists-allowed-strict.md b/test/trailing-spaces-in-lists-allowed-strict.md new file mode 100644 index 00000000..291a7947 --- /dev/null +++ b/test/trailing-spaces-in-lists-allowed-strict.md @@ -0,0 +1,73 @@ +# Heading + +1. text + text +1. text + + text +1. text + + text +1. text + text + +1. text + text + +1. text + +{MD009:16} +{MD009:18} + +1. text + text + 1. text + + text + 1. text + + text + 1. text + text + + 1. text + text + + 1. text + +1. text + - text + + text + - text + + text + - text + text + + - text + text + +{MD009:35} +{MD009:37} +{MD009:50} + +1. text + text + + +1. text + + +{MD009:57} +{MD009:58} +{MD009:60} +{MD009:61} + + diff --git a/test/trailing-spaces-in-lists-allowed.md b/test/trailing-spaces-in-lists-allowed.md new file mode 100644 index 00000000..a07b2be4 --- /dev/null +++ b/test/trailing-spaces-in-lists-allowed.md @@ -0,0 +1,72 @@ +# Heading + +1. text + text +1. text + + text +1. text + + text +1. text + text + +1. text + text + +1. text + +{MD009:16} +{MD009:18} + +1. text + text + 1. text + + text + 1. text + + text + 1. text + text + + 1. text + text + + 1. text + +1. text + - text + + text + - text + + text + - text + text + + - text + text + +{MD009:35} +{MD009:37} +{MD009:50} + +1. text + text + + +1. text + + +{MD009:57} +{MD009:58} +{MD009:60} +{MD009:61} + + diff --git a/test/trailing-spaces-in-lists-default.md b/test/trailing-spaces-in-lists-default.md new file mode 100644 index 00000000..0814c174 --- /dev/null +++ b/test/trailing-spaces-in-lists-default.md @@ -0,0 +1,56 @@ +# Heading + +1. text + text +1. text + + text +1. text + + text +1. text + text + +1. text + text + +1. text + +{MD009:9} +{MD009:16} +{MD009:18} + +1. text + text + 1. text + + text + 1. text + + text + 1. text + text + + 1. text + text + + 1. text + +1. text + - text + + text + - text + + text + - text + text + + - text + text + +{MD009:29} +{MD009:36} +{MD009:38} +{MD009:44} +{MD009:51} diff --git a/test/trailing_spaces_br.json b/test/trailing_spaces_br.json deleted file mode 100644 index 50296faa..00000000 --- a/test/trailing_spaces_br.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD009": { - "br_spaces": 2 - } -} diff --git a/test/trailing_spaces_br.md b/test/trailing_spaces_br.md index a619772b..0882a70d 100644 --- a/test/trailing_spaces_br.md +++ b/test/trailing_spaces_br.md @@ -1,4 +1,8 @@ +# trailing_spaces_br + This line has a single trailing space {MD009} This line has two trailing spaces and should be allowed This line has three trailing spaces {MD009} This line has four trailing spaces {MD009} + +{MD009:7} diff --git a/test/unclosed-html-comment-in-code-span.md b/test/unclosed-html-comment-in-code-span.md new file mode 100644 index 00000000..602f466a --- /dev/null +++ b/test/unclosed-html-comment-in-code-span.md @@ -0,0 +1,3 @@ +# Heading + +`