textlint-ja / textlint-rule-max-ten

textlint rule that limit maxinum ten(、) count of sentence.
MIT License
10 stars 5 forks source link

Fix position to report in a certain cases #5

Closed orangain closed 8 years ago

orangain commented 8 years ago

Problem

When the second or later sentence in the paragraph contains many tens, the rule reports wrong position in some cases.

$ cat problematic_cases.md
複数のセンテンスがある場合。これでも、columnが、ちゃんと計算、されているはずです。

複数のセンテンスがあって、改行されている場合でも
大丈夫です。これでも、lineとcolumnが、ちゃんと計算、されているはずです。

Before

Reports wrong position.

$ textlint --rule max-ten problematic_cases.md

/private/tmp/problematic_cases.md
  1:20  error  一つの文で"、"を3つ以上使用しています  max-ten
  3:25  error  一つの文で"、"を3つ以上使用しています  max-ten

✖ 2 problems (2 errors, 0 warnings)

After

Reports correct position.

$ textlint --rule max-ten problematic_cases.md

/private/tmp/problematic_cases.md
  1:34  error  一つの文で"、"を3つ以上使用しています  max-ten
  4:31  error  一つの文で"、"を3つ以上使用しています  max-ten

✖ 2 problems (2 errors, 0 warnings)
azu commented 8 years ago

@orangain Thanks! Nice catch!

azu commented 8 years ago

publish 2.0.1

orangain commented 8 years ago

Surprised at your quick merge and release. Thanks :smile: