return if src is null or undefined in resolveImages#103
Conversation
|
Thanks for Pull Request! Is gitbook-plugin-changelog https://github.com/antonlegoo/gitbook-plugin-changelog? Mine understand that
I think that Also, Can you add test for |
|
Yes, that's right. When +<img
+src="...">In this case, resolveImages can find But if src is null or undefined, the following line must be error.
LocationUtils.toAbsolute calls toAbsorute and it calls normalize in location.js, this function expect string as argument. So, I think resolveImages should check src is whether string or not. |
|
@azu ah, I haven't detected which is real problem whether src with plus sign is problem or img tag with break line is problem |
|
@azu I'll write test later, but it'll take a few days.
|
Ah, I see. This PR is reasonable to fix
Me too. In html, following img tag is valid syntax. <img
src=x
>
Yes! |
|
@azu I add new test. I confirmed the test is aborted on master branch. as a result, break return is no problem. |
packages/honkit/src/output/modifiers/__tests__/resolveImages.js
Outdated
Show resolved
Hide resolved
|
Relase v3.5.3 |
|
It seems that this fix is not included v3.5.3. The following is install log and result of grep. |
in resolveImages, if src is null or undefined, LocationUtils.toAbsolute occurs error.
This occurs the following content and using gitbook-plugin-changelog.
This file's diff is like the following
In this case, resolveImages occurs error because LocationUtils.toAbsolute used in resolveImages expects src is string.