# retext-syntax-urls

> retext plugin to classify url-like values as syntax, not natural language

Latest version **4.0.0** (published 2023-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install retext-syntax-urls
pnpm add retext-syntax-urls
yarn add retext-syntax-urls
bun add retext-syntax-urls
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2023-09-07 |
| First published | 2017-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 6 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Titus Wormer |
| Maintainers | wooorm |
| Keywords | filename, path, plugin, retext, retext-plugin, syntax, source, unified, url |

## Links

- npm: https://www.npmjs.com/package/retext-syntax-urls
- Repository: https://github.com/retextjs/retext-syntax-urls
- Homepage: https://github.com/retextjs/retext-syntax-urls#readme
- Issues: https://github.com/retextjs/retext-syntax-urls/issues
- Funding: https://opencollective.com/unified
- npm.io page: https://npm.io/package/retext-syntax-urls

## Dependencies (6)

- [ccount](https://npm.io/package/ccount.md) ^2.0.0
- [unified](https://npm.io/package/unified.md) ^11.0.0
- [@types/nlcst](https://npm.io/package/@types/nlcst.md) ^2.0.0
- [nlcst-to-string](https://npm.io/package/nlcst-to-string.md) ^4.0.0
- [unist-util-position](https://npm.io/package/unist-util-position.md) ^5.0.0
- [unist-util-modify-children](https://npm.io/package/unist-util-modify-children.md) ^4.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 4.0.0 (latest) — 2023-09-07
- 3.1.2 — 2022-01-10
- 3.1.1 — 2021-09-19
- 3.1.0 — 2021-08-27
- 3.0.0 — 2021-07-18
- 2.0.0 — 2020-03-08
- 1.0.2 — 2019-06-05
- 1.0.1 — 2018-11-06
- 1.0.0 — 2017-08-03

## README

# retext-syntax-urls

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

**[retext][]** plugin to classify URL-like values as syntax instead of natural
language.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`unified().use(retextSyntaxUrls)`](#unifieduseretextsyntaxurls)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package is a [unified][] ([retext][]) plugin to classify URL-like values
(such as `example.com`, `index.html`, or `www.alpha.bravo`) as
[`SourceNode`][nlcst-source] instead of natural language.
That node represent “external (ungrammatical) values” instead of natural
language, which hides URLs and paths from [`retext-spell`][retext-spell],
[`retext-readability`][retext-readability],
[`retext-equality`][retext-equality], and other things that check words.

## When should I use this?

You can use this plugin any time there are URLs and paths in prose, that are
(incorrectly) warned about by linting plugins.

> 👉 **Note**: this is not a markdown parser.
> Use `unified` with [`remark-parse`][remark-parse] and
> [`remark-retext`][remark-retext] to “hide” other syntax.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install retext-syntax-urls
```

In Deno with [`esm.sh`][esmsh]:

```js
import retextSyntaxUrls from 'https://esm.sh/retext-syntax-urls@4'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import retextSyntaxUrls from 'https://esm.sh/retext-syntax-urls@4?bundle'
</script>
```

## Use

Without `retext-syntax-urls`:

```js
import dictionaryEn from 'dictionary-en'
import retextEnglish from 'retext-english'
import retextSpell from 'retext-spell'
import retextStringify from 'retext-stringify'
import retextSyntaxUrls from 'retext-syntax-urls'
import {unified} from 'unified'
import {reporter} from 'vfile-reporter'

const file = await unified()
  .use(retextEnglish)
  .use(retextSpell, dictionaryEn)
  .use(retextStringify)
  .process('Have you read readme.md? Check it out: www.example.com/readme.md')

console.log(reporter(file))
```

Yields:

```txt
1:15-1:24 warning `readme.md` is misspelt                 readme-md       retext-spell
1:40-1:55 warning `www.example.com` is misspelt           www-example.com retext-spell
1:56-1:65 warning `readme.md` is misspelt; did you mean ? readme-md       retext-spell

⚠ 3 warnings
```

With `retext-syntax-urls`:

```diff
   .use(retextEnglish)
+  .use(retextSyntaxUrls)
   .use(retextSpell, dictionaryEn)
```

Yields:

```txt
no issues found
```

## API

This package exports no identifiers.
The default export is [`retextSyntaxUrls`][api-retext-syntax-urls].

### `unified().use(retextSyntaxUrls)`

Classify url-like values (`example.com`, `index.html`, `www.alpha.bravo`) as
syntax instead of natural language.

###### Parameters

There are no parameters.

###### Returns

Nothing (`undefined`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

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, `retext-syntax-urls@^4`,
compatible with Node.js 16.

## Related

*   [`retext-syntax-mentions`][retext-syntax-mentions]
    — classify [**@mentions**](https://github.com/blog/821) as syntax
*   [`retext-spell`][retext-spell]
    — check spelling
*   [`retext-readability`][retext-readability]
    — check readability
*   [`retext-equality`][retext-equality]
    — check possible insensitive, inconsiderate language

## Contribute

See [`contributing.md`][contributing] in [`retextjs/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/retextjs/retext-syntax-urls/workflows/main/badge.svg

[build]: https://github.com/retextjs/retext-syntax-urls/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/retextjs/retext-syntax-urls.svg

[coverage]: https://codecov.io/github/retextjs/retext-syntax-urls

[downloads-badge]: https://img.shields.io/npm/dm/retext-syntax-urls.svg

[downloads]: https://www.npmjs.com/package/retext-syntax-urls

[size-badge]: https://img.shields.io/bundlejs/size/retext-syntax-urls

[size]: https://bundlejs.com/?q=retext-syntax-urls

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/retextjs/retext/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[health]: https://github.com/retextjs/.github

[contributing]: https://github.com/retextjs/.github/blob/main/contributing.md

[support]: https://github.com/retextjs/.github/blob/main/support.md

[coc]: https://github.com/retextjs/.github/blob/main/code-of-conduct.md

[license]: license

[author]: https://wooorm.com

[nlcst-source]: https://github.com/syntax-tree/nlcst#source

[remark-parse]: https://github.com/remarkjs/remark/tree/main/packages/remark-parse

[remark-retext]: https://github.com/remarkjs/remark-retext

[retext]: https://github.com/retextjs/retext

[retext-spell]: https://github.com/retextjs/retext-spell

[retext-readability]: https://github.com/retextjs/retext-readability

[retext-equality]: https://github.com/retextjs/retext-equality

[retext-syntax-mentions]: https://github.com/retextjs/retext-syntax-mentions

[unified]: https://github.com/unifiedjs/unified

[api-retext-syntax-urls]: #unifieduseretextsyntaxurls

---
_Source: https://npm.io/package/retext-syntax-urls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
