URL-encoding of relative file links
I notice (previewing FoldingText files in Marked, for example) that relative paths to image files need to be URL encoded for Marked to digest them happily into embedded images.
For example, this is rendered as an image:

whereas this appears as a text literal:

i.e.
<figure>
<img src="./Screen%20Shot%202012-12-08%20at%2013.54.01.png" alt="Screen shot" />
<figcaption>Screen shot</figcaption></figure>
<p></p>
Does it look feasible to relax that requirement, and get Marked to sub-contract the encoding when it is noticeably absent within an image link ?
It guess it might well slow things down ...
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 12 Dec, 2012 04:31 PM
Well, the biggest issue we'd have is that spaces aren't valid in a url. The _have_ to be encoded.
2 Posted by rob on 12 Dec, 2012 04:40 PM
Sure – I wasn't being clear :-)
What I meant was, does it look feasible to detect unencoded filenames within the

context, and encode them for the user ?Support Staff 3 Posted by Brett on 12 Dec, 2012 04:47 PM
No, you were clear, but it's a bad idea to fix invalid markup in a preview
when it's still going to break everywhere else. Might be a good idea in an
editor, but not when you're just lying to the user about whether their
markup is working. Do you see what I mean?
4 Posted by Rob on 12 Dec, 2012 04:56 PM
Good, that makes sense - not the right stage at which to fix these things.
(The context is that FoldingText also uses relative MarkDown links to local files as Finder shortcuts, and these, of course, are not encoded. Perhaps the answer is just a simple pre-processing script to prepare for export, or toggle between the two kinds of links).
Thanks for your help, (and for all the work that has gone into a really excellent piece of design and engineering - makes a huge difference to the way I'm working with documents at the moment)
Rob