JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13793
  • Score
    100M100P100Q142956F
  • License MIT

Classify url-like values (example.com, example.md, etc) as syntax

Package Exports

  • retext-syntax-urls

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (retext-syntax-urls) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

retext-syntax-urls Build Status Coverage Status

Classify url-like values (example.com, index.html, www.alpha.bravo) as syntax, not natural language, in retext.

Installation

npm:

npm install retext-syntax-urls

Usage

Without syntax-urls:

var dictionary = require('dictionary-en-gb');
var unified = require('unified');
var english = require('retext-english');
var stringify = require('retext-stringify');
var spell = require('retext-spell');
var urls = require('retext-syntax-urls');
var report = require('vfile-reporter');

unified()
  .use(english)
  .use(spell, dictionary)
  .use(stringify)
  .process('Have you read readme.md? Check it out: www.example.com/readme.md', function (err, file) {
    console.log(report(err || file));
  });

Yields:

  1:15-1:24  warning  `readme.md` is misspelt        retext-spell  retext-spell
  1:40-1:55  warning  `www.example.com` is misspelt  retext-spell  retext-spell
  1:56-1:65  warning  `readme.md` is misspelt        retext-spell  retext-spell

⚠ 3 warnings

With syntax-urls:

   .use(english)
+  .use(urls)
   .use(spell, dictionary)

Yields:

no issues found

API

retext().use(urls)

Classify URLs, paths, and filenames as SourceNodes, which represent “external (ungrammatical) values” instead of natural language. This hides them from retext-spell, retext-readability, retext-equality, and more.

License

MIT © Titus Wormer