retext-syntax-mentions-channels v2.3.0
retext-syntax-mentions-channels
retext plugin to classify
@mentions as syntax, not natural
language. It also ignores chat channels like the ones used on Slack, for
example #this-is-a-channel.
DISCLAIMER: This is a modified version of retext-syntax-mentions. There are some links in the documentation that are still mentioning this project as its original name.
Install
npm:
npm install retext-syntax-mentions-channelsUse
Without syntax-mentions-channels:
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 mentions = require('retext-syntax-mentions-channels')
var report = require('vfile-reporter')
unified()
.use(english)
.use(spell, dictionary)
.use(stringify)
.process('Misspelt? @wooorm.', function(err, file) {
console.log(report(err || file))
})Yields:
1:12-1:18 warning `wooorm` is misspelt; did you mean `worm`? retext-spell retext-spell
⚠ 1 warningWith syntax-mentions-channels:
.use(english)
+ .use(mentions)
.use(spell, dictionary)Yields:
no issues foundAPI
retext().use(mentions)
Classify @mentions as source,
which represent “external (ungrammatical) values” instead of natural language.
This hides mentions from retext-spell,
retext-readability, retext-equality, and more.
Related
retext-syntax-urls— Classify URLs and filepaths as syntaxretext-spell— Check spellingretext-readability— Check readabilityretext-equality— Check possible insensitive, inconsiderate language
Contribute
See contributing.md in retextjs/.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, organisation, or community you agree to abide by its terms.