Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed https://markdown-it.github.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

105 lines
4.0 KiB

doctype html
html
head
title markdown-it demo
meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1')
script(src='https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.0.5/es5-shim.min.js')
script(src='https://cdn.jsdelivr.net/jquery/1.11.1/jquery.min.js')
script(src='https://cdn.jsdelivr.net/lodash/2.4.1/lodash.js')
script(src='https://cdn.jsdelivr.net/bootstrap/3.2.0/js/bootstrap.min.js')
link(rel='stylesheet' href='https://cdn.jsdelivr.net/bootstrap/3.2.0/css/bootstrap.css')
link(rel='stylesheet' href='https://cdn.jsdelivr.net/highlight.js/9.1.0/styles/github.min.css')
script(src='markdown-it.js')
script(src='https://twemoji.maxcdn.com/twemoji.min.js')
link(rel='stylesheet' href='index.css')
script(src='index.js')
// Ancient IE support - load shiv & kill broken highlighter
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script>window.hljs = null;</script>
<![endif]-->
// GA counter
script.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-26895916-4', 'auto');
ga('require', 'displayfeatures');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
body
.container
- var s = self.self.demo;
h1 markdown-it
|
small demo
.form-inline.demo-options
.checkbox.not-strict
label._tip(title='enable html tags in source text')
input#html(type='checkbox')
| html
.checkbox.not-strict
label._tip(title='produce xtml output (add / to single tags (<br /> instead of <br>)')
input#xhtmlOut(type='checkbox')
| xhtmlOut
.checkbox.not-strict
label._tip(title='newlines in paragraphs are rendered as <br>')
input#breaks(type='checkbox')
| breaks
.checkbox.not-strict
label._tip(title='autoconvert link-like texts to links')
input#linkify(type='checkbox')
| linkify
.checkbox.not-strict
label._tip(title='do typographic replacements, (c) → © and so on')
input#typographer(type='checkbox')
| typographer
.checkbox.not-strict
label._tip(title='enable output highlight for fenced blocks')
input#_highlight(type='checkbox')
| highlight
.form-group.not-strict
input#langPrefix.form-control._tip(
type='input'
placeholder='language prefix'
title='css class language prefix for fenced code blocks'
)
.checkbox
label._tip(title='force strict CommonMark mode - output will be equal to reference parser')
input#_strict(type='checkbox')
| CommonMark strict
.container.full-height
.row.full-height
.col-xs-6.full-height
.demo-control
a.source-clear(href='#') clear
a#permalink(href='./' title='Share this snippet as link'): strong permalink
textarea.source.full-height= s.source
section.col-xs-6.full-height
.demo-control
a(href='#' data-result-as='html') html
a(href='#' data-result-as='src') source
a(href='#' data-result-as='debug') debug
.result-html.full-height
pre.hljs.result-src.full-height
code.result-src-content.full-height
pre.hljs.result-debug.full-height
code.result-debug-content.full-height
.gh-ribbon
a(href='https://github.com/markdown-it/markdown-it' target='_blank') Fork me on GitHub