Skip to content

Instantly share code, notes, and snippets.

@tesths
Created April 30, 2017 13:19
Show Gist options
  • Save tesths/c9f413ab3d3598af4d5bb0c11e5536cf to your computer and use it in GitHub Desktop.
Save tesths/c9f413ab3d3598af4d5bb0c11e5536cf to your computer and use it in GitHub Desktop.
<html>
<head>
<meta charset="utf-8">
<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('h2').each(function(){
$(this).replaceWith('<h2 style="display:inline;width:100px;font-size: 20px;color: #42b983;"># </h2><h2 style="display:inline; width:100px;font-size: 20px;">'+$(this).html()+'</h2>');
});
$('h3').each(function(){
$(this).replaceWith('<h2 style="display:inline;width:100px;font-size: 18px;color: #42b983;">## </h2><h2 style="display:inline; width:100px;font-size: 18px;">'+$(this).html()+'</h2>');
});
$('h4').each(function(){
$(this).replaceWith('<h2 style="display:inline;width:100px;font-size: 16px;color: #42b983;">### </h2><h2 style="display:inline; width:100px;font-size: 16px;">'+$(this).html()+'</h2>');
});
$('h5').each(function(){
$(this).replaceWith('<h2 style="display:inline;width:100px;font-size: 14px;color: #42b983;">#### </h2><h2 style="display:inline; width:100px;font-size: 14px;">'+$(this).html()+'</h2>');
});
$('p').each(function(){
$(this).replaceWith('<p style="margin: 24px 15px !important;">'+$(this).html()+'</p>');
});
$('strong').each(function(){
$(this).replaceWith('<strong style="font-weight: bold;font-style: bold !important;">'+$(this).html()+'</strong>');
});
$('blockquote').each(function(){
$(this).replaceWith('<blockquote style="margin: 10px 15px 10px 15px;border-left: 4px solid #42b983;padding-top: 1px;padding-bottom: 1px;">'+$(this).html()+'</blockquote>');
});
$('blockquote p').each(function(){
$(this).replaceWith('<p style="margin: 0 5px 0 15px;">'+$(this).html()+'</p>');
});
$('a').each(function(){
$(this).replaceWith('<a style="color: #42b983;">'+$(this).html()+'</p>');
});
});
</script>
</head>
<body style="margin: 0;
color: #34495e;
font-size: 15px;
line-height: 1.6;
background-color: #fff;
font-family: 'sourcesanspro', 'Helvetica Neue', Arial, sans-serif;
margin-left: 8px;
">
<h1 id="toc_0">md 测试</h1>
<h2 id="toc_1">二级标签</h2>
<p>二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签</p>
<h3 id="toc_2">三级标签</h3>
<p>二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签二级标签</p>
<h4 id="toc_3">四级标签</h4>
<p>四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签四级标签</p>
<ol>
<li>一一一一一一一一</li>
<li>二二二二二二二二</li>
<li>三三三三三三三三</li>
</ol>
<blockquote>
<p>段落测试测试测试</p>
</blockquote>
<p><strong>加粗测试测试测试</strong></p>
<p><a href="https://cn.vuejs.org/v2/guide/reactivity.html">adffs</a></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment