Comparing version 0.1.6 to 0.1.7
@@ -40,3 +40,3 @@ /*! | ||
var headingsRegExp = /(#+) +(.*)/gm; | ||
var headingsRegExp = /^(#+) +(.*)/gm; | ||
var headingsTemplate = function (match, hash, content) { | ||
@@ -43,0 +43,0 @@ var length = hash.length; return '<h'+length+'>'+content+'</h'+length+'>'; |
@@ -1,1 +0,1 @@ | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e()):window.md=e()}(function(){var e=/<script>([^]+?)<\/script>/gm,r="<script>$1</script>",l=/(<a[^>]*? href[^]*?)(javascript)[\n\t ]*:/gm,c="$1#$2:",n=/^[\t ]+|[\t ]$/gm,t=/^.*?> (.*)/gm,a="<blockquote>$1</blockquote>",o=/`([^`]+?)`/g,p="<code>$1</code>",g=/```(.*)\n([^]+)```(?!```)/gm,m=/!\[(.*)\]\((.*)\)/gm,i='<img src="$2" alt="$1">',$=/(#+) +(.*)/gm,u=function(e,r,l){var c=r.length;return"<h"+c+">"+l+"</h"+c+">"},d=/^([^\n\t ])(.*)\n----+/gm,f=/^([^\n\t ])(.*)\n====+/gm,s="<h1>$1$2</h1>",h="<h2>$1$2</h2>",_=/^([^-><#\d\+\_\*\t\n\[\! \{])(.*)/gm,b="<p>$1$2</p>",v=/^.*?(?:---|\*\*\*)/gm,k="<hr>",x=/(?:\*\*|\_\_)([^\*_]+?)(?:\*\*|\_\_)/gm,w="<strong>$1</strong>",y=/(?:\*|\_)([^\*_]+?)(?:\*|\_)/gm,j="<em>$1</em>",q=/\[(.*?)\]\((.*?) "(.*)"\)/gm,E='<a href="$2" title="$3">$1</a>',R=/\[(.*?)\]\((.*?)\)/gm,z='<a href="$2">$1</a>',A=/^[\t ]*?(?:-|\+|\*) (.*)/gm,B=/(\<\/ul\>\n(.*)\<ul\>*)+/g,C="<ul><li>$1</li></ul>",D=/^[\t ]*?(?:\d(?:\)|\.)) (.*)/gm,F=/(\<\/ol\>\n(.*)\<ol\>*)+/g,G="<ol><li>$1</li></ol>",H=/^\n\n+/gm,I="<br>";return function(J){var K=[],L=0;J=J.replace(e,r).replace(g,function(e,r,l){var c="{code-block-"+L+"}",n=new RegExp("{code-block-"+L+"}","g");return K[L++]={lang:r,block:l,regex:n},c}).replace(n,"").replace(t,a).replace(o,p).replace(m,i).replace($,u).replace(f,s).replace(d,h).replace(A,C).replace(B,"").replace(D,G).replace(F,"").replace(v,k).replace(_,b).replace(q,E).replace(R,z).replace(x,w).replace(y,j).replace(H,I).replace(l,c);for(var M=0;M<L;M++){var N=K[M],O=N.lang,P=N.block;J=J.replace(N.regex,function(e){return'<pre><code class="language-'+O+'">'+P+"</code></pre>"})}return J}}); | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e()):window.md=e()}(function(){var e=/<script>([^]+?)<\/script>/gm,r="<script>$1</script>",l=/(<a[^>]*? href[^]*?)(javascript)[\n\t ]*:/gm,c="$1#$2:",n=/^[\t ]+|[\t ]$/gm,t=/^.*?> (.*)/gm,a="<blockquote>$1</blockquote>",o=/`([^`]+?)`/g,p="<code>$1</code>",g=/```(.*)\n([^]+)```(?!```)/gm,m=/!\[(.*)\]\((.*)\)/gm,i='<img src="$2" alt="$1">',$=/^(#+) +(.*)/gm,u=function(e,r,l){var c=r.length;return"<h"+c+">"+l+"</h"+c+">"},d=/^([^\n\t ])(.*)\n----+/gm,f=/^([^\n\t ])(.*)\n====+/gm,s="<h1>$1$2</h1>",h="<h2>$1$2</h2>",_=/^([^-><#\d\+\_\*\t\n\[\! \{])(.*)/gm,b="<p>$1$2</p>",v=/^.*?(?:---|\*\*\*)/gm,k="<hr>",x=/(?:\*\*|\_\_)([^\*_]+?)(?:\*\*|\_\_)/gm,w="<strong>$1</strong>",y=/(?:\*|\_)([^\*_]+?)(?:\*|\_)/gm,j="<em>$1</em>",q=/\[(.*?)\]\((.*?) "(.*)"\)/gm,E='<a href="$2" title="$3">$1</a>',R=/\[(.*?)\]\((.*?)\)/gm,z='<a href="$2">$1</a>',A=/^[\t ]*?(?:-|\+|\*) (.*)/gm,B=/(\<\/ul\>\n(.*)\<ul\>*)+/g,C="<ul><li>$1</li></ul>",D=/^[\t ]*?(?:\d(?:\)|\.)) (.*)/gm,F=/(\<\/ol\>\n(.*)\<ol\>*)+/g,G="<ol><li>$1</li></ol>",H=/^\n\n+/gm,I="<br>";return function(J){var K=[],L=0;J=J.replace(e,r).replace(g,function(e,r,l){var c="{code-block-"+L+"}",n=new RegExp("{code-block-"+L+"}","g");return K[L++]={lang:r,block:l,regex:n},c}).replace(n,"").replace(t,a).replace(o,p).replace(m,i).replace($,u).replace(f,s).replace(d,h).replace(A,C).replace(B,"").replace(D,G).replace(F,"").replace(v,k).replace(_,b).replace(q,E).replace(R,z).replace(x,w).replace(y,j).replace(H,I).replace(l,c);for(var M=0;M<L;M++){var N=K[M],O=N.lang,P=N.block;J=J.replace(N.regex,function(e){return'<pre><code class="language-'+O+'">'+P+"</code></pre>"})}return J}}); |
@@ -5,3 +5,3 @@ { | ||
"description": "a lightweight markdown parser", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"homepage": "https://github.com/thysultan/md.js", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
9186