Last active
December 21, 2015 17:49
-
-
Save druu/6342809 to your computer and use it in GitHub Desktop.
Live Preview for markItUp Screenshot: https://dl.dropboxusercontent.com/u/17260788/Screenshots/md_preview.png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="editor_area"> | |
<span>Inhalt:</span><br> | |
<textarea id="ta_news_text" name="news_text"></textarea> | |
<div id="editor_preview"></div> | |
</div> | |
<script defer src="markitup/jquery.markitup.js"></script> | |
<script defer src="markitup/sets/markdown/set.js"></script> | |
<script defer src="markitup/parsers/showdown.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
var mySettings.previewParser = (function(content) { | |
var converter = new Showdown.converter(); | |
return function(content){ | |
return converter.makeHtml(content); | |
}; | |
})(); | |
$("#ta_news_text").markItUp(mySettings); | |
$("#ta_news_text").keyup(function(){ | |
$('a[title="Preview"]').trigger('mouseup'); | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment