Marked Preview not following url-encoded intradocument hyperlinks
An issue I ran into today:
`[hello](#hello)` links to `<a id="hello"></a>` without any trouble, but `[hello there](#hello%20there)` won't link to `<a id="hello%20there"></a>` *in Marked.*
However, both links work just fine in the HTML generated by Marked; it's just in the Marked preview window that the url-encoded ones aren't followed.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 14 Jul, 2013 06:16 PM
It's quite likely something in the way the javascript handles intercepting link clicks, but before I spend any time on it can you explain in what situation percent-encoded internal links would be necessary?
2 Posted by n8henrie on 14 Jul, 2013 06:33 PM
Fair enough.
I've been using a TextExpander snippet to speed up creating Table of Contents for my blog posts. I use `,toc` and fill in the name of the section ("Intro", "Background", "Conclusion", etc.) and it spits out something like
TOC
* [Intro](#Intro)
* [Background](#Background)
* [Conclusion](#Conclusion)
#### Intro<a id="Intro"></a>
#### Background<a id="Background"></a>
#### Conclusion<a id="Conclusion"></a>
Today I tried using a multiword header and it obviously failed due to spaces, so I wrote a quick Python script to URL-encode the fragments.
Like I said, the HTML output works, I just appreciate being able to check my fragment hyperlinks in Marked (which I can for the single-word fragments).