diff --git a/default-md-files/folder/some-file.md b/default-md-files/folder/edge-cases.md similarity index 69% rename from default-md-files/folder/some-file.md rename to default-md-files/folder/edge-cases.md index 910f798..4b1c194 100644 --- a/default-md-files/folder/some-file.md +++ b/default-md-files/folder/edge-cases.md @@ -1,4 +1,4 @@ -## This is a file in a folder +## Edge Cases that break the build Bug fix from bbc/web repo. Code block in a NOTE blockquote. @@ -19,4 +19,30 @@ Bug fix from bbc/web repo. Code block in a NOTE blockquote. > ); > } > `; -> ``` \ No newline at end of file +> ``` + + +> **bold text +> Blockquotes with Unclosed Markdown Syntax. **This text is actually bold** + + +> Emoji shortcuts +> :warning: Be careful! + + +> Tables in blockquotes +> --- +> | Header | Value | +> |--------|-------| +> | a | b | + + +> +> +> Some text with blank spaces above + + +> Nested lists in blockquotes +> 1. Item one + > - Subitem +> 2. Item two \ No newline at end of file diff --git a/src/markdown-to-html-parser.js b/src/markdown-to-html-parser.js index 7bab474..71c41eb 100644 --- a/src/markdown-to-html-parser.js +++ b/src/markdown-to-html-parser.js @@ -47,10 +47,8 @@ const parseToHTML = (markdown, options = {}) => { textString += this.parser.parseInline(token.tokens) } else if (token.type === 'space') { textString += this.parser.parseInline([{ type: 'br', text: token.text, raw: token.raw }]) - } else if (token.type === 'list') { - textString += marked.Renderer.prototype.list.call(this, token) - } else if (token.type === 'code') { - textString += marked.Renderer.prototype.code.call(this, token) + } else if (['list', 'code', 'hr', 'table'].includes(token.type)) { + textString += marked.Renderer.prototype[token.type].call(this, token) // use default renderer for these block-level tokens } else { textString += this.parser.parseInline(tokens) }