Disabling loading badges from the network
I usually use Marked 2 to preview my programming module READMEs. Some of them load badges over the network which display the current build status, published version, etc.
I noticed that Marked 2 load each badge from the network every time I make a change, thus adding a small but annoying lag in the workflow.
Is there a way to prevent my markdown file from loading resources from certain hosts? It's unnecessary for me to see the badges when previewing the file locally.
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 18 Jun, 2015 01:26 PM
There's no built-in way, but you could add a simple custom preprocessor
that replaced the badges with a placeholder. Just make a script that
accepts input on STDIN and returns the result on STDOUT. Ruby, for
example:
#!/usr/bin/ruby
input = STDIN.read.force_encoding('utf8')
$stdout.puts input.gsub(/<badge regex>/,'[BADGE]')
You'd just want to make sure that the replacement was something that
wouldn't cause Marked to think it was a script or image, Markdown or
otherwise.
Make it executable and add the path to Marked's preprocessor setting in
Preferences.
-Brett