Skip to content

Instantly share code, notes, and snippets.

@tochiz
Created July 20, 2011 04:08
Show Gist options
  • Save tochiz/1094314 to your computer and use it in GitHub Desktop.
Save tochiz/1094314 to your computer and use it in GitHub Desktop.
tokyopromenade gist embed patch
diff --git a/common.c b/common.c
index 54f0695..e483fa6 100644
--- a/common.c
+++ b/common.c
@@ -914,6 +914,11 @@ void wikitohtml(TCXSTR *rbuf, const char *str, const char *id, const char *buri,
tcxstrprintf(rbuf, "<div class=\"rule rule_s%d\">"
"<span>----</span></div>\n", lv);
ri++;
+ } else if(tcstrfwm(line, "gist:")){
+ const char *uri;
+ uri = tcstrskipspc(strchr(line, ':') + 1);
+ tcxstrprintf(rbuf, "<script src=\"https://gist.github.com/%?.js\"> </script>\n", uri);
+ ri++;
} else {
line = tcstrskipspc(line);
if(*line != '\0'){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment