Link text disappears if it contains inline code in it
Thank you for providing us such a great, simple, nice and neat app!
It might be against Markdown's syntax rules but I found out that if the link ([]()) contains a word or phrase with enclosed backticks (`) in a "link text", the "link text" disappears.
$ cat sample.md
[`foo` bar](http://sample.com/)
[foo bar](http://sample.com/)
$ mdr sample.md
[](http://sample.com/)
[foo bar](http://sample.com/)
GitHub flavor markdown works tho: foo bar
- Env info:
- OS: macOS 10.14.6 (OSX Mojave),
mdr: mdr_darwin_amd64 v0.2.1, CPU: Intel Core i5 - OS: Raspbian 8.0 (Jessie),
mdr: mdr_linux_arm v0.2.1, CPU: ARM v6l
- OS: macOS 10.14.6 (OSX Mojave),
I think what happens is that I assumed that the "link text" would be well, a simple ast.Text. It seems that was too much to assume. Relevant code is there: https://github.com/MichaelMure/go-term-markdown/blob/master/renderer.go#L300-L312
Man, Markdown is complex.
So I think the fix could be:
- on entering
ast.Link, print[ - let whatever child node render in
r.inlineAccumulator - on exiting, print the rest:
](....)
That could get messy though if it's possible to have an image there.
Thanks for the quick response!
Man, Markdown is complex.
I agree. Too many flavors.
I'm not a Gopher but thinking of recursive processing ... uh ... I can imagine how tough it would be.
I'm not in a rush. So please take your time. Thank you!