Skip to content

Instantly share code, notes, and snippets.

@druu
Last active December 21, 2015 17:49
Show Gist options
  • Save druu/6342809 to your computer and use it in GitHub Desktop.
Save druu/6342809 to your computer and use it in GitHub Desktop.
<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