Fix goldmark toc rendering
authorsatotake <doublequotation@gmail.com>
Sat, 22 Feb 2020 17:06:30 +0000 (02:06 +0900)
committerGitHub <noreply@github.com>
Sat, 22 Feb 2020 17:06:30 +0000 (18:06 +0100)
commitca68abf0bc2fa003c2052143218f7b2ab195a46e
treeda1732c53edd4ba003e458a74efc0f82bdefc612
parenta524124beb0e7ca226c207ea48a90cea2cbef76e
Fix goldmark toc rendering

Previously gordmark-based TOC renderes only `KindText` and `KindString`

This commit expands target node with Goldmark's renderer

I am not sure of what are expected results as TOC contents in some (rare) cases
but Blackfriday's behaviours are fundamentally respected.

For example,
- image `[image text](link)` is rendered as `<img>` tag
- GFM AutoLink `gohugo.io` is rendered as text

* Render AutoLink as <a> tag as Blackfriday does

Fixes #6736
Fixes #6809
hugolib/shortcode_test.go
markup/goldmark/convert.go
markup/goldmark/toc.go
markup/goldmark/toc_test.go