remove toplevel html block check, change language class
This commit is contained in:
parent
e207549e9d
commit
60de96800e
@ -23,17 +23,6 @@ var block = {
|
||||
paragraph: /^/
|
||||
};
|
||||
|
||||
block.html = (function() {
|
||||
var elements = '' // from: github.com/Kroc/ReMarkable
|
||||
+ '(article|aside|audio|blockquote|canvas|caption|col|colgroup|dialog|div'
|
||||
+ '|d[ltd]|embed|fieldset|figure|figcaption|footer|form|h[1-6r]|header'
|
||||
+ '|hgroup|input|label|legend|li|nav|noscript|object|[ou]l|optgroup|option'
|
||||
+ '|p|param|pre|script|section|select|source|table|t(?:body|foot|head)'
|
||||
+ '|t[dhr]|textarea|video)';
|
||||
|
||||
return new RegExp(block.html.source.replace('(\\w+)', elements));
|
||||
})();
|
||||
|
||||
block.paragraph = (function() {
|
||||
var body = [];
|
||||
|
||||
@ -41,7 +30,7 @@ block.paragraph = (function() {
|
||||
// immediately follow a line of text on the top level.
|
||||
// everything below conforms to markdown.pl.
|
||||
(function push(rule) {
|
||||
rule = block[rule].source.replace('\\1', '\\w+');
|
||||
rule = rule.source || block[rule].source;
|
||||
body.push(rule.replace(/(^|[^\[])\^/g, '$1'));
|
||||
return push;
|
||||
})
|
||||
@ -52,7 +41,15 @@ block.paragraph = (function() {
|
||||
('lheading')
|
||||
('blockquote')
|
||||
// no list
|
||||
('html');
|
||||
|
||||
// html - stop before block-level elements only
|
||||
// from: github.com/Kroc/ReMarkable
|
||||
(new RegExp('<'
|
||||
+ '(?:article|aside|audio|blockquote|canvas|caption|col|colgroup|dialog|div'
|
||||
+ '|d[ltd]|embed|fieldset|figure|figcaption|footer|form|h[1-6r]|header'
|
||||
+ '|hgroup|input|label|legend|li|nav|noscript|object|[ou]l|optgroup|option'
|
||||
+ '|p|param|pre|script|section|select|source|table|t(?:body|foot|head)'
|
||||
+ '|t[dhr]|textarea|video)'));
|
||||
|
||||
body = body.join('|');
|
||||
|
||||
@ -493,7 +490,7 @@ var tok = function() {
|
||||
case 'code': {
|
||||
return '<pre><code'
|
||||
+ (token.lang
|
||||
? ' class="lang-'
|
||||
? ' class="'
|
||||
+ token.lang
|
||||
+ '"'
|
||||
: '')
|
||||
|
@ -1,3 +1,3 @@
|
||||
<pre><code class="lang-js">var a = 'hello';
|
||||
<pre><code class="js">var a = 'hello';
|
||||
console.log(a + ' world');
|
||||
</code></pre>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<pre><code class="lang-js">var a = 'hello';
|
||||
<pre><code class="js">var a = 'hello';
|
||||
console.log(a + ' world');
|
||||
</code></pre>
|
||||
|
Loading…
x
Reference in New Issue
Block a user