Skip to content

Commit 3165258

Browse files
committed
fix(1.1.5): 空の画像タグがあると例外を履いているのを修正
![](http://example.com/img) が安全に処理出来るように
1 parent a4e197b commit 3165258

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/1.1.5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function (context) {
4242
[Syntax.Image](node){
4343
let text = node.alt;
4444
// alt がない場合は無視する
45-
if (text === undefined) {
45+
if (text === undefined || text === null) {
4646
return;
4747
}
4848
let retDesumasu = analyzeDesumasu(text);

test/1.1.5-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ var tester = new TextLintTester();
66
tester.run("1.1.5.図表のキャプション", rule, {
77
valid: [
88
"![これは図です。](http://example.com/img) と ![これは図です。](http://example.com/img)",
9-
"![これは図である。](http://example.com/img) と ![これは図である。](http://example.com/img)"
9+
"![これは図である。](http://example.com/img) と ![これは図である。](http://example.com/img)",
10+
"![](http://example.com/img)"
1011
],
1112
invalid: [
1213
{

0 commit comments

Comments
 (0)