File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ function reporter(context, options = {}) {
7777 // | ----[match------|
7878 var matchedText = slicedText . slice ( 0 , changeSet . matches [ 0 ] . length ) ;
7979 var expected = matchedText . replace ( changeSet . pattern , changeSet . expected ) ;
80- // Avoid accidental match(ignore case, expected contain actual pattern )
81- if ( slicedText . indexOf ( expected ) === 0 ) {
80+ // Avoid accidental match(ignore case)
81+ if ( matchedText === expected ) {
8282 return ;
8383 }
8484 /*
Original file line number Diff line number Diff line change @@ -48,10 +48,12 @@ rules:
4848 to : 日経ソフトウエア
4949
5050 - expected : ベンダー
51- pattern : ベンダ
51+ pattern : / ベンダ(?!ー)/
5252 specs :
5353 - from : ベンダ
5454 to : ベンダー
55+ - from : ベンダー
56+ to : ベンダー
5557# 単語境界の区別
5658 - expected : js
5759 # pattern: "/\b[JjJj][SsSs]\b/g" # と等価 \b が前後に付与される
6567 # 日本語+単語境界の仕様は自分で調べてね…!
6668 - from : 今日もJS祭り
6769 to : 今日もjs祭り
70+
71+ # 全角括弧前後の空白を除去
72+ - expected : )
73+ pattern : /) | )/
Original file line number Diff line number Diff line change @@ -25,6 +25,15 @@ describe("prh-rule-test", function () {
2525 } ) ;
2626 } ) ;
2727 } ) ;
28+ context ( "when match word and s/) /)/ pattern" , function ( ) {
29+ it ( "should report error" , function ( ) {
30+ return textlint . lintMarkdown ( "(図1) " ) . then ( result => {
31+ assert ( result . messages . length > 0 ) ;
32+ assert ( result . messages [ 0 ] . line === 1 ) ;
33+ assert ( result . messages [ 0 ] . column === 4 ) ;
34+ } ) ;
35+ } ) ;
36+ } ) ;
2837 context ( "when match word but s/Web/Web/i pattern" , function ( ) {
2938 // fix ignore (the) case
3039 it ( "should not report" , function ( ) {
You can’t perform that action at this time.
0 commit comments