Trott / remark-lint-prohibited-strings

remark-lint plugin to prohibit specified strings in markdown files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow regex matches in `no` to be used in `yes`

nschonni opened this issue · comments

Thinking this is useful to for allowing suggested replacements when you're looking to enforce HTML element wrapping.
EX: { "no": "(CTRL|Alt)+\+(\w)", "yes": "<kbd>$1</kbd>+<kbd>$2</kbd>" }
or from one of the config examles { no: "[Rr][Ff][Cc](\\d+)", yes: "RFC $1" }

That would be a good enhancement. of all the remark-lint plugins I used over the last couple of days, this is the most useful and fun to use! I wrote a rule for contractions and thought the same - using the group would be useful there. E.g. { no: "\\w+'ll", yes: '$1 will' } to "they'll" => "they will". In a related matter, I couldn't enter "no" regex directly (had to be a string). I was trying to do a negative look behind /(?<!foo)bar/i, but the plugin does string manipulation on the rule and it screws up the expression. It's not clear the rules must be strings, but it'd be nice if they didn't have to be.