Closed nazrhyn closed 8 years ago
+1
i fixed it with
var ext = path.extname(parsed.pathname || '');
should i send a pr with this fix?
I hope someone can comment on this and hopefully push a fix. it's almost blocking for us now!
I'd be happy to do a PR to resolve this, I just need some interaction to let me know what the maintainers would like.
@nazrhyn sorry for the delay! A PR would be great!
@nazrhyn I went ahead and fixed this, thanks @a7madgamal fir reporting and sorry for the delay again!
Published as v3.1.8
thx all <3
@mixu I will say that I think that doing the || ''
is a bit disingenuous. It is known, by the time url.parse
is called, that there is no pathname
. There's no reason to even execute path.extname
or run the if
statement below that.
/shrug
But that's just a stylistic point. Thanks for the fix!
tbh I didn't look much into the code. I just tried to fix an error that was blocking a build and that's why I didn't send a pr with that hack :)
assuming I was the inspiration for the fix :D
In convert-md.js, when the
renderer.link
function is called on a link that looks like this:Its call to
url.parse
produces something like this (assigned toparsed
):parsed.pathname
is then passed topath.extname
which fails with the following becausepathname
isnull
.I use links like that to link to the implicit anchors provided by the
id
s generated for heading elements. Changing line 58 to......fixes the problem. Not sure if that's more shotgun than you'd want, though.