diff --git a/Readme.md b/Readme.md index 3cfb75b..57010df 100644 --- a/Readme.md +++ b/Readme.md @@ -112,4 +112,3 @@ This software has been developed with lots of coffee, buy me one more cup to kee [Artem Sapegin](https://sapegin.me) and [contributors](https://github.com/sapegin/textlint-rule-terminology/graphs/contributors). MIT License, see the included [License.md](License.md) file. Also see the [project status](https://github.com/sapegin/textlint-rule-terminology/discussions/65). - diff --git a/index.js b/index.js index 4fd6180..cac57ee 100644 --- a/index.js +++ b/index.js @@ -139,7 +139,7 @@ function getExactMatchRegExp(pattern) { // 2. Exact match of the pattern // 3. Space, punctuation + space, punctuation + punctuation, or punctuation at the end of the string, end of the string `(?<=^|[^-\\w])\\b${pattern}\\b(?= |${punctuation} |${punctuation}${punctuation}|${punctuation}$|$)`, - 'ig' + 'igm' ); } diff --git a/test.js b/test.js index 300bab3..d980794 100644 --- a/test.js +++ b/test.js @@ -273,6 +273,17 @@ tester.run('textlint-rule-terminology', rule, { }, ], invalid: [ + { + // https://github.com/sapegin/textlint-rule-terminology/discussions/71 + text: `A Github\n`, + output: `A GitHub\n`, + errors: [ + { + message: + 'Incorrect usage of the term: “Github”, use “GitHub” instead', + }, + ], + }, { // One word text: 'My Javascript is good too',