Skip to content

Instantly share code, notes, and snippets.

View eungjun-yi's full-sized avatar

Yi EungJun eungjun-yi

View GitHub Profile
@eungjun-yi
eungjun-yi / gfm.coffee
Created April 10, 2012 08:53
Coffeescript port of gfm at https://gist.github.com/118964
crypto = require 'crypto'
gfm = (text) ->
# Extract pre blocks
extractions = {}
text = text.replace /<pre>(\n|.)*?<\/pre>/gm, (match) ->
md5 = crypto.createHash('md5').update(match).digest('hex')
extractions[md5] = match
'{gfm-extraction-' + md5 + '}'
@eungjun-yi
eungjun-yi / Markdown.java
Created July 29, 2015 08:55
마크다운 렌더러에서 어쩔 수 없이 Thread.stop() 사용함
// Try to render and wait at most 5 seconds.
final String[] rendered = new String[1];
@SuppressWarnings("deprecation")
Thread marked = new Thread() {
@Override
public void run() {
try {
rendered[0] = (String) ((Invocable) engine).invokeFunction(
"marked", source, options);
} catch (Exception e) {