Though they are still available to the devs, as they are just
`export-ignore`d in the .gitattributes. I've done a little bit of
research, and this attribute prevents the files from being archived by
git. So, I'm assuming that package control fetches archives of the
packages, and not the actual ones. But I haven't found any documentation
on packagecontrol.io stating that. I quickly browsed its source code
on GitHub, and couldn't really find anything. So, I'm going to contact
@jfcherng, who showed me this trick on FileManager.
The aim is to replace every \n in a <pre> with a <br /> because st
doesn't support pre.
However, ST doesn't support <br/> for some reason, only <br> or <br />.
We use to add some <br>s, but BeautifulSoup automatically adds a <br/>
when it sees a <br> (close the tag), which causes the clipping of the
rest of the file by ST. But if we replace every \n with a <br />,
BeautifulSoup automatically replaces it with <br/> (= ST bug)
So, we do exactly that, except that at the very end, when markdown2html
returns, we replace every <br/> with a <br />
Having an extra file is just a pain because you have to save it manually
for ST to reload, and it was small and created way more trouble than it
needed to... It fits really nicely in there anyway
And add some nice CSS
We have to make sure that everything is converted to base64 (and
replaced in the src attribute) because otherwise ST3 messes up the
height of the images
We don't have any delay in between updates (because i'm scared of
threading), which has a few problem:
1. probably really sluggish on slow systems
2. probably slow for readmes with images (need to test)
3. flickers (the phantoms are updated too quickly, so sometimes it
doesn't replace the old one smoothly)
BUG: the preview doesn't load when we preview the markdown file
It use to ask for confirmation (to save) because on_pre_close is run
after this dialog. Hence, we set the markdown_view as scratch for
unsaved files. :^)
It works for saved and unsaved files. Maybe unsaved file's content
should be written to a temporary file in case we crash, so that the user
doesn't lose all it's content.