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 38
38
"devDependencies" : {
39
39
"babel" : " ^5.8.23" ,
40
40
"mocha" : " ^2.3.3" ,
41
- "textlint-tester" : " ^0.2.0 "
41
+ "textlint-tester" : " ^0.3.2 "
42
42
},
43
43
"dependencies" : {
44
44
"analyze-desumasu-dearu" : " ^2.1.2" ,
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ export default function (context) {
42
42
43
43
44
44
return {
45
+ [ Syntax . Document ] ( ) {
46
+ desumasuList = [ ] ;
47
+ dearuList = [ ] ;
48
+ } ,
45
49
[ Syntax . Str ] ( node ) {
46
50
// 本文以外は無視する
47
51
// => isUserWrittenNode
Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ export default function (context) {
14
14
let desumasuList = [ ] ;
15
15
let dearuList = [ ] ;
16
16
17
+ function resetState ( ) {
18
+ desumasuList = [ ] ;
19
+ dearuList = [ ] ;
20
+ }
21
+
17
22
const imagePaddingLet = 2 ; // ![ の分paddingを付ける
18
23
function reportResult ( list , { desumasu, dearu} ) {
19
24
list . forEach ( ( { node, matches} ) => {
@@ -33,10 +38,11 @@ export default function (context) {
33
38
}
34
39
35
40
return {
41
+ [ Syntax . Document ] : resetState ,
36
42
[ Syntax . Image ] ( node ) {
37
43
let text = node . alt ;
38
44
// alt がない場合は無視する
39
- if ( text === undefined ) {
45
+ if ( text === undefined ) {
40
46
return ;
41
47
}
42
48
let retDesumasu = analyzeDesumasu ( text ) ;
You can’t perform that action at this time.
0 commit comments