forked from Shiloh/githaven
Fix relative links in markdown files
Replace spaces with "%20" in "urlPrefix", before markdon processing. The spaces were causing blackfriday (markdown processor) to behave strange. This fixes #2545.
This commit is contained in:
parent
9df5c39bca
commit
f57adf3637
@ -357,6 +357,7 @@ OUTER_LOOP:
|
|||||||
|
|
||||||
// Render renders Markdown to HTML with special links.
|
// Render renders Markdown to HTML with special links.
|
||||||
func Render(rawBytes []byte, urlPrefix string, metas map[string]string) []byte {
|
func Render(rawBytes []byte, urlPrefix string, metas map[string]string) []byte {
|
||||||
|
urlPrefix = strings.Replace(urlPrefix, string(spaceBytes), string(spaceEncodedBytes), -1)
|
||||||
result := RenderRaw(rawBytes, urlPrefix)
|
result := RenderRaw(rawBytes, urlPrefix)
|
||||||
result = PostProcess(result, urlPrefix, metas)
|
result = PostProcess(result, urlPrefix, metas)
|
||||||
result = Sanitizer.SanitizeBytes(result)
|
result = Sanitizer.SanitizeBytes(result)
|
||||||
|
Loading…
Reference in New Issue
Block a user