HTML and Markdown
Check article prose, documentation, and served HTML with shared adapters.
On this page
Version 1.25.0 includes shared adapters for HTML and Markdown. Use them alongside framework adapters when copy lives in documentation or separately generated pages.
Install
npm install -D faircopy @faircopy/html @faircopy/markdown
Configure
import { defineConfig } from '@faircopy/config'
import { html } from '@faircopy/html'
import { markdown } from '@faircopy/markdown'
export default defineConfig({
files: ['content/**/*.md', 'pages/**/*.html'],
adapters: [markdown(), html()],
rules: {
'no-em-dash': 'error',
'no-weasel-words': 'warn',
'no-rhetorical-scaffolding': 'warn',
},
})
Run npx faircopy lint. Diagnostics point to the original file, line, and column,
including prose split by inline formatting or decoded from HTML entities.
Coverage
The Markdown adapter reads headings, paragraphs, lists, block quotes, tables, and visible link text. It skips YAML/TOML frontmatter, fenced and inline code, and link destinations. Inline HTML prose is handled by the shared HTML extractor.
The HTML adapter reads visible text and skips code, scripts, styles, comments, and hidden content. HTML attributes are outside its coverage.
MDX is not a native Markdown input. Check the rendered HTML for MDX content. If your site serves checked-in HTML separately from Markdown sources, select both: source lint alone cannot catch a stale or independently edited page.
Check the selected files
The CLI prints coverage counts, including unsupported files and inputs from which no prose was extracted. Review those messages; zero extracted prose is not evidence that the copy passed. An empty or entirely unsupported selection exits with status 2.
See the rules reference to add optional NLP checks and the configuration guide to adjust severities or ignored files.