
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
remark-lint-media-style
Advanced tools
remark-lint rule to check whether references or resources are used
remark-lint
rule to warn when the style of specifying
the URL of images and links is incorrect.
This package checks for media (image and link) style: whether references or resources are used.
You can use this package to check that the style of specifying the URL of images and links is correct.
This plugin is not included in presets maintained here.
This package is ESM only. In Node.js (version 16+), install with npm:
npm install remark-lint-media-style
In Deno with esm.sh
:
import remarkLintMediaStyle from 'https://esm.sh/remark-lint-media-style@1'
In browsers with esm.sh
:
<script type="module">
import remarkLintMediaStyle from 'https://esm.sh/remark-lint-media-style@1?bundle'
</script>
On the API:
import remarkLint from 'remark-lint'
import remarkLintMediaStyle from 'remark-lint-media-style'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import {read} from 'to-vfile'
import {unified} from 'unified'
import {reporter} from 'vfile-reporter'
const file = await read('example.md')
await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintMediaStyle)
.use(remarkStringify)
.process(file)
console.error(reporter(file))
On the CLI:
remark --frail --use remark-lint --use remark-lint-media-style .
On the CLI in a config file (here a package.json
):
…
"remarkConfig": {
"plugins": [
…
"remark-lint",
+ "remark-lint-media-style",
…
]
}
…
This package exports no identifiers.
It exports the TypeScript types
Options
and
Style
.
The default export is
remarkLintMediaStyle
.
unified().use(remarkLintMediaStyle[, options])
Warn when the style of specifying the URL of images and links is incorrect.
options
(Options
, default: 'consistent'
)
— preferred style or whether to detect the first style and warn for
further differencesTransform (Transformer
from unified
).
Options
Configuration (TypeScript type).
'consistent'
— detect the first used style and warn when further rules differ;
“reference-reuse” cannot be detectedStyle
— style to preferStyle
Style (TypeScript type).
'reference'
— prefer references'reference-reuse'
— allow resources when used once,
prefer references otherwise'resource'
— prefer resourcesok-consistent-reference.md
[Mercury][] and [Venus][].
[mercury]: https://example.com/mercury/
[venus]: https://example.com/venus/
No messages.
ok-consistent-resource.md
[Mercury](https://example.com/mercury/) and
[Venus](https://example.com/venus/).
No messages.
ok-reference-reuse.md
When configured with 'reference-reuse'
.
[Mercury](https://example.com/mercury/),
[Venus][], and [Earth][].
**[Venus][]** is the second planet from the Sun.
[venus]: https://example.com/venus/
[earth]: https://example.com/earth/
No messages.
nok-reference.md
When configured with 'reference'
.
[Mercury](https://example.com/mercury/),
[Venus](https://example.com/venus/), and
[Earth][].
[earth]: https://example.com/earth/
1:1-1:40: Unexpected resource for url `https://example.com/mercury/`, expected a definition and a reference to it
2:1-2:36: Unexpected resource for url `https://example.com/venus/`, expected a definition and a reference to it
nok-resource.md
When configured with 'resource'
.
[Mercury](https://example.com/mercury/),
[Venus](https://example.com/venus/), and
[Earth][].
[earth]: https://example.com/earth/
3:1-3:10: Unexpected reference for url `https://example.com/earth/`, expected resource
nok-reference-reuse.md
When configured with 'reference-reuse'
.
[Mercury](https://example.com/mercury/),
[Venus](https://example.com/venus/), and [Earth][].
**[Venus](https://example.com/venus/)** is the second planet from the Sun.
[earth]: https://example.com/earth/
2:1-2:36: Unexpected resource for reused url `https://example.com/venus/`, expected a definition and a reference to it
4:3-4:38: Unexpected resource for reused url `https://example.com/venus/`, expected a definition and a reference to it
reference-reuse-defined.md
When configured with 'reference-reuse'
.
[Mercury](https://example.com/mercury/).
[mercury]: https://example.com/mercury/
1:1-1:40: Unexpected resource for reused url `https://example.com/mercury/`, expected a reference to `mercury`
not-ok.md
When configured with '🌍'
.
1:1: Unexpected value `🌍` for `options`, expected `'reference-reuse'`, `'reference'`, `'resource'`, or `'consistent'`
definitions.md
[mercury]: https://example.com/mercury/
[venus]: https://example.com/venus/
No messages.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
remark-lint-media-style@1
,
compatible with Node.js 16.
See contributing.md
in remarkjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
remark-lint rule to check whether references or resources are used
We found that remark-lint-media-style demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.