Skip to content

Commit

Permalink
can use both heading(#, ##, ###...) and kepan heading(#1, #2, #3...) …
Browse files Browse the repository at this point in the history
…at one time.
  • Loading branch information
vagra committed Oct 31, 2020
1 parent 0824806 commit 9e1a7e4
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 46 deletions.
35 changes: 25 additions & 10 deletions lib/marked.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ const block = {
code: /^( {4}[^\n]+\n*)+/,
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
heading: /^ {0,3}#(\d{1,3}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
kheading: /^ {0,3}#(\d{1,3}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html: '^ {0,3}(?:' // optional indentation
Expand All @@ -326,7 +327,7 @@ const block = {
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
// regex template, placeholders will be replaced according to different paragraph
// interruption rules of commonmark and the original markdown spec:
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
_paragraph: /^([^\n]+(?:\n(?!hr|heading|kheading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
text: /^[^\n]+/
};

Expand All @@ -351,7 +352,7 @@ block.list = edit$1(block.list)

block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
+ '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
+ '|figure|footer|form|frame|frameset|h\\d{1,3}|head|header|hr|html|iframe'
+ '|figure|footer|form|frame|frameset|h[1-6]|h\\d{1,3}|head|header|hr|html|iframe'
+ '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
+ '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
+ '|track|ul';
Expand All @@ -364,7 +365,8 @@ block.html = edit$1(block.html, 'i')

block.paragraph = edit$1(block._paragraph)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#\\d{1,3} ')
.replace('heading', ' {0,3}#{1,6} ')
.replace('kheading', ' {0,3}#\\d{1,3} ')
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
Expand All @@ -390,15 +392,16 @@ block.normal = merge$1({}, block);
block.gfm = merge$1({}, block.normal, {
nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
+ ' *([-:]+ *\\|[-| :]*)' // Align
+ '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
+ '(?:\\n((?:(?!\\n|hr|heading|kheading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
table: '^ *\\|(.+)\\n' // Header
+ ' *\\|?( *[-:]+[-| :]*)' // Align
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
+ '(?:\\n *((?:(?!\\n|hr|heading|kheading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
});

block.gfm.nptable = edit$1(block.gfm.nptable)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#\\d{1,3} ')
.replace('heading', ' {0,3}#{1,6} ')
.replace('kheading', ' {0,3}#\\d{1,3} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\n]')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
Expand All @@ -409,7 +412,8 @@ block.gfm.nptable = edit$1(block.gfm.nptable)

block.gfm.table = edit$1(block.gfm.table)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#\\d{1,3} ')
.replace('heading', ' {0,3}#{1,6} ')
.replace('kheading', ' {0,3}#\\d{1,3} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\n]')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
Expand All @@ -434,11 +438,11 @@ block.pedantic = merge$1({}, block.normal, {
+ '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
.getRegex(),
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
heading: /^ *#(\d{1,3}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
fences: noopTest$1, // fences not supported
paragraph: edit$1(block.normal._paragraph)
.replace('hr', block.hr)
.replace('heading', ' *#\\d{1,3} *[^\n]')
.replace('heading', ' *#{1,6} *[^\n]')
.replace('lheading', block.lheading)
.replace('blockquote', ' {0,3}>')
.replace('|fences', '')
Expand Down Expand Up @@ -677,6 +681,17 @@ var Lexer_1 = class Lexer {

// heading
if (cap = this.rules.heading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({
type: 'heading',
depth: cap[1].length,
text: cap[2]
});
continue;
}

// kheading
if (cap = this.rules.kheading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({
type: 'heading',
Expand Down
32 changes: 22 additions & 10 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@
code: /^( {4}[^\n]+\n*)+/,
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
heading: /^ {0,3}#(\d{1,3}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
kheading: /^ {0,3}#(\d{1,3}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html: '^ {0,3}(?:' // optional indentation
Expand All @@ -373,7 +374,7 @@
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
// regex template, placeholders will be replaced according to different paragraph
// interruption rules of commonmark and the original markdown spec:
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
_paragraph: /^([^\n]+(?:\n(?!hr|heading|kheading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
text: /^[^\n]+/
};
block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
Expand All @@ -383,10 +384,10 @@
block.item = /^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/;
block.item = edit$1(block.item, 'gm').replace(/bull/g, block.bullet).getRegex();
block.list = edit$1(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex();
block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h\\d{1,3}|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';
block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|h\\d{1,3}|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';
block._comment = /<!--(?!-?>)[\s\S]*?-->/;
block.html = edit$1(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
block.paragraph = edit$1(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#\\d{1,3} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
block.paragraph = edit$1(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('kheading', ' {0,3}#\\d{1,3} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
.replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
.getRegex();
Expand All @@ -403,17 +404,17 @@
block.gfm = merge$1({}, block.normal, {
nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
+ ' *([-:]+ *\\|[-| :]*)' // Align
+ '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)',
+ '(?:\\n((?:(?!\\n|hr|heading|kheading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)',
// Cells
table: '^ *\\|(.+)\\n' // Header
+ ' *\\|?( *[-:]+[-| :]*)' // Align
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
+ '(?:\\n *((?:(?!\\n|hr|heading|kheading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells

});
block.gfm.nptable = edit$1(block.gfm.nptable).replace('hr', block.hr).replace('heading', ' {0,3}#\\d{1,3} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
block.gfm.nptable = edit$1(block.gfm.nptable).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('kheading', ' {0,3}#\\d{1,3} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
.getRegex();
block.gfm.table = edit$1(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#\\d{1,3} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
block.gfm.table = edit$1(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('kheading', ' {0,3}#\\d{1,3} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
.getRegex();
/**
Expand All @@ -424,10 +425,10 @@
html: edit$1('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b').getRegex(),
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
heading: /^ *#(\d{1,3}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
fences: noopTest$1,
// fences not supported
paragraph: edit$1(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#\\d{1,3} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex()
paragraph: edit$1(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex()
});
/**
* Inline-Level Grammar
Expand Down Expand Up @@ -605,6 +606,17 @@


if (cap = this.rules.heading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({
type: 'heading',
depth: cap[1].length,
text: cap[2]
});
continue;
} // kheading


if (cap = this.rules.kheading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({
type: 'heading',
Expand Down
2 changes: 1 addition & 1 deletion marked.min.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/Lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ module.exports = class Lexer {

// heading
if (cap = this.rules.heading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({
type: 'heading',
depth: cap[1].length,
text: cap[2]
});
continue;
}

// kheading
if (cap = this.rules.kheading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({
type: 'heading',
Expand Down
24 changes: 14 additions & 10 deletions src/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const block = {
code: /^( {4}[^\n]+\n*)+/,
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
heading: /^ {0,3}#(\d{1,3}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
kheading: /^ {0,3}#(\d{1,3}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html: '^ {0,3}(?:' // optional indentation
Expand All @@ -31,7 +32,7 @@ const block = {
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
// regex template, placeholders will be replaced according to different paragraph
// interruption rules of commonmark and the original markdown spec:
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
_paragraph: /^([^\n]+(?:\n(?!hr|heading|kheading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
text: /^[^\n]+/
};

Expand All @@ -56,7 +57,7 @@ block.list = edit(block.list)

block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
+ '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
+ '|figure|footer|form|frame|frameset|h\\d{1,3}|head|header|hr|html|iframe'
+ '|figure|footer|form|frame|frameset|h[1-6]|h\\d{1,3}|head|header|hr|html|iframe'
+ '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
+ '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
+ '|track|ul';
Expand All @@ -69,7 +70,8 @@ block.html = edit(block.html, 'i')

block.paragraph = edit(block._paragraph)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#\\d{1,3} ')
.replace('heading', ' {0,3}#{1,6} ')
.replace('kheading', ' {0,3}#\\d{1,3} ')
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
Expand All @@ -95,15 +97,16 @@ block.normal = merge({}, block);
block.gfm = merge({}, block.normal, {
nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
+ ' *([-:]+ *\\|[-| :]*)' // Align
+ '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
+ '(?:\\n((?:(?!\\n|hr|heading|kheading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
table: '^ *\\|(.+)\\n' // Header
+ ' *\\|?( *[-:]+[-| :]*)' // Align
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
+ '(?:\\n *((?:(?!\\n|hr|heading|kheading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
});

block.gfm.nptable = edit(block.gfm.nptable)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#\\d{1,3} ')
.replace('heading', ' {0,3}#{1,6} ')
.replace('kheading', ' {0,3}#\\d{1,3} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\n]')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
Expand All @@ -114,7 +117,8 @@ block.gfm.nptable = edit(block.gfm.nptable)

block.gfm.table = edit(block.gfm.table)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#\\d{1,3} ')
.replace('heading', ' {0,3}#{1,6} ')
.replace('kheading', ' {0,3}#\\d{1,3} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\n]')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
Expand All @@ -139,11 +143,11 @@ block.pedantic = merge({}, block.normal, {
+ '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
.getRegex(),
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
heading: /^ *#(\d{1,3}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
fences: noopTest, // fences not supported
paragraph: edit(block.normal._paragraph)
.replace('hr', block.hr)
.replace('heading', ' *#\\d{1,3} *[^\n]')
.replace('heading', ' *#{1,6} *[^\n]')
.replace('lheading', block.lheading)
.replace('blockquote', ' {0,3}>')
.replace('|fences', '')
Expand Down
2 changes: 1 addition & 1 deletion test/specs/commonmark/commonmark.0.29.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
},
{
"markdown": "# bolt\n\n#hashtag\n",
"html": "<p># bolt</p>\n<p>#hashtag</p>\n",
"html": "<h1>bolt</h1>\n<p>#hashtag</p>\n",
"example": 34,
"start_line": 802,
"end_line": 809,
Expand Down
2 changes: 1 addition & 1 deletion test/specs/gfm/commonmark.0.29.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
},
{
"markdown": "# bolt\n\n#hashtag\n",
"html": "<p># bolt</p>\n<p>#hashtag</p>\n",
"html": "<h1>bolt</h1>\n<p>#hashtag</p>\n",
"example": 34,
"start_line": 802,
"end_line": 809,
Expand Down
6 changes: 3 additions & 3 deletions test/specs/new/nogfm_hashtag.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
gfm: false
pedantic: true
---
#1header
#header

#1 header1
# header1

#1 header2
# header2
2 changes: 1 addition & 1 deletion test/specs/new/pedantic_heading_interrupts_paragraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pedantic: true
---

paragraph before head with hash
#1how are you
#how are you

paragraph before head with equals
how are you again
Expand Down
12 changes: 6 additions & 6 deletions test/specs/original/markdown_documentation_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ can [see the source for it by adding '.text' to the URL] [src].
[src]: /projects/markdown/basics.text


#2 Paragraphs, Headers, Blockquotes ##
## Paragraphs, Headers, Blockquotes ##

A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like a
Expand Down Expand Up @@ -101,7 +101,7 @@ Output:



#3 Phrase Emphasis ###
### Phrase Emphasis ###

Markdown uses asterisks and underscores to indicate spans of emphasis.

Expand All @@ -123,7 +123,7 @@ Output:



#2 Lists ##
## Lists ##

Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
`+`, and `-`) as list markers. These three markers are
Expand Down Expand Up @@ -188,7 +188,7 @@ Output:



#3 Links ###
### Links ###

Markdown supports two styles for creating links: *inline* and
*reference*. With both styles, you use square brackets to delimit the
Expand Down Expand Up @@ -244,7 +244,7 @@ Output:
<a href="http://www.nytimes.com/">The New York Times</a>.</p>


#3 Images ###
### Images ###

Image syntax is very much like link syntax.

Expand All @@ -264,7 +264,7 @@ Both of the above examples produce the same output:



#3 Code ###
### Code ###

In a regular paragraph, you can create code span by wrapping text in
backtick quotes. Any ampersands (`&`) and angle brackets (`<` or
Expand Down
Loading

0 comments on commit 9e1a7e4

Please sign in to comment.