retextjs / retext-syntax-mentions

plugin to classify @mentions as syntax, not natural language
https://unifiedjs.com
MIT License
10 stars 2 forks source link

Feature Request: Check for String / RegEx #8

Closed muescha closed 4 years ago

muescha commented 4 years ago

Subject of the feature

when i have a string other than twitter or github

.use(require("retext-syntax-mentions"), { style: 'twittter'})
TypeError: style.test is not a function

Problem

the code did not check after init if it is an RegEx

Expected behavior

Should print a error that an RegEx is required

Alternatives

n/a

wooorm commented 4 years ago

Ah good catch, there indeed is no error for incorrect configuration. Interested in creating a PR?

wooorm commented 4 years ago

Released!