Releases: textlint-rule/textlint-rule-prh
3.1.3
Bug Fixes
Some prh rule was broken in textlint-prh
version: 1
rules:
- prh: 「行う」「行なう」は開く。
expected: おこな
pattern: /(おこな|行な?)(?=[わいっうえお])/
specs:
- from: 行わない
to: おこなわない
- from: 行います
to: おこないます
- from: 行うとき
to: おこなうとき
- from: 行えば
to: おこなえば
- from: 行なう
to: おこなう
- from: おこなう
to: おこなう
# チェックされなくてよい部分
- from: 行く
to: 行くThis patch release fix this.
Thanks for report @cu39
3.1.2
3.1.1
3.1.0
3.0.1
3.0.0
Breaking Change
Report error correctly when pattern starts with expected value #8
Problem
textlint-rule-prh does not report an error with a text "(図1) " and the following rule:
# 全角括弧前後の空白を除去
- expected: )
pattern: /) | )/Note: prh does fix the error with this rule.
Cause
This is because the following condition incorrectly ignore the error.
// Avoid accidental match(ignore case, expected contain actual pattern)
if (slicedText.indexOf(expected) === 0) {
return;
}In this case, variables have the following values.
slicedText:') 'matchedText:') 'expected:')'
I understand that the condition is introduced by f528e78 and cd739dc to fix s/Web/Web/i problem and s/ベンダ/ベンダー/ problem. But prh itself does not handle s/ベンダ/ベンダー/ problem, i.e. prh corrects ベンダー to ベンダーー. So, I think s/ベンダ/ベンダー/ problem should be handled by rule (or changing prh's behavior). I believe incompatibility between prh and textlint-rule-prh is confusing.
Implementation
- Handle only
s/Web/Web/iproblem by code. - Handle
s/ベンダ/ベンダー/problem by rule.
This fix the s/) /)/ problem.