console.clear();
var MarkdownIt = window.markdownit({
breaks: true,
langPrefix: 'language-',
linkify: true,
typographer: false
});
var Showdown = new showdown.Converter();
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: true,
pedantic: false,
sanitize: true,
smartLists: true,
smartypants: false
});
var Remark = new Remarkable({
html: false, // Enable HTML tags in source
xhtmlOut: false, // Use '/' to close single tags (<br />)
breaks: true, // Convert '\n' in paragraphs into <br>
langPrefix: 'language-', // CSS language prefix for fenced blocks
linkify: false, // Autoconvert URL-like text to links
// Enable some language-neutral replacement + quotes beautification
typographer: false,
// Double + single quotes replacement pairs, when typographer enabled,
// and smartquotes on. Set doubles to '«»' for Russian, '„“' for German.
quotes: '“”‘’',
// Highlighter function. Should return escaped HTML,
// or '' if the source string is not changed
highlight: function (/*str, lang*/) { return ''; }
});
var reader = new commonmark.Parser();
var Commonmark = new commonmark.HtmlRenderer();
$(function(){
$(".chat").on("keydown", ".chat-message-input", function(e){
if (e.keyCode == 13) {
if (e.shiftKey !== true) {
e.preventDefault();
var msgPre = '<div class="message"><div class="meta"><span class="name">';
var msgPre2 = '</span></div>';
var typed = this.value;
var commonMark = Commonmark.render(reader.parse(typed));
var markd = marked(typed);
var markdownIt = MarkdownIt.render(typed);
var remarkable = Remark.render(typed);
var showdown = Showdown.makeHtml(typed);
$(".chat-messages")
.append(msgPre + "commonMark" + msgPre2 + commonMark + "</div>")
.append(msgPre + "marked" + msgPre2 + markd + "</div>")
.append(msgPre + "markdown-it" + msgPre2 + markdownIt + "</div>")
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.