Skip to content

Commit

Permalink
fix(space-around-link): リンクの後にスペースを強制する処理が正常に動作していない不具合を修正 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 committed May 6, 2021
1 parent cb5b8f3 commit 3f8c438
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/textlint-rule-ja-space-around-link/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function reporter(context, options) {
// InlineCodeの後に文字が存在している時のみチェック
if (existAfterChar) {
if (allowAfterSpace) {
if (afterChar !== " " && isJapaneseChar(beforeChar)) {
if (afterChar !== " " && isJapaneseChar(afterChar)) {
report(
node,
new RuleError("リンクの後にスペースを入れてください。", {
Expand Down
28 changes: 28 additions & 0 deletions packages/textlint-rule-ja-space-around-link/test/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,34 @@ tester.run("Link周りのスペース", rule, {
},
],
},
{
text: "これは[README](./README.md)おかしい",
output: "これは [README](./README.md)おかしい",
options: {
before: true,
after: false,
},
errors: [
{
message: "リンクの前にスペースを入れてください。",
column: 3,
},
],
},
{
text: "これは[README](./README.md)おかしい",
output: "これは[README](./README.md) おかしい",
options: {
before: false,
after: true,
},
errors: [
{
message: "リンクの後にスペースを入れてください。",
column: 25,
},
],
},
{
text: "これは[README](./README.md)おかしい",
output: "これは [README](./README.md) おかしい",
Expand Down

0 comments on commit 3f8c438

Please sign in to comment.