File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 3838 "devDependencies" : {
3939 "babel" : " ^5.8.23" ,
4040 "mocha" : " ^2.3.3" ,
41- "textlint-tester" : " ^0.3.0 "
41+ "textlint-tester" : " ^0.3.2 "
4242 },
4343 "dependencies" : {
4444 "analyze-desumasu-dearu" : " ^2.1.2" ,
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ export default function (context) {
4242
4343
4444 return {
45+ [ Syntax . Document ] ( ) {
46+ desumasuList = [ ] ;
47+ dearuList = [ ] ;
48+ } ,
4549 [ Syntax . Str ] ( node ) {
4650 // 本文以外は無視する
4751 // => isUserWrittenNode
Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ export default function (context) {
1414 let desumasuList = [ ] ;
1515 let dearuList = [ ] ;
1616
17+ function resetState ( ) {
18+ desumasuList = [ ] ;
19+ dearuList = [ ] ;
20+ }
21+
1722 const imagePaddingLet = 2 ; // ![ の分paddingを付ける
1823 function reportResult ( list , { desumasu, dearu} ) {
1924 list . forEach ( ( { node, matches} ) => {
@@ -33,10 +38,11 @@ export default function (context) {
3338 }
3439
3540 return {
41+ [ Syntax . Document ] : resetState ,
3642 [ Syntax . Image ] ( node ) {
3743 let text = node . alt ;
3844 // alt がない場合は無視する
39- if ( text === undefined ) {
45+ if ( text === undefined ) {
4046 return ;
4147 }
4248 let retDesumasu = analyzeDesumasu ( text ) ;
You can’t perform that action at this time.
0 commit comments