Repository: showdownjs/showdown Branch: master Commit: 2a8a64eb3dd1 Files: 899 Total size: 1014.2 KB Directory structure: gitextract_un81wrs2/ ├── .editorconfig ├── .eslintrc.json ├── .gitattributes ├── .github/ │ └── workflows/ │ ├── browserstack.yml │ ├── codeql-analysis.yml │ ├── docs.yml │ ├── node.linux.yml │ └── node.win.yml ├── .gitignore ├── .jshintignore ├── .jshintrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── CREDITS.md ├── DONATIONS.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── SECURITY.md ├── TASKS.TODO.md ├── bin/ │ └── showdown.js ├── bower.json ├── dist/ │ └── showdown.js ├── docs/ │ ├── assets/ │ │ └── extra.css │ ├── available-options.md │ ├── cli.md │ ├── compatibility.md │ ├── configuration.md │ ├── create-extension.md │ ├── credits.md │ ├── donations.md │ ├── event_system.md │ ├── extensions-list.md │ ├── extensions.md │ ├── flavors.md │ ├── index.md │ ├── integrations.md │ ├── markdown-syntax.md │ ├── quickstart.md │ ├── tutorials/ │ │ ├── add-default-class-to-html.md │ │ ├── index.md │ │ ├── markdown-editor-with-showdown.md │ │ └── use-both-extension-types-together.md │ └── xss.md ├── karma.browserstack.js ├── karma.conf.js ├── mkdocs.yml ├── package.json ├── performance.json ├── performance.log.md ├── src/ │ ├── cli/ │ │ └── cli.js │ ├── converter.js │ ├── helpers.js │ ├── loader.js │ ├── options.js │ ├── showdown.js │ └── subParsers/ │ ├── makehtml/ │ │ ├── blockGamut.js │ │ ├── blockQuotes.js │ │ ├── codeBlocks.js │ │ ├── codeSpans.js │ │ ├── completeHTMLDocument.js │ │ ├── detab.js │ │ ├── ellipsis.js │ │ ├── emoji.js │ │ ├── encodeAmpsAndAngles.js │ │ ├── encodeBackslashEscapes.js │ │ ├── encodeCode.js │ │ ├── escapeSpecialCharsWithinTagAttributes.js │ │ ├── githubCodeBlocks.js │ │ ├── hashBlock.js │ │ ├── hashCodeTags.js │ │ ├── hashElement.js │ │ ├── hashHTMLBlocks.js │ │ ├── hashHTMLSpans.js │ │ ├── hashPreCodeTags.js │ │ ├── headers.js │ │ ├── horizontalRule.js │ │ ├── images.js │ │ ├── italicsAndBold.js │ │ ├── links.js │ │ ├── lists.js │ │ ├── metadata.js │ │ ├── outdent.js │ │ ├── paragraphs.js │ │ ├── runExtension.js │ │ ├── spanGamut.js │ │ ├── strikethrough.js │ │ ├── stripLinkDefinitions.js │ │ ├── tables.js │ │ ├── underline.js │ │ └── unescapeSpecialChars.js │ └── makemarkdown/ │ ├── blockquote.js │ ├── break.js │ ├── codeBlock.js │ ├── codeSpan.js │ ├── emphasis.js │ ├── header.js │ ├── hr.js │ ├── image.js │ ├── input.js │ ├── links.js │ ├── list.js │ ├── listItem.js │ ├── node.js │ ├── paragraph.js │ ├── pre.js │ ├── strikethrough.js │ ├── strong.js │ ├── table.js │ ├── tableCell.js │ └── txt.js └── test/ ├── bootstrap.js ├── cli/ │ ├── basic.html │ └── basic.md ├── functional/ │ ├── makehtml/ │ │ ├── cases/ │ │ │ ├── commonmark.testsuite.json │ │ │ ├── features/ │ │ │ │ ├── #143.support-image-dimensions.html │ │ │ │ ├── #143.support-image-dimensions.md │ │ │ │ ├── #164.1.simple-autolink.html │ │ │ │ ├── #164.1.simple-autolink.md │ │ │ │ ├── #164.2.disallow-underscore-emphasis-mid-word.html │ │ │ │ ├── #164.2.disallow-underscore-emphasis-mid-word.md │ │ │ │ ├── #164.3.strikethrough.html │ │ │ │ ├── #164.3.strikethrough.md │ │ │ │ ├── #164.4.tasklists.html │ │ │ │ ├── #164.4.tasklists.md │ │ │ │ ├── #178.markdown-inside-html-does-not-parse.html │ │ │ │ ├── #178.markdown-inside-html-does-not-parse.md │ │ │ │ ├── #198.literalMidWordUnderscores-changes-behavior-of-asterisk.html │ │ │ │ ├── #198.literalMidWordUnderscores-changes-behavior-of-asterisk.md │ │ │ │ ├── #204.certain-links-with-at-and-dot-break-url.html │ │ │ │ ├── #204.certain-links-with-at-and-dot-break-url.md │ │ │ │ ├── #206.treat-single-line-breaks-as-br.html │ │ │ │ ├── #206.treat-single-line-breaks-as-br.md │ │ │ │ ├── #214.escaped-markdown-chars-break-strikethrough.html │ │ │ │ ├── #214.escaped-markdown-chars-break-strikethrough.md │ │ │ │ ├── #259.es6-template-strings-indentation-issues.html │ │ │ │ ├── #259.es6-template-strings-indentation-issues.md │ │ │ │ ├── #284.simplifiedAutoLink-does-not-match-GFM-style.html │ │ │ │ ├── #284.simplifiedAutoLink-does-not-match-GFM-style.md │ │ │ │ ├── #316.new-simpleLineBreaks-option-breaks-lists.html │ │ │ │ ├── #316.new-simpleLineBreaks-option-breaks-lists.md │ │ │ │ ├── #318.simpleLineBreaks-does-not-work-with-chinese-characters.html │ │ │ │ ├── #318.simpleLineBreaks-does-not-work-with-chinese-characters.md │ │ │ │ ├── #320.github-compatible-generated-header-id.html │ │ │ │ ├── #320.github-compatible-generated-header-id.md │ │ │ │ ├── #323.simpleLineBreaks-breaks-with-strong.html │ │ │ │ ├── #323.simpleLineBreaks-breaks-with-strong.md │ │ │ │ ├── #330.simplifiedAutoLink-drops-character-before-and-after-linked-mail.html │ │ │ │ ├── #330.simplifiedAutoLink-drops-character-before-and-after-linked-mail.md │ │ │ │ ├── #331.allow-escaping-of-tilde.html │ │ │ │ ├── #331.allow-escaping-of-tilde.md │ │ │ │ ├── #355.simplifiedAutoLink-URLs-inside-parenthesis-followed-by-another-character-are-not-parsed-correctly.html │ │ │ │ ├── #355.simplifiedAutoLink-URLs-inside-parenthesis-followed-by-another-character-are-not-parsed-correctly.md │ │ │ │ ├── #374.escape-html-tags.html │ │ │ │ ├── #374.escape-html-tags.md │ │ │ │ ├── #378.simplifiedAutoLinks-with-excludeTrailingPunctuationFromURLs.html │ │ │ │ ├── #378.simplifiedAutoLinks-with-excludeTrailingPunctuationFromURLs.md │ │ │ │ ├── #379.openLinksInNewWindow-breaks-em-markdup.html │ │ │ │ ├── #379.openLinksInNewWindow-breaks-em-markdup.md │ │ │ │ ├── #398.literalMidWordAsterisks-treats-non-word-characters-as-characters.html │ │ │ │ ├── #398.literalMidWordAsterisks-treats-non-word-characters-as-characters.md │ │ │ │ ├── #69.header-level-start.html │ │ │ │ ├── #69.header-level-start.md │ │ │ │ ├── #709.allow-whitespaces-after-end-in-metadata.html │ │ │ │ ├── #709.allow-whitespaces-after-end-in-metadata.md │ │ │ │ ├── completeHTMLOutput/ │ │ │ │ │ ├── simple.html │ │ │ │ │ └── simple.md │ │ │ │ ├── customizedHeaderId-simple.html │ │ │ │ ├── customizedHeaderId-simple.md │ │ │ │ ├── disable-email-encoding.html │ │ │ │ ├── disable-email-encoding.md │ │ │ │ ├── disable-gh-codeblocks.html │ │ │ │ ├── disable-gh-codeblocks.md │ │ │ │ ├── disableForced4SpacesIndentedSublists/ │ │ │ │ │ └── .gitkeep │ │ │ │ ├── disableForced4SpacesIndentedSublists.html │ │ │ │ ├── disableForced4SpacesIndentedSublists.md │ │ │ │ ├── ellipsis/ │ │ │ │ │ ├── ellipsis.html │ │ │ │ │ └── ellipsis.md │ │ │ │ ├── emojis/ │ │ │ │ │ ├── complex.html │ │ │ │ │ ├── complex.md │ │ │ │ │ ├── links.html │ │ │ │ │ ├── links.md │ │ │ │ │ ├── simple.html │ │ │ │ │ ├── simple.md │ │ │ │ │ ├── simplifiedautolinks.html │ │ │ │ │ ├── simplifiedautolinks.md │ │ │ │ │ ├── special.html │ │ │ │ │ └── special.md │ │ │ │ ├── excludeTrailingPunctuationFromURLs-option.html │ │ │ │ ├── excludeTrailingPunctuationFromURLs-option.md │ │ │ │ ├── ghMentions.html │ │ │ │ ├── ghMentions.md │ │ │ │ ├── literalMidWordAsterisks/ │ │ │ │ │ ├── basic.html │ │ │ │ │ ├── basic.md │ │ │ │ │ ├── punctation-test.html │ │ │ │ │ └── punctation-test.md │ │ │ │ ├── literalMidWordUnderscores/ │ │ │ │ │ ├── basic.html │ │ │ │ │ ├── basic.md │ │ │ │ │ ├── punctation-test.html │ │ │ │ │ └── punctation-test.md │ │ │ │ ├── metadata/ │ │ │ │ │ ├── dashes-conflict.html │ │ │ │ │ ├── dashes-conflict.md │ │ │ │ │ ├── embeded-in-output.html │ │ │ │ │ ├── embeded-in-output.md │ │ │ │ │ ├── embeded-two-consecutive-metadata-blocks-different-symbols.html │ │ │ │ │ ├── embeded-two-consecutive-metadata-blocks-different-symbols.md │ │ │ │ │ ├── embeded-two-consecutive-metadata-blocks.html │ │ │ │ │ ├── embeded-two-consecutive-metadata-blocks.md │ │ │ │ │ ├── ignore-metadata.html │ │ │ │ │ ├── ignore-metadata.md │ │ │ │ │ ├── simple-angled-for-method.html │ │ │ │ │ ├── simple-angled-for-method.md │ │ │ │ │ ├── simple-angled-quotes.html │ │ │ │ │ ├── simple-angled-quotes.md │ │ │ │ │ ├── simple-three-dashes.html │ │ │ │ │ ├── simple-three-dashes.md │ │ │ │ │ ├── simple-with-format.html │ │ │ │ │ └── simple-with-format.md │ │ │ │ ├── moreStyling/ │ │ │ │ │ ├── tasklists-with-styling.html │ │ │ │ │ └── tasklists-with-styling.md │ │ │ │ ├── openLinksInNewWindow/ │ │ │ │ │ ├── hash-links-open-in-same-page.html │ │ │ │ │ ├── hash-links-open-in-same-page.md │ │ │ │ │ ├── simple-cases.html │ │ │ │ │ ├── simple-cases.md │ │ │ │ │ ├── simple.html │ │ │ │ │ ├── simple.md │ │ │ │ │ ├── simplifiedAutoLink.html │ │ │ │ │ └── simplifiedAutoLink.md │ │ │ │ ├── prefixHeaderId-simple.html │ │ │ │ ├── prefixHeaderId-simple.md │ │ │ │ ├── prefixHeaderId-string-and-ghCompatibleHeaderId.html │ │ │ │ ├── prefixHeaderId-string-and-ghCompatibleHeaderId.md │ │ │ │ ├── prefixHeaderId-string-and-ghCompatibleHeaderId2.html │ │ │ │ ├── prefixHeaderId-string-and-ghCompatibleHeaderId2.md │ │ │ │ ├── prefixHeaderId-string.html │ │ │ │ ├── prefixHeaderId-string.md │ │ │ │ ├── rawHeaderId/ │ │ │ │ │ ├── simple.html │ │ │ │ │ ├── simple.md │ │ │ │ │ ├── with-prefixHeaderId.html │ │ │ │ │ └── with-prefixHeaderId.md │ │ │ │ ├── rawPrefixHeaderId/ │ │ │ │ │ ├── simple-with-prefixHeaderId.html │ │ │ │ │ └── simple-with-prefixHeaderId.md │ │ │ │ ├── relativePathBaseUrl.html │ │ │ │ ├── relativePathBaseUrl.md │ │ │ │ ├── requireSpaceBeforeHeadingText.html │ │ │ │ ├── requireSpaceBeforeHeadingText.md │ │ │ │ ├── simpleLineBreaks-handle-html-pre.html │ │ │ │ ├── simpleLineBreaks-handle-html-pre.md │ │ │ │ ├── simpleLineBreaks2.html │ │ │ │ ├── simpleLineBreaks2.md │ │ │ │ ├── simplifiedAutoLink/ │ │ │ │ │ ├── autolinks-with-magic-chars.html │ │ │ │ │ ├── autolinks-with-magic-chars.md │ │ │ │ │ ├── blockquote.html │ │ │ │ │ ├── blockquote.md │ │ │ │ │ ├── codespans.html │ │ │ │ │ ├── codespans.md │ │ │ │ │ ├── complete-test-case.html │ │ │ │ │ ├── complete-test-case.md │ │ │ │ │ ├── disallow-underscores.html │ │ │ │ │ ├── disallow-underscores.md │ │ │ │ │ ├── does-not-parse-inside-a-tags.html │ │ │ │ │ ├── does-not-parse-inside-a-tags.md │ │ │ │ │ ├── does-not-parse-inside-code.html │ │ │ │ │ ├── does-not-parse-inside-code.md │ │ │ │ │ ├── does-not-parse-reference-links.html │ │ │ │ │ ├── does-not-parse-reference-links.md │ │ │ │ │ ├── emphasis-and-strikethrough.html │ │ │ │ │ ├── emphasis-and-strikethrough.md │ │ │ │ │ ├── ordered-lists.html │ │ │ │ │ ├── ordered-lists.md │ │ │ │ │ ├── text.html │ │ │ │ │ ├── text.md │ │ │ │ │ ├── trailing-punctuation.html │ │ │ │ │ ├── trailing-punctuation.md │ │ │ │ │ ├── unordered-lists.html │ │ │ │ │ ├── unordered-lists.md │ │ │ │ │ ├── wrapping-parenthesis.html │ │ │ │ │ └── wrapping-parenthesis.md │ │ │ │ ├── splitAdjacentBlockquotes/ │ │ │ │ │ ├── basic.html │ │ │ │ │ ├── basic.md │ │ │ │ │ ├── multiline-paragraph.html │ │ │ │ │ └── multiline-paragraph.md │ │ │ │ ├── tables/ │ │ │ │ │ ├── #179.parse-md-in-table-ths.html │ │ │ │ │ ├── #179.parse-md-in-table-ths.md │ │ │ │ │ ├── #256.table-header-separators-should-not-require-3-dashes.html │ │ │ │ │ ├── #256.table-header-separators-should-not-require-3-dashes.md │ │ │ │ │ ├── #345.escape-pipe-character.html │ │ │ │ │ ├── #345.escape-pipe-character.md │ │ │ │ │ ├── #406.does-not-render-one-column-tables.html │ │ │ │ │ ├── #406.does-not-render-one-column-tables.md │ │ │ │ │ ├── #442.trailing-spaces-break-one-column-tables.html │ │ │ │ │ ├── #442.trailing-spaces-break-one-column-tables.md │ │ │ │ │ ├── #443.2.table-followed-by-list-does-not-parse-correctly.html │ │ │ │ │ ├── #443.2.table-followed-by-list-does-not-parse-correctly.md │ │ │ │ │ ├── #443.table-followed-by-list-does-not-parse-correctly.html │ │ │ │ │ ├── #443.table-followed-by-list-does-not-parse-correctly.md │ │ │ │ │ ├── #465.code-spans-with-pipes-break-table.html │ │ │ │ │ ├── #465.code-spans-with-pipes-break-table.md │ │ │ │ │ ├── #471.ol-is-not-rendered-correctly-inside-table.html │ │ │ │ │ ├── #471.ol-is-not-rendered-correctly-inside-table.md │ │ │ │ │ ├── basic-alignment.html │ │ │ │ │ ├── basic-alignment.md │ │ │ │ │ ├── basic-with-header-ids.html │ │ │ │ │ ├── basic-with-header-ids.md │ │ │ │ │ ├── basic.html │ │ │ │ │ ├── basic.md │ │ │ │ │ ├── gh-style-tables.html │ │ │ │ │ ├── gh-style-tables.md │ │ │ │ │ ├── large-table-with-allignments.html │ │ │ │ │ ├── large-table-with-allignments.md │ │ │ │ │ ├── large.html │ │ │ │ │ ├── large.md │ │ │ │ │ ├── mixed-alignment.html │ │ │ │ │ ├── mixed-alignment.md │ │ │ │ │ ├── multiple-tables.html │ │ │ │ │ ├── multiple-tables.md │ │ │ │ │ ├── table-inside-codeblock.html │ │ │ │ │ ├── table-inside-codeblock.md │ │ │ │ │ ├── table-without-leading-pipe.html │ │ │ │ │ ├── table-without-leading-pipe.md │ │ │ │ │ ├── with-equals.html │ │ │ │ │ ├── with-equals.md │ │ │ │ │ ├── with-span-elements.html │ │ │ │ │ ├── with-span-elements.md │ │ │ │ │ ├── with-surroundings.html │ │ │ │ │ ├── with-surroundings.md │ │ │ │ │ ├── without-body.html │ │ │ │ │ ├── without-body.md │ │ │ │ │ ├── without-header-delimiter.html │ │ │ │ │ └── without-header-delimiter.md │ │ │ │ └── underline/ │ │ │ │ ├── fulltext.html │ │ │ │ ├── fulltext.md │ │ │ │ ├── simple.html │ │ │ │ └── simple.md │ │ │ ├── ghost/ │ │ │ │ ├── markdown-magic.html │ │ │ │ ├── markdown-magic.md │ │ │ │ ├── underscore.html │ │ │ │ └── underscore.md │ │ │ ├── issues/ │ │ │ │ ├── #107.inner-underscore-parse-to-block.html │ │ │ │ ├── #107.inner-underscore-parse-to-block.md │ │ │ │ ├── #142.odd-behaviour-for-multiple-consecutive-lists.html │ │ │ │ ├── #142.odd-behaviour-for-multiple-consecutive-lists.md │ │ │ │ ├── #150.hyphens-are-getting-removed.html │ │ │ │ ├── #150.hyphens-are-getting-removed.md │ │ │ │ ├── #183.gh-code-blocks-within-lists-do-not-render-properly.html │ │ │ │ ├── #183.gh-code-blocks-within-lists-do-not-render-properly.md │ │ │ │ ├── #191.blockquote-followed-by-an-heading.html │ │ │ │ ├── #191.blockquote-followed-by-an-heading.md │ │ │ │ ├── #196.entity-in-code-block-in-nested-list.html │ │ │ │ ├── #196.entity-in-code-block-in-nested-list.md │ │ │ │ ├── #220.html-breaks-markdown-parsing.html │ │ │ │ ├── #220.html-breaks-markdown-parsing.md │ │ │ │ ├── #229.2.code-being-parsed-inside-HTML-code-tags.html │ │ │ │ ├── #229.2.code-being-parsed-inside-HTML-code-tags.md │ │ │ │ ├── #229.code-being-parsed-inside-HTML-code-tags.html │ │ │ │ ├── #229.code-being-parsed-inside-HTML-code-tags.md │ │ │ │ ├── #230.paragraphs-are-ignored-between-code-tags.html │ │ │ │ ├── #230.paragraphs-are-ignored-between-code-tags.md │ │ │ │ ├── #236.wrong-lt-parsing-when-attached-to-word.html │ │ │ │ ├── #236.wrong-lt-parsing-when-attached-to-word.md │ │ │ │ ├── #261.mix-images-with-links.html │ │ │ │ ├── #261.mix-images-with-links.md │ │ │ │ ├── #261.reference-style-image-after-inline-style-image-does-not-work-correctely.html │ │ │ │ ├── #261.reference-style-image-after-inline-style-image-does-not-work-correctely.md │ │ │ │ ├── #261.reference-style-link-after-inline-style-link-does-not-work-correctely.html │ │ │ │ ├── #261.reference-style-link-after-inline-style-link-does-not-work-correctely.md │ │ │ │ ├── #288.code-blocks-containing-xml-comments-are-not-converted-correctly-when-nested-in-list-items.html │ │ │ │ ├── #288.code-blocks-containing-xml-comments-are-not-converted-correctly-when-nested-in-list-items.md │ │ │ │ ├── #299.nested-ordered-unordered-list-inconsistent-behavior-2.html │ │ │ │ ├── #299.nested-ordered-unordered-list-inconsistent-behavior-2.md │ │ │ │ ├── #299.nested-ordered-unordered-list-inconsistent-behavior-3.html │ │ │ │ ├── #299.nested-ordered-unordered-list-inconsistent-behavior-3.md │ │ │ │ ├── #299.nested-ordered-unordered-list-inconsistent-behavior.html │ │ │ │ ├── #299.nested-ordered-unordered-list-inconsistent-behavior.md │ │ │ │ ├── #312.spaced-dashes-followed-by-char.html │ │ │ │ ├── #312.spaced-dashes-followed-by-char.md │ │ │ │ ├── #312.spaced-dashes-followed-by-char2.html │ │ │ │ ├── #312.spaced-dashes-followed-by-char2.md │ │ │ │ ├── #312.spaced-dashes-followed-by-char3.html │ │ │ │ ├── #312.spaced-dashes-followed-by-char3.md │ │ │ │ ├── #312.spaced-dashes-followed-by-char4.html │ │ │ │ ├── #312.spaced-dashes-followed-by-char4.md │ │ │ │ ├── #317.spaces-before-hr.html │ │ │ │ ├── #317.spaces-before-hr.md │ │ │ │ ├── #332.inconsistent-behavior-of-emphasis-and-strong.html │ │ │ │ ├── #332.inconsistent-behavior-of-emphasis-and-strong.md │ │ │ │ ├── #345.no-escape-for-the-pipe-character.html │ │ │ │ ├── #345.no-escape-for-the-pipe-character.md │ │ │ │ ├── #390.brackets-in-URL-break-images.html │ │ │ │ ├── #390.brackets-in-URL-break-images.md │ │ │ │ ├── #390.brackets-in-URL-break-links.html │ │ │ │ ├── #390.brackets-in-URL-break-links.md │ │ │ │ ├── #393.showdown-hangs-with-malformed-html.html │ │ │ │ ├── #393.showdown-hangs-with-malformed-html.md │ │ │ │ ├── #397.unordered-list-strange-behavior.html │ │ │ │ ├── #397.unordered-list-strange-behavior.md │ │ │ │ ├── #429.multiline-base64-image-support.html │ │ │ │ ├── #429.multiline-base64-image-support.md │ │ │ │ ├── #467.header-ids-for-subheadings.html │ │ │ │ ├── #467.header-ids-for-subheadings.md │ │ │ │ ├── #494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.html │ │ │ │ ├── #494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.md │ │ │ │ ├── #494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.html │ │ │ │ ├── #494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.md │ │ │ │ ├── #495.headings-different-behavior-in-paragraphs-and-lists.html │ │ │ │ ├── #495.headings-different-behavior-in-paragraphs-and-lists.md │ │ │ │ ├── #510.specific-string-gets-removed-from-text.html │ │ │ │ ├── #510.specific-string-gets-removed-from-text.md │ │ │ │ ├── #523.leading-space-breaks-gfm-code-blocks.html │ │ │ │ ├── #523.leading-space-breaks-gfm-code-blocks.md │ │ │ │ ├── #585.error-when-using-image-references.html │ │ │ │ ├── #585.error-when-using-image-references.md │ │ │ │ ├── #697.space-between-inline-elements.html │ │ │ │ ├── #697.space-between-inline-elements.md │ │ │ │ ├── #83.parsed-text-links-with-underscores.html │ │ │ │ ├── #83.parsed-text-links-with-underscores.md │ │ │ │ ├── #856.gfm-codeblock-with-language-with-spaces.html │ │ │ │ ├── #856.gfm-codeblock-with-language-with-spaces.md │ │ │ │ ├── #96.underscores-in-links.html │ │ │ │ ├── #96.underscores-in-links.md │ │ │ │ ├── URLs-with-multiple-parenthesis.html │ │ │ │ ├── URLs-with-multiple-parenthesis.md │ │ │ │ ├── crazy-urls.html │ │ │ │ ├── crazy-urls.md │ │ │ │ ├── deeply-nested-HTML-blocks.html │ │ │ │ ├── deeply-nested-HTML-blocks.md │ │ │ │ ├── handle-html-pre.html │ │ │ │ ├── handle-html-pre.md │ │ │ │ ├── one-line-HTML-input.html │ │ │ │ ├── one-line-HTML-input.md │ │ │ │ ├── reference-link-impostors.html │ │ │ │ └── reference-link-impostors.md │ │ │ ├── karlcow/ │ │ │ │ ├── 2-paragraphs-hard-return-spaces.html │ │ │ │ ├── 2-paragraphs-hard-return-spaces.md │ │ │ │ ├── 2-paragraphs-hard-return.html │ │ │ │ ├── 2-paragraphs-hard-return.md │ │ │ │ ├── 2-paragraphs-line-returns.html │ │ │ │ ├── 2-paragraphs-line-returns.md │ │ │ │ ├── 2-paragraphs-line-spaces.html │ │ │ │ ├── 2-paragraphs-line-spaces.md │ │ │ │ ├── 2-paragraphs-line-tab.html │ │ │ │ ├── 2-paragraphs-line-tab.md │ │ │ │ ├── 2-paragraphs-line.html │ │ │ │ ├── 2-paragraphs-line.md │ │ │ │ ├── EOL-CR+LF.html │ │ │ │ ├── EOL-CR+LF.md │ │ │ │ ├── EOL-CR.html │ │ │ │ ├── EOL-CR.md │ │ │ │ ├── EOL-LF.html │ │ │ │ ├── EOL-LF.md │ │ │ │ ├── ampersand-text-flow.html │ │ │ │ ├── ampersand-text-flow.md │ │ │ │ ├── ampersand-uri.html │ │ │ │ ├── ampersand-uri.md │ │ │ │ ├── asterisk-near-text.html │ │ │ │ ├── asterisk-near-text.md │ │ │ │ ├── asterisk.html │ │ │ │ ├── asterisk.md │ │ │ │ ├── backslash-escape.html │ │ │ │ ├── backslash-escape.md │ │ │ │ ├── blockquote-added-markup.html │ │ │ │ ├── blockquote-added-markup.md │ │ │ │ ├── blockquote-line-2-paragraphs.html │ │ │ │ ├── blockquote-line-2-paragraphs.md │ │ │ │ ├── blockquote-line.html │ │ │ │ ├── blockquote-line.md │ │ │ │ ├── blockquote-multiline-1-space-begin.html │ │ │ │ ├── blockquote-multiline-1-space-begin.md │ │ │ │ ├── blockquote-multiline-1-space-end.html │ │ │ │ ├── blockquote-multiline-1-space-end.md │ │ │ │ ├── blockquote-multiline-2-paragraphs.html │ │ │ │ ├── blockquote-multiline-2-paragraphs.md │ │ │ │ ├── blockquote-multiline.html │ │ │ │ ├── blockquote-multiline.md │ │ │ │ ├── blockquote-nested-multiplereturn-level1.html │ │ │ │ ├── blockquote-nested-multiplereturn-level1.md │ │ │ │ ├── blockquote-nested-multiplereturn.html │ │ │ │ ├── blockquote-nested-multiplereturn.md │ │ │ │ ├── blockquote-nested-return-level1.html │ │ │ │ ├── blockquote-nested-return-level1.md │ │ │ │ ├── blockquote-nested.html │ │ │ │ ├── blockquote-nested.md │ │ │ │ ├── code-1-tab.html │ │ │ │ ├── code-1-tab.md │ │ │ │ ├── code-4-spaces-escaping.html │ │ │ │ ├── code-4-spaces-escaping.md │ │ │ │ ├── code-4-spaces.html │ │ │ │ ├── code-4-spaces.md │ │ │ │ ├── em-middle-word.html │ │ │ │ ├── em-middle-word.md │ │ │ │ ├── em-star.html │ │ │ │ ├── em-star.md │ │ │ │ ├── em-underscore.html │ │ │ │ ├── em-underscore.md │ │ │ │ ├── entities-text-flow.html │ │ │ │ ├── entities-text-flow.md │ │ │ │ ├── header-level1-equal-underlined.html │ │ │ │ ├── header-level1-equal-underlined.md │ │ │ │ ├── header-level1-hash-sign-closed.html │ │ │ │ ├── header-level1-hash-sign-closed.md │ │ │ │ ├── header-level1-hash-sign-trailing-1-space.html │ │ │ │ ├── header-level1-hash-sign-trailing-1-space.md │ │ │ │ ├── header-level1-hash-sign-trailing-2-spaces.html │ │ │ │ ├── header-level1-hash-sign-trailing-2-spaces.md │ │ │ │ ├── header-level1-hash-sign.html │ │ │ │ ├── header-level1-hash-sign.md │ │ │ │ ├── header-level2-dash-underlined.html │ │ │ │ ├── header-level2-dash-underlined.md │ │ │ │ ├── header-level2-hash-sign-closed.html │ │ │ │ ├── header-level2-hash-sign-closed.md │ │ │ │ ├── header-level2-hash-sign.html │ │ │ │ ├── header-level2-hash-sign.md │ │ │ │ ├── header-level3-hash-sign-closed.html │ │ │ │ ├── header-level3-hash-sign-closed.md │ │ │ │ ├── header-level3-hash-sign.html │ │ │ │ ├── header-level3-hash-sign.md │ │ │ │ ├── header-level4-hash-sign-closed.html │ │ │ │ ├── header-level4-hash-sign-closed.md │ │ │ │ ├── header-level4-hash-sign.html │ │ │ │ ├── header-level4-hash-sign.md │ │ │ │ ├── header-level5-hash-sign-closed.html │ │ │ │ ├── header-level5-hash-sign-closed.md │ │ │ │ ├── header-level5-hash-sign.html │ │ │ │ ├── header-level5-hash-sign.md │ │ │ │ ├── header-level6-hash-sign-closed.html │ │ │ │ ├── header-level6-hash-sign-closed.md │ │ │ │ ├── header-level6-hash-sign.html │ │ │ │ ├── header-level6-hash-sign.md │ │ │ │ ├── horizontal-rule-3-dashes-spaces.html │ │ │ │ ├── horizontal-rule-3-dashes-spaces.md │ │ │ │ ├── horizontal-rule-3-dashes.html │ │ │ │ ├── horizontal-rule-3-dashes.md │ │ │ │ ├── horizontal-rule-3-stars.html │ │ │ │ ├── horizontal-rule-3-stars.md │ │ │ │ ├── horizontal-rule-3-underscores.html │ │ │ │ ├── horizontal-rule-3-underscores.md │ │ │ │ ├── horizontal-rule-7-dashes.html │ │ │ │ ├── horizontal-rule-7-dashes.md │ │ │ │ ├── img-idref-title.html │ │ │ │ ├── img-idref-title.md │ │ │ │ ├── img-idref.html │ │ │ │ ├── img-idref.md │ │ │ │ ├── img-title.html │ │ │ │ ├── img-title.md │ │ │ │ ├── img.html │ │ │ │ ├── img.md │ │ │ │ ├── inline-code-escaping-entities.html │ │ │ │ ├── inline-code-escaping-entities.md │ │ │ │ ├── inline-code-with-visible-backtick.html │ │ │ │ ├── inline-code-with-visible-backtick.md │ │ │ │ ├── inline-code.html │ │ │ │ ├── inline-code.md │ │ │ │ ├── line-break-2-spaces.html │ │ │ │ ├── line-break-2-spaces.md │ │ │ │ ├── line-break-5-spaces.html │ │ │ │ ├── line-break-5-spaces.md │ │ │ │ ├── link-automatic.html │ │ │ │ ├── link-automatic.md │ │ │ │ ├── link-bracket-paranthesis-title.html │ │ │ │ ├── link-bracket-paranthesis-title.md │ │ │ │ ├── link-bracket-paranthesis.html │ │ │ │ ├── link-bracket-paranthesis.md │ │ │ │ ├── link-idref-angle-bracket.html │ │ │ │ ├── link-idref-angle-bracket.md │ │ │ │ ├── link-idref-implicit-spaces.html │ │ │ │ ├── link-idref-implicit-spaces.md │ │ │ │ ├── link-idref-implicit.html │ │ │ │ ├── link-idref-implicit.md │ │ │ │ ├── link-idref-space.html │ │ │ │ ├── link-idref-space.md │ │ │ │ ├── link-idref-title-next-line.html │ │ │ │ ├── link-idref-title-next-line.md │ │ │ │ ├── link-idref-title-paranthesis.html │ │ │ │ ├── link-idref-title-paranthesis.md │ │ │ │ ├── link-idref-title-single-quote.html │ │ │ │ ├── link-idref-title-single-quote.md │ │ │ │ ├── link-idref-title.html │ │ │ │ ├── link-idref-title.md │ │ │ │ ├── link-idref.html │ │ │ │ ├── link-idref.md │ │ │ │ ├── list-blockquote.html │ │ │ │ ├── list-blockquote.md │ │ │ │ ├── list-code.html │ │ │ │ ├── list-code.md │ │ │ │ ├── list-multiparagraphs-tab.html │ │ │ │ ├── list-multiparagraphs-tab.md │ │ │ │ ├── list-multiparagraphs.html │ │ │ │ ├── list-multiparagraphs.md │ │ │ │ ├── ordered-list-escaped.html │ │ │ │ ├── ordered-list-escaped.md │ │ │ │ ├── ordered-list-inner-par-list.html │ │ │ │ ├── ordered-list-inner-par-list.md │ │ │ │ ├── ordered-list-items-random-number.html │ │ │ │ ├── ordered-list-items-random-number.md │ │ │ │ ├── ordered-list-items.html │ │ │ │ ├── ordered-list-items.md │ │ │ │ ├── paragraph-hard-return.html │ │ │ │ ├── paragraph-hard-return.md │ │ │ │ ├── paragraph-line.html │ │ │ │ ├── paragraph-line.md │ │ │ │ ├── paragraph-trailing-leading-spaces.html │ │ │ │ ├── paragraph-trailing-leading-spaces.md │ │ │ │ ├── paragraph-trailing-tab.html │ │ │ │ ├── paragraph-trailing-tab.md │ │ │ │ ├── paragraphs-2-leading-spaces.html │ │ │ │ ├── paragraphs-2-leading-spaces.md │ │ │ │ ├── paragraphs-3-leading-spaces.html │ │ │ │ ├── paragraphs-3-leading-spaces.md │ │ │ │ ├── paragraphs-leading-space.html │ │ │ │ ├── paragraphs-leading-space.md │ │ │ │ ├── paragraphs-trailing-spaces.html │ │ │ │ ├── paragraphs-trailing-spaces.md │ │ │ │ ├── strong-middle-word.html │ │ │ │ ├── strong-middle-word.md │ │ │ │ ├── strong-star.html │ │ │ │ ├── strong-star.md │ │ │ │ ├── strong-underscore.html │ │ │ │ ├── strong-underscore.md │ │ │ │ ├── unordered-list-items-asterisk.html │ │ │ │ ├── unordered-list-items-asterisk.md │ │ │ │ ├── unordered-list-items-dashsign.html │ │ │ │ ├── unordered-list-items-dashsign.md │ │ │ │ ├── unordered-list-items-leading-1space.html │ │ │ │ ├── unordered-list-items-leading-1space.md │ │ │ │ ├── unordered-list-items-leading-2spaces.html │ │ │ │ ├── unordered-list-items-leading-2spaces.md │ │ │ │ ├── unordered-list-items-leading-3spaces.html │ │ │ │ ├── unordered-list-items-leading-3spaces.md │ │ │ │ ├── unordered-list-items-plussign.html │ │ │ │ ├── unordered-list-items-plussign.md │ │ │ │ ├── unordered-list-paragraphs.html │ │ │ │ ├── unordered-list-paragraphs.md │ │ │ │ ├── unordered-list-unindented-content.html │ │ │ │ ├── unordered-list-unindented-content.md │ │ │ │ ├── unordered-list-with-indented-content.html │ │ │ │ └── unordered-list-with-indented-content.md │ │ │ └── standard/ │ │ │ ├── anchors-allow-fragments.html │ │ │ ├── anchors-allow-fragments.md │ │ │ ├── anchors-allow-javacript-identifiers.html │ │ │ ├── anchors-allow-javacript-identifiers.md │ │ │ ├── anchors-allow-no-protocols.html │ │ │ ├── anchors-allow-no-protocols.md │ │ │ ├── anchors-allow-object-property-names.html │ │ │ ├── anchors-allow-object-property-names.md │ │ │ ├── anchors-by-reference.html │ │ │ ├── anchors-by-reference.md │ │ │ ├── anchors-followed-by-brakets.html │ │ │ ├── anchors-followed-by-brakets.md │ │ │ ├── automatic-anchors.html │ │ │ ├── automatic-anchors.md │ │ │ ├── blockquote-followed-by-code.html │ │ │ ├── blockquote-followed-by-code.md │ │ │ ├── blockquote-inside-code.html │ │ │ ├── blockquote-inside-code.md │ │ │ ├── blockquote-nested-markdown.html │ │ │ ├── blockquote-nested-markdown.md │ │ │ ├── blockquote.html │ │ │ ├── blockquote.md │ │ │ ├── code-block-html-escape.html │ │ │ ├── code-block-html-escape.md │ │ │ ├── code-block-with-special-chars.html │ │ │ ├── code-block-with-special-chars.md │ │ │ ├── code-block.html │ │ │ ├── code-block.md │ │ │ ├── double-emphasis.html │ │ │ ├── double-emphasis.md │ │ │ ├── doubline-list.html │ │ │ ├── doubline-list.md │ │ │ ├── ellipsis.html │ │ │ ├── ellipsis.md │ │ │ ├── emphasis-inside-inline-code.html │ │ │ ├── emphasis-inside-inline-code.md │ │ │ ├── emphasis.html │ │ │ ├── emphasis.md │ │ │ ├── encodeHTMLCodeTags.html │ │ │ ├── encodeHTMLCodeTags.md │ │ │ ├── escaped-number-period.html │ │ │ ├── escaped-number-period.md │ │ │ ├── escaping.html │ │ │ ├── escaping.md │ │ │ ├── github-style-at-start.html │ │ │ ├── github-style-at-start.md │ │ │ ├── github-style-codeblock-inside-quote.html │ │ │ ├── github-style-codeblock-inside-quote.md │ │ │ ├── github-style-codeblock.html │ │ │ ├── github-style-codeblock.md │ │ │ ├── github-style-linebreaks.html │ │ │ ├── github-style-linebreaks.md │ │ │ ├── h1-with-double-hash.html │ │ │ ├── h1-with-double-hash.md │ │ │ ├── h1-with-equals.html │ │ │ ├── h1-with-equals.md │ │ │ ├── h1-with-single-hash.html │ │ │ ├── h1-with-single-hash.md │ │ │ ├── h2-with-dashes.html │ │ │ ├── h2-with-dashes.md │ │ │ ├── h2-with-double-hash.html │ │ │ ├── h2-with-double-hash.md │ │ │ ├── h2-with-single-hash.html │ │ │ ├── h2-with-single-hash.md │ │ │ ├── h3-with-double-hash.html │ │ │ ├── h3-with-double-hash.md │ │ │ ├── h3-with-single-hash.html │ │ │ ├── h3-with-single-hash.md │ │ │ ├── h4-with-single-hash.html │ │ │ ├── h4-with-single-hash.md │ │ │ ├── h5-with-single-hash.html │ │ │ ├── h5-with-single-hash.md │ │ │ ├── h6-with-single-hash.html │ │ │ ├── h6-with-single-hash.md │ │ │ ├── horizontal-rules.html │ │ │ ├── horizontal-rules.md │ │ │ ├── html-comments.html │ │ │ ├── html-comments.md │ │ │ ├── html-inside-listed-code.html │ │ │ ├── html-inside-listed-code.md │ │ │ ├── html5-strutural-tags.html │ │ │ ├── html5-strutural-tags.md │ │ │ ├── images-followed-by-brackets.html │ │ │ ├── images-followed-by-brackets.md │ │ │ ├── images.html │ │ │ ├── images.md │ │ │ ├── implicit-anchors.html │ │ │ ├── implicit-anchors.md │ │ │ ├── inline-anchors.html │ │ │ ├── inline-anchors.md │ │ │ ├── inline-code.html │ │ │ ├── inline-code.md │ │ │ ├── inline-escaped-chars.html │ │ │ ├── inline-escaped-chars.md │ │ │ ├── inline-style-tag.html │ │ │ ├── inline-style-tag.md │ │ │ ├── lazy-blockquote.html │ │ │ ├── lazy-blockquote.md │ │ │ ├── line-starts-with-html.html │ │ │ ├── line-starts-with-html.md │ │ │ ├── list-followed-by-blockquote.html │ │ │ ├── list-followed-by-blockquote.md │ │ │ ├── list-followed-by-ghcode.html │ │ │ ├── list-followed-by-ghcode.md │ │ │ ├── list-with-blockquote.html │ │ │ ├── list-with-blockquote.md │ │ │ ├── list-with-code.html │ │ │ ├── list-with-code.md │ │ │ ├── literal-html-tags.html │ │ │ ├── literal-html-tags.md │ │ │ ├── multi-paragraph-list.html │ │ │ ├── multi-paragraph-list.md │ │ │ ├── multiline-unordered-list.html │ │ │ ├── multiline-unordered-list.md │ │ │ ├── nested-blockquote.html │ │ │ ├── nested-blockquote.md │ │ │ ├── nested-gh-codeblocks.html │ │ │ ├── nested-gh-codeblocks.md │ │ │ ├── obfuscated-emails.html │ │ │ ├── obfuscated-emails.md │ │ │ ├── ordered-list-same-number.html │ │ │ ├── ordered-list-same-number.md │ │ │ ├── ordered-list-starting-number.html │ │ │ ├── ordered-list-starting-number.md │ │ │ ├── ordered-list-wrong-numbers.html │ │ │ ├── ordered-list-wrong-numbers.md │ │ │ ├── ordered-list.html │ │ │ ├── ordered-list.md │ │ │ ├── paragraphed-list-with-sublists.html │ │ │ ├── paragraphed-list-with-sublists.md │ │ │ ├── pre-code-tags-inside-code-block.html │ │ │ ├── pre-code-tags-inside-code-block.md │ │ │ ├── pre-code-tags.html │ │ │ ├── pre-code-tags.md │ │ │ ├── relative-anchors.html │ │ │ ├── relative-anchors.md │ │ │ ├── repeated-headers.html │ │ │ ├── repeated-headers.md │ │ │ ├── simple-paragraph.html │ │ │ ├── simple-paragraph.md │ │ │ ├── strip-references.html │ │ │ ├── strip-references.md │ │ │ ├── strong.html │ │ │ ├── strong.md │ │ │ ├── unordered-list-asterisk.html │ │ │ ├── unordered-list-asterisk.md │ │ │ ├── unordered-list-minus.html │ │ │ ├── unordered-list-minus.md │ │ │ ├── unordered-list-plus.html │ │ │ ├── unordered-list-plus.md │ │ │ ├── url-with-parenthesis.html │ │ │ └── url-with-parenthesis.md │ │ ├── makehtml.bootstrap.js │ │ ├── testsuite.commonmark.js │ │ ├── testsuite.features.js │ │ ├── testsuite.ghost.js │ │ ├── testsuite.issues.js │ │ ├── testsuite.karlcow.js │ │ └── testsuite.standard.js │ └── makemarkdown/ │ ├── cases/ │ │ ├── features/ │ │ │ ├── ghMentions/ │ │ │ │ ├── github.html │ │ │ │ └── github.md │ │ │ └── issues/ │ │ │ ├── tasklists.html │ │ │ └── tasklists.md │ │ └── standard/ │ │ ├── anchors-relative.html │ │ ├── anchors-relative.md │ │ ├── anchors.html │ │ ├── anchors.md │ │ ├── blockquote-followed-by-code.html │ │ ├── blockquote-followed-by-code.md │ │ ├── blockquote-nested-markdown.html │ │ ├── blockquote-nested-markdown.md │ │ ├── blockquote.html │ │ ├── blockquote.md │ │ ├── breaks.html │ │ ├── breaks.md │ │ ├── emphasis-double.html │ │ ├── emphasis-double.md │ │ ├── emphasis-inside-inline-code.html │ │ ├── emphasis-inside-inline-code.md │ │ ├── emphasis.html │ │ ├── emphasis.md │ │ ├── escaping-html-entities.html │ │ ├── escaping-html-entities.md │ │ ├── escaping.html │ │ ├── escaping.md │ │ ├── github-style-at-start.html │ │ ├── github-style-at-start.md │ │ ├── github-style-codeblock-inside-quote.html │ │ ├── github-style-codeblock-inside-quote.md │ │ ├── github-style-codeblock.html │ │ ├── github-style-codeblock.md │ │ ├── github-style-linebreaks.html │ │ ├── github-style-linebreaks.md │ │ ├── h1-with-single-hash.html │ │ ├── h1-with-single-hash.md │ │ ├── h2-with-single-hash.html │ │ ├── h2-with-single-hash.md │ │ ├── h3-with-single-hash.html │ │ ├── h3-with-single-hash.md │ │ ├── h4-with-single-hash.html │ │ ├── h4-with-single-hash.md │ │ ├── h5-with-single-hash.html │ │ ├── h5-with-single-hash.md │ │ ├── h6-with-single-hash.html │ │ ├── h6-with-single-hash.md │ │ ├── horizontal-rules.html │ │ ├── horizontal-rules.md │ │ ├── html-comments.html │ │ ├── html-comments.md │ │ ├── html.html │ │ ├── html.md │ │ ├── html5-strutural-tags.html │ │ ├── html5-strutural-tags.md │ │ ├── images-followed-by-brackets.html │ │ ├── images-followed-by-brackets.md │ │ ├── images.html │ │ ├── images.md │ │ ├── list-doubleline.html │ │ ├── list-doubleline.md │ │ ├── list-followed-by-blockquote.html │ │ ├── list-followed-by-blockquote.md │ │ ├── list-followed-by-ghcode.html │ │ ├── list-followed-by-ghcode.md │ │ ├── list-with-blockquote.html │ │ ├── list-with-blockquote.md │ │ ├── list-with-code.html │ │ ├── list-with-code.md │ │ ├── multi-paragraph-list.html │ │ ├── multi-paragraph-list.md │ │ ├── nested-gh-codeblocks.html │ │ ├── nested-gh-codeblocks.md │ │ ├── ordered-list-starting-number.html │ │ ├── ordered-list-starting-number.md │ │ ├── ordered-list.html │ │ ├── ordered-list.md │ │ ├── paragraph-simple.html │ │ ├── paragraph-simple.md │ │ ├── paragraphed-list-with-sublists.html │ │ ├── paragraphed-list-with-sublists.md │ │ ├── table-complex.html │ │ ├── table-complex.md │ │ ├── table-header-only.html │ │ ├── table-header-only.md │ │ ├── table-mix-malformed.html │ │ ├── table-mix-malformed.md │ │ ├── table-no-header.html │ │ ├── table-no-header.md │ │ ├── table-simple.html │ │ └── table-simple.md │ ├── makemarkdown.bootstrap.js │ ├── testsuite.features.js │ └── testsuite.standard.js ├── mocks/ │ └── mock-extension.js ├── optionswp.js ├── performance/ │ ├── lib/ │ │ └── performance.lib.js │ └── performance.js ├── performance.testfile.md └── unit/ ├── cli.js ├── showdown.Converter.js ├── showdown.Converter.makeHtml.js ├── showdown.Converter.makeMarkdown.js ├── showdown.helpers.js └── showdown.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ [*.js] indent_style = space indent_size = 2 continuation_indent_size = 2 insert_final_newline = true quote_type = single space_after_anonymous_functions = true space_after_control_statements = true spaces_around_operators = true trim_trailing_whitespace = true spaces_in_brackets = false curly_bracket_next_line = true indent_brace_style = 1TBS end_of_line = lf charset = utf-8 ================================================ FILE: .eslintrc.json ================================================ { "env": { "es6": true }, "rules": { "indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 2}], "curly": [2, "all"], "operator-linebreak": [2, "after"], "camelcase": [2, {"properties": "never"}], "quotes": [2, "single"], "no-multi-str": 2, "no-mixed-spaces-and-tabs": 2, "no-trailing-spaces": 2, "space-unary-ops": [2, { "nonwords": false, "overrides": {} } ], "brace-style": [2, "1tbs", {"allowSingleLine": true}], "keyword-spacing": [2, {}], "space-infix-ops": 2, "space-before-blocks": [2, "always"], "eol-last": 2, "space-before-function-paren": [2, "always"], "array-bracket-spacing": [2, "never", {"singleValue": false}], "space-in-parens": [2, "never"], "no-multiple-empty-lines": 2 } } ================================================ FILE: .gitattributes ================================================ # Exports for git archive /test export-ignore .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore .eslintrc.json export-ignore .jshintignore export-ignore .jshintrc export-ignore .travis.yml export-ignore .appveyor.yml export-ignore bower.json Gruntfile.js export-ignore performance.* export-ignore # Line endings control CHANGELOG.md text CONTRIBUTING.md text CREDITS.md text license.txt text # Force LF on js files *.js text eol=lf # Force binary mode on bin dir and dist fir bin/* binary dist/* binary ================================================ FILE: .github/workflows/browserstack.yml ================================================ name: 'BrowserStack Test' on: push: branches: [ master, develop ] pull_request: branches: [ master, develop ] jobs: ubuntu-job: name: 'BrowserStack Test on Ubuntu' runs-on: ubuntu-latest steps: - name: set up env vars # Only the first line of commit msg run: echo "COMMIT_MSG=$(printf "%s" "${{ github.event.head_commit.message }}" | head -n 1)" >> $GITHUB_ENV - name: '📦 Checkout the repository' uses: actions/checkout@v2 - name: '🚚 Upgrade NPM' run: npm install -g npm - name: '⚙ Setup Node.js v17.x' uses: actions/setup-node@v2 with: node-version: 17.x cache: 'npm' - name: '📖 Get current package version' id: package-version uses: martinbeentjes/npm-get-version-action@v1.2.3 - name: '📝 Print build version and commit msg' run: 'printf "version: %s\n build:%s\n message:%s\n" "${{ steps.package-version.outputs.current-version}}" "${{ github.run_id }}" "$COMMIT_MSG"' - name: '📱 BrowserStack Env Setup' # Invokes the setup-env action uses: browserstack/github-actions/setup-env@master with: username: ${{ secrets.BROWSERSTACK_USERNAME }} access-key: ${{ secrets.BROWSERSTACK_ACCESSKEY }} project-name: 'showdown' build-name: ${{ steps.package-version.outputs.current-version}}-${{ github.run_id }} - name: '🚇 BrowserStack Local Tunnel Setup' # Invokes the setup-local action uses: browserstack/github-actions/setup-local@master with: local-testing: start local-identifier: random - name: '🚚 Install dependencies for CI' run: npm ci - name: '🏗 Building src files for testing' run: npx grunt concat:test - name: '✅ Running test on BrowserStack with Karma' run: npx karma start karma.browserstack.js - name: '🛑 BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection uses: browserstack/github-actions/setup-local@master with: local-testing: stop ================================================ FILE: .github/workflows/codeql-analysis.yml ================================================ # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # # You may wish to alter this file to override the set of languages analyzed, # or to provide custom queries or build logic. # # ******** NOTE ******** # We have attempted to detect the languages in your repository. Please check # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # name: "CodeQL" on: push: branches: [ master, develop ] pull_request: # The branches below must be a subset of the branches above branches: [ master, develop ] schedule: - cron: '39 3 * * 0' jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'javascript' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - name: Checkout repository uses: actions/checkout@v2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v1 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project # uses a compiled language #- run: | # make bootstrap # make release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 ================================================ FILE: .github/workflows/docs.yml ================================================ name: documentation on: push: branches: - master paths: - 'mkdocs.yml' - 'docs/**' - '.github/workflows/docs.yml' jobs: build_docs: name: Build documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Trigger external build env: TOKEN: ${{ secrets.DOCS_DEPLOY_KEY }} COMMIT: ${{ github.event.head_commit.id }} COMMITTER: ${{ github.event.head_commit.author.username }} OWNER: showdownjs REPO: showdownjs.github.io run: | curl -X POST \ -H "Authorization: token ${TOKEN}" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/${OWNER}/${REPO}/dispatches \ -d '{ "event_type": "e: \"'"${COMMIT}"'\" by '"${COMMITTER}"'", "client_payload": { "source": "showdown" } }' ================================================ FILE: .github/workflows/node.linux.yml ================================================ # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node Linux CI on: push: branches: [ master, develop ] pull_request: branches: [ master, develop ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [12.x, 14.x, 16.x, 17.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v2 - name: 🚚 Upgrade NPM run: npm install -g npm - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm ci - run: npm test ================================================ FILE: .github/workflows/node.win.yml ================================================ # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node Windows CI on: push: branches: [ master, develop ] pull_request: branches: [ master, develop ] jobs: build: runs-on: windows-latest strategy: matrix: node-version: [12.x, 14.x, 16.x, 17.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm ci - run: npm test ================================================ FILE: .gitignore ================================================ .idea/ .build/ .DS_Store node_modules npm-debug.log /*.test.* *.log ================================================ FILE: .jshintignore ================================================ Gruntfile.js dist/**/*.js build/**/*.js src/options.js bin/* /karma.browserstack.js ================================================ FILE: .jshintrc ================================================ { "node": true, "browser": true, "esnext": true, "bitwise": true, "camelcase": true, "curly": true, "eqeqeq": true, "immed": true, "indent": 2, "latedef": "nofunc", "newcap": true, "noarg": true, "quotmark": "single", "undef": false, "unused": true, "strict": false, "trailing": true, "smarttabs": true, "onevar": true, "globals": { "module": true, "define": true, "window": true, "document": true, "showdown": true } } ================================================ FILE: CHANGELOG.md ================================================ ## [2.1.0](https://github.com/showdownjs/showdown/compare/2.0.0...2.1.0) (2022-04-21) * refactor(cli)!: Remove support for "extra options" and add -c flag, closes [#916](https://github.com/showdownjs/showdown/issues/916) ### Bug Fixes * **cli:** cli displays the correct version number ([8b48882](https://github.com/showdownjs/showdown/commit/8b48882)) ### BREAKING CHANGES * the CLI no longer accepts "extra options". Instead you should pass the `-c` flag. To update: before: ``` showdown makehtml -i foo.md -o bar.html --strikethrough --emoji ``` after: ``` showdown makehtml -i foo.md -o bar.html -c strikethrough -c emoji ``` # [2.0.0](https://github.com/showdownjs/showdown/compare/1.9.1...2.0.0) (2022-02-15) ### Breaking Changes * Supported Node Versions were set to match the [node release schedule](https://nodejs.org/en/about/releases/) which at the time of writing includes Node 12.x, 14.x, 16.x and 17.x * The `yargs` dependecy was updated to `^17.2.1` to mitigate a security issue. * The Showdown Licesnse has been changed from BSD-3-Clause to MIT ### Bug Fixes * allow escaping of colons ([25c4420](https://github.com/showdownjs/showdown/commit/25c4420)) * reduce npm package size ([35730b7](https://github.com/showdownjs/showdown/commit/35730b7)), closes [#619](https://github.com/showdownjs/showdown/issues/619) ### Features * Added `ellipsis` option to configure if the ellipsis unicode character is used or not. ( Thanks @VladimirV99 ) * Added a default security policy. Please report security issues to the issues tab on GitHub. ## [1.9.1](https://github.com/showdownjs/showdown/compare/1.9.0...1.9.1) (2019-11-02) ### Bug Fixes * **openLinksInNewWindow:** add rel="noopener noreferrer" to links ([1cd281f](https://github.com/showdownjs/showdown/commit/1cd281f)), closes [#670](https://github.com/showdownjs/showdown/issues/670) # [1.9.0](https://github.com/showdownjs/showdown/compare/1.8.7...1.9.0) (2018-11-10) Version 1.9.0 introduces a new feature, the Markdown to HTML converter. This feature is still experimental and is a partial backport of the new Reverse Converter planned for version 2.0. ### Bug Fixes * **italicsAndBold:** fix issue with consecutive spans ([#608](https://github.com/showdownjs/showdown/issues/608)) ([5c0d67e](https://github.com/showdownjs/showdown/commit/5c0d67e)), closes [#544](https://github.com/showdownjs/showdown/issues/544) * **underline:** fix issue with consecutive spans ([81edc70](https://github.com/showdownjs/showdown/commit/81edc70)) ### Features * **converter.makeMarkdown:** [EXPERIMENTAL] add an HTML to MD converter ([e4b0e69](https://github.com/showdownjs/showdown/commit/e4b0e69)), closes [#388](https://github.com/showdownjs/showdown/issues/388) [#233](https://github.com/showdownjs/showdown/issues/233) # [1.8.7](https://github.com/showdownjs/showdown/compare/1.8.6...1.8.7) (2018-10-16) ### Bug Fixes * **emojis:** fix emoji excessive size ([4aca41c](https://github.com/showdownjs/showdown/commit/4aca41c)) * **gfm-codeblocks:** add support for spaces before language declaration ([24bf7b1](https://github.com/showdownjs/showdown/commit/24bf7b1)), closes [#569](https://github.com/showdownjs/showdown/issues/569) leading space no longer breaks gfm codeblocks ([828c32f](https://github.com/showdownjs/showdown/commit/828c32f)), closes [#523](https://github.com/showdownjs/showdown/issues/523) * **images:** fix js error when using image references ([980e702](https://github.com/showdownjs/showdown/commit/980e702)), closes [#585](https://github.com/showdownjs/showdown/issues/585) * **literalMidWordAsterisks:** now parses single characters enclosed by * correctly ([fe70e45](https://github.com/showdownjs/showdown/commit/fe70e45)), closes [#478](https://github.com/showdownjs/showdown/issues/478) * **mentions:** allow for usernames with dot, underscore and dash ([dfeb1e2](https://github.com/showdownjs/showdown/commit/dfeb1e2)), closes [#574](https://github.com/showdownjs/showdown/issues/574) * **nbsp:** fix replacing of nbsp with regular spaces ([8bc1f42](https://github.com/showdownjs/showdown/commit/8bc1f42)) # [1.8.6](https://github.com/showdownjs/showdown/compare/1.8.5...1.8.6) (2017-12-22) ### Features * **splitAdjacentBlockquotes:** add option to split adjacent blockquote blocks ([da328f2](https://github.com/showdownjs/showdown/commit/da328f2)), closes [#477](https://github.com/showdownjs/showdown/issues/477) # [1.8.5](https://github.com/showdownjs/showdown/compare/1.8.4...1.8.5) (2017-12-10) ### Features * **completeHTMLDocument:** add option to output a complete HTML document ([a8427c9](https://github.com/showdownjs/showdown/commit/a8427c9)) * **metadata:** add support for embedded metadata ([63d949f](https://github.com/showdownjs/showdown/commit/63d949f)), closes [#260](https://github.com/showdownjs/showdown/issues/260) ## [1.8.4](https://github.com/showdownjs/showdown/compare/1.8.3...1.8.4) (2017-12-05) ### Bug Fixes * **tables:** raw html inside code tags in tables no longer breaks tables ([4ef4c5e](https://github.com/showdownjs/showdown/commit/4ef4c5e)), closes [#471](https://github.com/showdownjs/showdown/issues/471) ## [1.8.3](https://github.com/showdownjs/showdown/compare/1.8.2...1.8.3) (2017-11-28) ### Bug Fixes * **literalMidWordAsterisks:** no longer treats colon as alphanumeric char ([21194c8](https://github.com/showdownjs/showdown/commit/21194c8)), closes [#461](https://github.com/showdownjs/showdown/issues/461) * **spanGamut:** code spans are hashed after parsing ([f4f63c5](https://github.com/showdownjs/showdown/commit/f4f63c5)), closes [#464](https://github.com/showdownjs/showdown/issues/464) * **tables:** pipe character in code spans no longer breaks table ([0c933a0](https://github.com/showdownjs/showdown/commit/0c933a0)), closes [#465](https://github.com/showdownjs/showdown/issues/465) ## [1.8.2](https://github.com/showdownjs/showdown/compare/1.8.1...1.8.2) (2017-11-11) ### Bug Fixes * **fenced codeblocks:** add tilde as fenced code block delimiter ([c956ede](https://github.com/showdownjs/showdown/commit/c956ede)), closes [#456](https://github.com/showdownjs/showdown/issues/456) * **openLinksInNewWindow:** hash links are not affected by the option ([11936ec](https://github.com/showdownjs/showdown/commit/11936ec)), closes [#457](https://github.com/showdownjs/showdown/issues/457) ## [1.8.1](https://github.com/showdownjs/showdown/compare/1.8.0...1.8.1) (2017-11-01) ### Dependencies update * **package:** update yargs to version 10.0.3 ([#447](https://github.com/showdownjs/showdown/issues/447)) ([906b26d](https://github.com/showdownjs/showdown/commit/906b26d)) ### Bug Fixes * **CDNjs:** bump version to fix version mismatch with CDNjs ([#452](https://github.com/showdownjs/showdown/issues/452)) # [1.8.0](https://github.com/showdownjs/showdown/compare/1.7.6...1.8.0) (2017-10-24) ### NOTICE Don't use the CDNjs version of this release. See issue [#452](https://github.com/showdownjs/showdown/issues/452) for more details. ### Bug Fixes * **autolinks:** prevent _ and * to be parsed in links ([61929bb](https://github.com/showdownjs/showdown/commit/61929bb)), closes [#444](https://github.com/showdownjs/showdown/issues/444) ### Features * **ellipsis:** add auto-ellipsis support ([25f1978](https://github.com/showdownjs/showdown/commit/25f1978)) - *Example:* input ```md this is an ellipsis... ``` output ```html
this is an ellipsis…
``` * **emoji:** add emoji support through option `emoji`([5b8f1d3](https://github.com/showdownjs/showdown/commit/5b8f1d3)), closes [#448](https://github.com/showdownjs/showdown/issues/448) - *Usage:* ```js var conv = new showdown.Converter({emoji: true}); ``` - *Example:* input ```md this is a smile :smile: emoji ``` output ```htmlthis is a smile 😄 emoji
``` * **start ordered lists at an arbitrary number:** add support for defining the first item number of ordered lists ([9cdc35e](https://github.com/showdownjs/showdown/commit/9cdc35e)), closes [#377](https://github.com/showdownjs/showdown/issues/377) - *Example:* input ```md 3. foo 4. bar 5. baz ``` output ```htmlthis is underlined and this is also underlined
``` - *Note:* With this option enabled, underscore no longer parses as `` or `` ### BREAKING CHANGES * start ordered lists at an arbitrary number: Since showdown now supports starting ordered lists at an arbitrary number, list output may differ. ## [1.7.6](https://github.com/showdownjs/showdown/compare/1.7.5...1.7.6) (2017-10-06) ### Bug Fixes * **tables:** tables are properly rendered when followed by a single linebreak and a list ([d88b095](https://github.com/showdownjs/showdown/commit/d88b095)), closes [#443](https://github.com/showdownjs/showdown/issues/443) * **tables:** trailing spaces no longer prevent table parsing ([66bdd21](https://github.com/showdownjs/showdown/commit/66bdd21)), closes [#442](https://github.com/showdownjs/showdown/issues/442) ## [1.7.5](https://github.com/showdownjs/showdown/compare/1.7.4...1.7.5) (2017-10-02) ### Bug Fixes * **html-comments:** changed regex to prevent malformed long comment to freeze showdown ([3efcd10](https://github.com/showdownjs/showdown/commit/3efcd10)), closes [#439](https://github.com/showdownjs/showdown/issues/439) ## [1.7.4](https://github.com/showdownjs/showdown/compare/1.7.3...1.7.4) (2017-09-08) ### Bug Fixes * **helper.isArray:** replace a.constructor === Array with Array.isArray ([466a2eb](https://github.com/showdownjs/showdown/commit/466a2eb)), closes [#425](https://github.com/showdownjs/showdown/issues/425) * **loader:** allow AMD loader to be used within Node env ([ff24bdb](https://github.com/showdownjs/showdown/commit/ff24bdb)) ### Features * **base64-wrapping:** support for wrapping base64 strings ([8c593a4](https://github.com/showdownjs/showdown/commit/8c593a4)), closes [#429](https://github.com/showdownjs/showdown/issues/429) ## [1.7.3](https://github.com/showdownjs/showdown/compare/1.7.2...1.7.3) (2017-08-23) ### Bug Fixes * **github flavor:** add backslashEscapesHTMLTags to GFM flavor ([5284439](https://github.com/showdownjs/showdown/commit/5284439)) * **literalMidWordAsterisks:** option no longer treats punctuation as word character ([8f05be7](https://github.com/showdownjs/showdown/commit/8f05be7)), closes [#398](https://github.com/showdownjs/showdown/issues/398) * **tables:** allow for one column table ([fef110c](https://github.com/showdownjs/showdown/commit/fef110cccb2d02b218183398d9baa0ae256a7283)), closes [#406](https://github.com/showdownjs/showdown/issues/406) ### Features * **rawHeaderId:** Remove only spaces, ' and " from generated header ids ([1791cf0](https://github.com/showdownjs/showdown/commit/1791cf0)), closes [#409](https://github.com/showdownjs/showdown/issues/409) * **rawPrefixHeaderId:** add option to prevent showdown from modifying the prefix ([ff26c08](https://github.com/showdownjs/showdown/commit/ff26c08)), closes [#409](https://github.com/showdownjs/showdown/issues/409) ## [1.7.2](https://github.com/showdownjs/showdown/compare/1.7.1...1.7.2) (2017-08-05) ### Bug Fixes * **githubMentions:** githubMentions now works with openLinksInNewWindow options ([1194d88](https://github.com/showdownjs/showdown/commit/1194d88)), closes [#403](https://github.com/showdownjs/showdown/issues/403) * **lists:** fix multi paragraph lists with sublists ([a2259c0](https://github.com/showdownjs/showdown/commit/a2259c0)), closes [#397](https://github.com/showdownjs/showdown/issues/397) * **tablesHeaderId:** fix mismatch of option name ([51e4693](https://github.com/showdownjs/showdown/commit/51e4693)), closes [#412](https://github.com/showdownjs/showdown/issues/412) ### Features * **backslashEscapesHTMLTags:** backslash escapes HTML tags ([5a5aff6](https://github.com/showdownjs/showdown/commit/5a5aff6)), closes [#374](https://github.com/showdownjs/showdown/issues/374) ## [1.7.1](https://github.com/showdownjs/showdown/compare/1.7.0...1.7.1) (2017-06-02) Important HOTFIX ### Bug Fixes * **HTML Parser:** fix nasty bug where malformed HTML would hang showdown ([6566c72](https://github.com/showdownjs/showdown/commit/6566c72)), closes [#393](https://github.com/showdownjs/showdown/issues/393) ## [1.7.0](https://github.com/showdownjs/showdown/compare/1.6.4...1.7.0) (2017-06-01) (DEPRECATED) ### Bug Fixes * **anchors:** fix issue with brackets in link URL ([7ba18dd](https://github.com/showdownjs/showdown/commit/7ba18dd)), closes [#390](https://github.com/showdownjs/showdown/issues/390) * **excludeTrailingPunctuationFromURL:** add comma to punctuation list ([fa35fd5](https://github.com/showdownjs/showdown/commit/fa35fd5)), closes [#354](https://github.com/showdownjs/showdown/issues/354) * **excludeTrailingPunctuationFromURLs:** fix weird character when this option with simplifiedAutoLinks ([71acff5](https://github.com/showdownjs/showdown/commit/71acff5)), closes [#378](https://github.com/showdownjs/showdown/issues/378) * **HTML parsing:** fix HTML parsing issues with nested tags ([6fbc072](https://github.com/showdownjs/showdown/commit/6fbc072)), closes [#357](https://github.com/showdownjs/showdown/issues/357) [#387](https://github.com/showdownjs/showdown/issues/387) * **openLinksInNewWindow:** encode _ to prevent clash with em ([813f832](https://github.com/showdownjs/showdown/commit/813f832)), closes [#379](https://github.com/showdownjs/showdown/issues/379) * **package:** update yargs to version 7.0.1 ([#349](https://github.com/showdownjs/showdown/issues/349)) ([9308d7b](https://github.com/showdownjs/showdown/commit/9308d7b)) * **package:** update yargs to version 8.0.1 ([#385](https://github.com/showdownjs/showdown/issues/385)) ([5fd847b](https://github.com/showdownjs/showdown/commit/5fd847b)) * **simpleAutoLinks:** URLs with emphasis/strikethrough are parsed ([5c50675](https://github.com/showdownjs/showdown/commit/5c50675)), closes [#347](https://github.com/showdownjs/showdown/issues/347) * **tables:** pipe char can now be escaped ([1ebc195](https://github.com/showdownjs/showdown/commit/1ebc195)), closes [#345](https://github.com/showdownjs/showdown/issues/345) * **url parsing:** fix url edge case parsing in images and links ([30aa18c](https://github.com/showdownjs/showdown/commit/30aa18c)) ### Features * **customizeHeaderId:** add option for customizing header ids ([94c570a](https://github.com/showdownjs/showdown/commit/94c570a)), closes [#383](https://github.com/showdownjs/showdown/issues/383) * **images:** add support for image's implicit reference syntax ([0c6c07b](https://github.com/showdownjs/showdown/commit/0c6c07b)), closes [#366](https://github.com/showdownjs/showdown/issues/366) * **literalMidWordAsterisks:** add option for mid word asterisks ([5bec8f9](https://github.com/showdownjs/showdown/commit/5bec8f9)) * **openLinksInNewWindow:** add option to open all links in a new window ([50235d6](https://github.com/showdownjs/showdown/commit/50235d6)), closes [#362](https://github.com/showdownjs/showdown/issues/362) [#337](https://github.com/showdownjs/showdown/issues/337) [#249](https://github.com/showdownjs/showdown/issues/249) [#247](https://github.com/showdownjs/showdown/issues/247) [#222](https://github.com/showdownjs/showdown/issues/222) ## [1.6.4](https://github.com/showdownjs/showdown/compare/1.6.3...1.6.4) (2017-02-06) ### Bug Fixes * **encodeAmpsAndAngles:** fix > and < encoding ([7f43b79](https://github.com/showdownjs/showdown/commit/7f43b79)), closes [#236](https://github.com/showdownjs/showdown/issues/236) * **encodeEmail:** now produces valid emails ([605d8b7](https://github.com/showdownjs/showdown/commit/605d8b7)), closes [#340](https://github.com/showdownjs/showdown/issues/340) * **flavor: github:** new version of github does not use prefix 'user-content' in headers ([368f0b6](https://github.com/showdownjs/showdown/commit/368f0b6)) * **hashCodeTags:** escape code tags ([41cb3f6](https://github.com/showdownjs/showdown/commit/41cb3f6)), closes [#339](https://github.com/showdownjs/showdown/issues/339) * **italicsAndBold:** fix double emphasis edge case ([1832b7f](https://github.com/showdownjs/showdown/commit/1832b7f)) * **paragraph:** workaround QML bug ([f7a429e](https://github.com/showdownjs/showdown/commit/f7a429e)), closes [#246](https://github.com/showdownjs/showdown/issues/246) [#338](https://github.com/showdownjs/showdown/issues/338) * **prefixHeaderId:** make `prefixHeaderId` string be parsed along the generated id ([f641a7d](https://github.com/showdownjs/showdown/commit/f641a7d)) ### Features * **flavor: ghost:** add Ghost flavor ([6374b5b](https://github.com/showdownjs/showdown/commit/6374b5b)) * **flavor: original:** add John Gruber's markdown flavor ([6374b5b](https://github.com/showdownjs/showdown/commit/6374b5b)) ## [1.6.3](https://github.com/showdownjs/showdown/compare/1.6.2...1.6.3) (2017-01-30) ### Bug Fixes * **codeSpans:** add - and = to escaped chars inside code spans ([4243a31](https://github.com/showdownjs/showdown/commit/4243a31)) * **italicsAndBold:** fix inconsistency in italicsAndBold parsing ([a4f05d4](https://github.com/showdownjs/showdown/commit/a4f05d4)), closes [#332](https://github.com/showdownjs/showdown/issues/332) * **literalMidWordUnderscores:** fix inconsistent behavior of emphasis and strong with literalMidWordUndescores ([0292ae0](https://github.com/showdownjs/showdown/commit/0292ae0)), closes [#333](https://github.com/showdownjs/showdown/issues/333) * **paragraphs:** fix empty lines generating empty paragraphs ([54bf744](https://github.com/showdownjs/showdown/commit/54bf744)), closes [#334](https://github.com/showdownjs/showdown/issues/334) * **strikethrough:** fix strikethrough being wrongly parsed inside codeSpans ([169cbe8](https://github.com/showdownjs/showdown/commit/169cbe8)) ### Features * **events:** add events to all subparsers ([7d63a3e](https://github.com/showdownjs/showdown/commit/7d63a3e)) ## [1.6.2](https://github.com/showdownjs/showdown/compare/1.6.1...1.6.2) (2017-01-29) ### Bug Fixes * **escapeSpecialCharsWithinTagAttributes:** add ~ and = to escaped chars ([bfcc0e4](https://github.com/showdownjs/showdown/commit/bfcc0e4)) * **strikethrough:** allow escaping tilde char ([24d47d7](https://github.com/showdownjs/showdown/commit/24d47d7)), closes [#331](https://github.com/showdownjs/showdown/issues/331) ### Features * **ghMentionsLink:** add ability to define the generated url in @mentions ([a4c24c9](https://github.com/showdownjs/showdown/commit/a4c24c9)) ## [1.6.1](https://github.com/showdownjs/showdown/compare/1.6.0...1.6.1) (2017-01-28) ### Bug Fixes * **simplifiedAutoLink:** fix missing spaces before and after email addresses ([5190b6a](https://github.com/showdownjs/showdown/commit/5190b6a)), closes [#330](https://github.com/showdownjs/showdown/issues/330) ### Features * **encodeEmail:** add option to enable/disable mail obfuscation ([90c52b8](https://github.com/showdownjs/showdown/commit/90c52b8)) ### Notes This release also improves performance a bit (around 8%) ## [1.6.0](https://github.com/showdownjs/showdown/compare/1.5.5...1.6.0) (2017-01-09) ### Bug Fixes * **ghCompatibleHeaderId:** improve the number of removed chars ([d499feb](https://github.com/showdownjs/showdown/commit/d499feb)) * **IE8:** fix for IE8 error on using isUndefined function ([561dc5f](https://github.com/showdownjs/showdown/commit/561dc5f)), closes [#280](https://github.com/showdownjs/showdown/issues/280) * **options:** fix ghCompatibleHeaderId that was set as string instead of boolean ([de7c37e](https://github.com/showdownjs/showdown/commit/de7c37e)) * **simpleLineBreaks:** fix simpleLineBreaks option not working with non-ASCII chars and markdown delimiters ([b1c458a](https://github.com/showdownjs/showdown/commit/b1c458a)), closes [#318](https://github.com/showdownjs/showdown/issues/318) [#323](https://github.com/showdownjs/showdown/issues/323) ### Features * **CLI:** add -q (quiet) and -m (mute) mode to CLI ([f3b86f0](https://github.com/showdownjs/showdown/commit/f3b86f0)) * **CLI:flavor:** add flavor option to CLI ([2d6cd1e](https://github.com/showdownjs/showdown/commit/2d6cd1e)) * **getFlavor:** add getFlavor method to showdown and Converter ([0eaf105](https://github.com/showdownjs/showdown/commit/0eaf105)) * **ghMentions:** add support for github's @mentions ([f2671c0](https://github.com/showdownjs/showdown/commit/f2671c0)), closes [#51](https://github.com/showdownjs/showdown/issues/51) ### BREAKING CHANGES: * CLI tool now uses the same option defaults as showdown main library. This mean the default flavor is vanilla and ghCodeBlocks options is enabled by default. To update, add `--ghCodeBlocks="false"` to the command. ## [1.5.5](https://github.com/showdownjs/showdown/compare/1.5.4...1.5.5) (2016-12-30) ### Features * **ghCompatibleHeaderId:** generate header ids compatible with github ([db97a90](https://github.com/showdownjs/showdown/commit/db97a90)), closes [#320](https://github.com/showdownjs/showdown/issues/320) [#321](https://github.com/showdownjs/showdown/issues/321) ## [1.5.4](https://github.com/showdownjs/showdown/compare/1.5.3...1.5.4) (2016-12-21) ### Bug Fixes * **horizontal rule:** revert backwards incompatibility change ([113f5f6](https://github.com/showdownjs/showdown/commit/113f5f6)), closes [#317](https://github.com/showdownjs/showdown/issues/317) * **simpleLineBreaks:** fix simpleLineBreak option breaking lists html ([ed4c33f](https://github.com/showdownjs/showdown/commit/ed4c33f)), closes [#316](https://github.com/showdownjs/showdown/issues/316) ## [1.5.3](https://github.com/showdownjs/showdown/compare/1.5.2...1.5.3) (2016-12-19) ### Bug Fixes * parser slowness with certain inputs ([da8fb53](https://github.com/showdownjs/showdown/commit/da8fb53)), closes [#315](https://github.com/showdownjs/showdown/issues/315) ### Features * **requireSpaceBeforeHeadingText:** option to make space between `#` and header text mandatory ([5d19877](https://github.com/showdownjs/showdown/commit/5d19877)), closes [#277](https://github.com/showdownjs/showdown/issues/277) ## [1.5.2](https://github.com/showdownjs/showdown/compare/1.5.1...1.5.2) (2016-12-17) ### Bug Fixes * **listeners:** fix listeners typo ([f0d25b7](https://github.com/showdownjs/showdown/commit/f0d25b7)), closes [#290](https://github.com/showdownjs/showdown/issues/290) * **lists:** lines with multiple dashes being parsed as multilists ([10b3410](https://github.com/showdownjs/showdown/commit/10b3410)), closes [#312](https://github.com/showdownjs/showdown/issues/312) * **nbsp:** nbsp are replaced with simple spaces ([6e90f7c](https://github.com/showdownjs/showdown/commit/6e90f7c)) ## [1.5.1](https://github.com/showdownjs/showdown/compare/1.5.0...1.5.1) (2016-12-01) ### Features * **simpleLineBreaks:** option that parses linebreaks ashello world! **Actual Output:**
hello **world**!
# Want a Feature? You can request a new feature by submitting an issue. If you would like to implement a new feature feel free to issue a Pull Request. # Pull requests (PRs) PRs are awesome. However, before you submit your pull request consider the following guidelines: - Search GitHub for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort. - When issuing PRs that change code, make your changes in a new git branch based on develop: ```bash git checkout -b my-fix-branch develop ``` - Run the full test suite before submitting and make sure all tests pass (obviously =P). - Try to follow our [**coding style rules**](https://github.com/showdownjs/code-style/blob/master/README.md). Breaking them prevents the PR to pass the tests. - Refrain from fixing multiple issues in the same pull request. It's preferable to open multiple small PRs instead of one hard to review big one. Also, don't reuse old forks (or PRs) to fix new issues. - If the PR introduces a new feature or fixes an issue, please add the appropriate test case. - We use commit notes to generate the changelog. It's extremely helpful if your commit messages adhere to the [**AngularJS Git Commit Guidelines**](https://github.com/showdownjs/code-style/blob/master/README.md#commit-message-convention). - If we suggest changes then: - Make the required updates. - Re-run the Angular test suite to ensure tests are still passing. - Rebase your branch and force push to your GitHub repository (this will update your Pull Request): ```bash git rebase develop -i git push origin my-fix-branch -f ``` - After your pull request is merged, you can safely delete your branch. If you have time to contribute to this project, we feel obliged that you get credit for it. These rules enable us to review your PR faster and will give you appropriate credit in your GitHub profile. We thank you in advance for your contribution! # Joining the team We're looking for members to help maintaining Showdown. Please see [this issue](https://github.com/showdownjs/showdown/issues/114) to express interest or comment on this note. ================================================ FILE: CREDITS.md ================================================ Credits ======= - Showdown v2 * [Estevão Santos](https://github.com/tivie) * [SyntaxRules](https://github.com/SyntaxRules) - Showdown v1 * [Estevão Santos](https://github.com/tivie) * [Pascal Deschênes](https://github.com/pdeschen) - Showdown v0 * [Corey Innis](http://github.com/coreyti):var foo = 'bar';
```
Becomes this:
```html
var foo = 'bar';
```
* **noHeaderId**: (boolean) [default false] Disable the automatic generation of header ids.
Setting to true overrides **prefixHeaderId**
* **customizedHeaderId**: (boolean) [default false] Use text in curly braces as header id. **(since v1.7.0)**
Example:
```
## Sample header {real-id} will use real-id as id
```
* **ghCompatibleHeaderId**: (boolean) [default false] Generate header ids compatible with github style
(spaces are replaced with dashes and a bunch of non alphanumeric chars are removed) **(since v1.5.5)**
* **prefixHeaderId**: (string/boolean) [default false] Add a prefix to the generated header ids.
Passing a string will prefix that string to the header id. Setting to `true` will add a generic 'section' prefix.
* **rawPrefixHeaderId**: (boolean) [default false] Setting this option to true will prevent showdown from modifying the prefix.
This might result in malformed IDs (if, for instance, the " char is used in the prefix).
Has no effect if prefixHeaderId is set to false. **(since v 1.7.3)**
* **rawHeaderId**: (boolean) [default false] Remove only spaces, ' and " from generated header ids (including prefixes),
replacing them with dashes (-). WARNING: This might result in malformed ids **(since v1.7.3)**
* **headerLevelStart**: (integer) [default 1] Set the header starting level. For instance, setting this to 3 means that
```md
# foo
```
will be parsed as
```html
some text www.google.com
```
* ~~**excludeTrailingPunctuationFromURLs**: (boolean) [default false] This option excludes trailing punctuation from autolinking urls.
Punctuation excluded: `. ! ? ( )`. Only applies if **simplifiedAutoLink** option is set to `true`.~~
* **literalMidWordUnderscores**: (boolean) [default false] Turning this on will stop showdown from interpreting
underscores in the middle of words as `` and `` and instead treat them as literal underscores.
Example:
```md
some text with__underscores__in middle
```
will be parsed as
```html
some text with__underscores__in middle a line tags around block-level tags.
text = showdown.subParser('makehtml.hashHTMLBlocks')(text, options, globals);
text = showdown.subParser('makehtml.paragraphs')(text, options, globals);
text = globals.converter._dispatch('makehtml.blockGamut.after', text, options, globals).getText();
return text;
});
showdown.subParser('makehtml.blockQuotes', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.blockQuotes.before', text, options, globals).getText();
// add a couple extra lines after the text and endtext mark
text = text + '\n\n';
var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
if (options.splitAdjacentBlockquotes) {
rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
}
text = text.replace(rgx, function (bq) {
// attacklab: hack around Konqueror 3.5.4 bug:
// "----------bug".replace(/^-/g,"") == "bug"
bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting
// attacklab: clean up hack
bq = bq.replace(/¨0/g, '');
bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
bq = showdown.subParser('makehtml.githubCodeBlocks')(bq, options, globals);
bq = showdown.subParser('makehtml.blockGamut')(bq, options, globals); // recurse
bq = bq.replace(/(^|\n)/g, '$1 ');
// These leading spaces screw with Just type tags
for (var i = 0; i < end; i++) {
var str = grafs[i];
// if this is an HTML marker, copy it
if (str.search(/¨([KG])(\d+)\1/g) >= 0) {
grafsOut.push(str);
// test for presence of characters to prevent empty lines being parsed
// as paragraphs (resulting in undesired extra empty paragraphs)
} else if (str.search(/\S/) >= 0) {
str = showdown.subParser('makehtml.spanGamut')(str, options, globals);
str = str.replace(/^([ \t]*)/g, ' ');
str += ' tags
for (var i = 0; i < end; i++) {
var str = grafs[i];
// if this is an HTML marker, copy it
if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
grafsOut.push(str);
// test for presence of characters to prevent empty lines being parsed
// as paragraphs (resulting in undesired extra empty paragraphs)
} else if (str.search(/\S/) >= 0) {
str = showdown.subParser('makehtml.spanGamut')(str, options, globals);
str = str.replace(/^([ \t]*)/g, ' ');
str += ' <div>foo</div> ... ... this is a :smile: emoji this is a 😄 emoji check this link www.google.com. check this link www.google.com. hello there @tivie hello there @tivie hello there @tivie hello there @tivie some text withunderscoresin the middle some text with__underscores__in the middle #heading a line
wrapped in two a line Lorem ipsum www.google.com Lorem ipsum www.google.com Quote #1 Sub-quote 1 Quote #2 Sub-quote 2 Quote #1 Sub-quote 1 Quote #2 Sub-quote 2 Here's an idea: why don't we take ` tags in the HTML output.
So this input:
```md
* Bird
* Magic
* Johnson
```
results in:
```html
Bird Magic Johnson hey @tivie, check this out some markdown here some markdown here with some markdown here this is not parsed foo bar baz %PLACEHOLDER' + i + '% *<\/p>';
text = text.replace(new RegExp(pat, 'gi'), matches[i]);
}
//reset array
matches = [];
return text;
}
}
]
});
```
In this example, you created a [`lang` extension](../create-extension.md#type) that:
1. Checks for the pseudo tags `%start%` and `%end%`.
1. Extracts everything in between the tags.
1. Saves the content between the tags in a variable.
1. Replaces the saved content with a placeholder to identify the exact position of the extracted text.
and an [`output` extension](../create-extension.md#type) that replaces the placeholder with the saved content, once Showdown is finished parsing.
[1]: http://jsfiddle.net/tivie/1rqr7xy8/
================================================
FILE: docs/xss.md
================================================
# Markdown's XSS vulnerability
## Introduction
Cross-Site Scripting (XSS) is a well-known technique to gain access to the private information of users on a website. The attacker injects spurious HTML content (a script) on the web page. This script can read the user’s cookies and do other malicious actions (like steal credentials). As a countermeasure, you should always filter user input for suspicious content. Showdown doesn’t include an XSS filter, so you must provide your own. But be careful in how you do it.
## Markdown is inherently unsafe
Markdown syntax allows the inclusion of arbitrary HTML. For example, below is a perfectly valid Markdown:
```md
This is a regular paragraph.
hello you tags around block-level tags.
text = showdown.subParser('makehtml.hashHTMLBlocks')(text, options, globals);
text = showdown.subParser('makehtml.paragraphs')(text, options, globals);
text = globals.converter._dispatch('makehtml.blockGamut.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/blockQuotes.js
================================================
showdown.subParser('makehtml.blockQuotes', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.blockQuotes.before', text, options, globals).getText();
// add a couple extra lines after the text and endtext mark
text = text + '\n\n';
var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
if (options.splitAdjacentBlockquotes) {
rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
}
text = text.replace(rgx, function (bq) {
// attacklab: hack around Konqueror 3.5.4 bug:
// "----------bug".replace(/^-/g,"") == "bug"
bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting
// attacklab: clean up hack
bq = bq.replace(/¨0/g, '');
bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
bq = showdown.subParser('makehtml.githubCodeBlocks')(bq, options, globals);
bq = showdown.subParser('makehtml.blockGamut')(bq, options, globals); // recurse
bq = bq.replace(/(^|\n)/g, '$1 ');
// These leading spaces screw with Just type tags
for (var i = 0; i < end; i++) {
var str = grafs[i];
// if this is an HTML marker, copy it
if (str.search(/¨([KG])(\d+)\1/g) >= 0) {
grafsOut.push(str);
// test for presence of characters to prevent empty lines being parsed
// as paragraphs (resulting in undesired extra empty paragraphs)
} else if (str.search(/\S/) >= 0) {
str = showdown.subParser('makehtml.spanGamut')(str, options, globals);
str = str.replace(/^([ \t]*)/g, ' ');
str += ' tags
for (var i = 0; i < end; i++) {
var str = grafs[i];
// if this is an HTML marker, copy it
if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
grafsOut.push(str);
// test for presence of characters to prevent empty lines being parsed
// as paragraphs (resulting in undesired extra empty paragraphs)
} else if (str.search(/\S/) >= 0) {
str = showdown.subParser('makehtml.spanGamut')(str, options, globals);
str = str.replace(/^([ \t]*)/g, ' ');
str += ' foo bar foo +++ === --\n**\n__ Foo\n*** _ _ _ _ a a------ ---a--- - Foo bar bar ####### foo #5 bolt #hashtag ## foo foo\n# bar Foo bar Bar foo Foo\n--- Foo\n= = Foo ` of dashes"/> Foo foo\nbar\n=== Baz ==== foo Foo baz Foo\nbar baz Foo\nbar baz Foo\nbar\n---\nbaz foo bar foo Foo\nbar bar bbb foo baz world.\n okay. Markdown bar foo okay okay okay foo baz okay okay okay Foo Foo\n\nbaz Emphasized text. [foo]: /url 'title with blank line' [foo] [foo]: [foo] bar [foo]: /url "title" ok "title" ok [foo] [foo] Foo\n[bar]: /baz [bar] bar aaa bbb aaa\nbbb ccc\nddd aaa bbb aaa\nbbb aaa\nbbb\nccc aaa\nbbb bbb aaa aaa bar\nbaz bar\nbaz bar\nbaz bar\nbaz bar\nbaz\nfoo foo foo foo\n- bar foo foo bar foo\nbar foo bar foo bar aaa bbb bar\nbaz bar baz bar baz foo\nbar foo\nbar\nbaz not code A paragraph\nwith two lines. A block quote. A paragraph\nwith two lines. A block quote. two one two one two one two two -one 2.two foo bar foo baz bam Foo 1234567890. not ok -1. not ok foo foo paragraph paragraph paragraph foo bar bar foo bar foo foo\n* foo\n1. A paragraph\nwith two lines. A block quote. A paragraph\nwith two lines. A block quote. A paragraph\nwith two lines. A block quote. A paragraph\nwith two lines. A block quote. Blockquote\ncontinued here. Blockquote\ncontinued here. Foo The number of windows in my house is\n14. The number of doors is 6. The number of windows in my house is foo bar baz baz bim foo notcode foo a b c a b c a c a b c d a b d b c b b bar foo baz a d !"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ \\\t\\A\\a\\ \\3\\φ\\« *not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference" \\emphasis foo & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸ # Ӓ Ϡ � � " ആ ಫ   &x; &#; &#x;\n&ThisIsNotDefined; &hi?; © &MadeUpEntity; *foo [not a ```foo`` `foo `foo foo bar a * foo bar* a*"foo"* * a * foobar 5678 foo bar _ foo bar_ a_"foo"_ foo_bar_ 5_6_78 пристаням_стремятся_ aa_"bb"_cc foo-(bar) _foo* *foo bar * *foo bar\n* *(*foo) (foo) foobar _foo bar _ _(_foo) (foo) _foo_bar _пристаням_стремятся foo_bar_baz (bar). foo bar ** foo bar** a**"foo"** foobar foo bar __ foo bar__ __\nfoo bar__ a__"foo"__ foo__bar__ 5__6__78 пристаням__стремятся__ foo, bar, baz foo-(bar) **foo bar ** **(**foo) (foo) Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa) foo "bar" foo foobar __foo bar __ __(__foo) (foo) __foo__bar __пристаням__стремятся foo__bar__baz (bar). foo bar foo\nbar foo bar baz foo bar baz foo bar foo bar foo bar baz foobarbaz foo bar foo bar foobar foo bar baz bim bop foo bar ** is not an empty emphasis **** is not an empty strong emphasis foo bar foo\nbar foo bar baz foo bar baz foo bar foo bar foo bar baz foobarbaz foo bar foo bar foo bar baz\nbim bop foo bar __ is not an empty emphasis ____ is not an empty strong emphasis foo *** foo * foo _ foo ***** foo * foo _ *foo foo* *foo ***foo foo* foo*** foo ___ foo _ foo * foo _____ foo _ foo * _foo foo_ _foo ___foo foo_ foo___ foo foo foo foo foo foo foo foo foo foo _bar baz_ foo bar *baz bim bam **foo bar baz *foo bar baz *bar* _foo bar_ * a a [link](/my uri) [link](</my uri>) [link](foo\nbar) [link]( [link](/url "title "and" title") [link] (/uri) [link] bar](/uri) [link bar [foo bar](/uri) [foo [bar baz](/uri)](/uri) *foo* foo [bar baz] [foo [foo [foohttp://example.com/?search=](uri) *foo* [foo [foo [foohttp://example.com/?search=][ref] Толпой is a Russian word. [foo] bar [foo]\nbar [bar][foo!] [foo][ref[] [ref[]: /uri [foo][ref[bar]] [ref[bar]]: /uri [[[foo]]] [[[foo]]]: /url [] []: /uri [\n] [\n]: /uri foo\n[] [foo bar] [[bar foo foo bar [foo] *foo* foo(not a link) [foo]bar [foo]bar My ![[foo]] [[foo]]: /url "title" ![foo] !foo http://foo.bar.baz/test?q=hello&id=22&boolean <http://foo.bar/baz bim> <foo+@bar.example.com> <> < http://foo.bar > <m:abc> <foo.bar.baz> http://example.com foo@bar.example.com Foo <33> <__> <a h*#ref="hi"> <a href="hi'> <a href=hi'> < a><\nfoo><bar/ > <a href='bar'title=title> </a href="foo"> foo foo <!-- not a comment -- two hyphens --> foo <!--> foo --> foo <!-- foo---> foo foo foo &<]]> <a href="""> foo foo foo foo foo foo foo foo\\ foo foo\nbaz foo\nbaz hello $.;'there Foo χρῆν Multiple spaces foo.bar www.foobar https://www.foobar.com/baz?bazinga=nhecos; this is a sentence_with_mid underscores this is a sentence with just_one underscore this should be parsed as emphasis this is double__underscore__mid word this has just__one double underscore this should be parsed as bold emphasis at end of sentence emphasis at line start multi line emphasis
yeah it is yeah a this should~~not be parsed escaped ~~strikethrough~~ escaped ~~strikethrough~~ otherthings blabla This is parsed foo *bar *baz foo **bar **baz foo _bar _baz foo __bar __baz a simple Your friend you can use markdown for card documentation this is a link to www.github.com this is a link to www.google.com this has paragraphed list this belongs This text simple simple some item another And paragraph and another foo foo烫 foo Nom : aaaa Just an example info@example.com ok? ~~test~~ <div>foo</div> Example http://example.com My link is important My link is important strippers, hitler, and stalin some markdown text a paragraph --- with dashes This is a markdown file Converted into a full HTML document this email foobar@example.com should not be encoded this is some text some other text ellipsis in text... … ellipsis in blockquote... 1... 1… foo🍎bar foo: apple :bar :foo 🍎 bar: this link somelink emoji 🍎 🍎 and 💋 💋my🍎 👩❤️💋👨 http://www.example.com/some:apple:url this is showdown's emoji and this is github's emoji url http://www.google.com? foo url (http://www.google.com) bazinga url [http://www.google.com] bazinga url http://www.google.com, bar hello @tivie how are you? this email foo@gmail.com is not parsed this @mentions is not parsed @.johndoe @_johndoe @-johndoe this is a sentence*with*mid asterisks this is a sentence**with**two mid asterisks this is a sentence***with***three mid asterisks this is double*asterisk*mid word with another**asterisk**word this is double**asterisk**mid word with another**asterisk**word this is double***asterisk***mid word with another***asterisk***word this is double*asterisk**mid word with another***asterisk*word this is double**asterisk*mid word with another***asterisk**word this is a sentence with just*one asterisk this is a sentence with just**one asterisk this is a sentence with just***one asterisk this is double**asterisk**mid word this has just**one double asterisk this has just***one triple asterisk this should be parsed as emphasis this should be parsed as bold this should be parsed as bold and emphasis emphasis at end of sentence bold at end of sentence bold and emphasis at end of sentence emphasis at line start bold at line start bold and emphasis at line start multi line emphasis
yeah it is yeah multi line emphasis
yeah it is yeah multi line emphasis
yeah it is yeah Bold: Bold Bold: some foo yeah some foo yeah some foo yeah some word_foo_yeah some word__foo__yeah some word___foo___yeah strippers, hitler, and stalin strippers, hitler, and stalin strippers, hitler, and stalin multiple italics and bolds in a paragraph multiple bolds in a paragraph multiple italics in a paragraph Bold: Bold Bold: some markdown text a paragraph --- with dashes some markdown text description: This is a long text and so it
spans on multiple lines.
It must be indented,
for showdown to parse it correctly.
Markdown such as bold is not parsed
and it will be rendered as plain text. some markdown text description: This is a long text and so it
spans on multiple lines.
It must be indented,
for showdown to parse it correctly.
Markdown such as bold is not parsed
and it will be rendered as plain text. some markdown text title: This is the document title
language: en
author: Tivie
contributors: John, Mary, Steve
description: This is a long text and so it
spans on multiple lines.
It must be indented,
for showdown to parse it correctly.
Markdown such as bold is not parsed
and it will be rendered as plain text.
date: 01-01-2010
keywords: foo, bar, baz some markdown text some text some markdown text some markdown text some markdown text this link is in the same page a link http://www.google.com a link http://www.google.com this is http://www.google.com autolink #header hmm One Two bar nhecos Three foo bar http://www.foobar.com/blegh#**foobar**bazinga http://foo.com/blah_blah_(wikipedia) http://foo.com/blah_blah_(wikipedia)_(again) http://www.example.com/wpstyle/?p=364 https://www.example.com/foo/?bar=baz&inga=42&quux http://userid:password@example.com:8080 http://userid:password@example.com:8080/ http://userid@example.com:8080 http://userid@example.com:8080/ http://userid:password@example.com http://userid:password@example.com/ http://foo.com/blah_(wikipedia)#cite-1 http://foo.com/blah_(wikipedia)_blah#cite-1 http://foo.com/unicode_(✪)_in_parens http://foo.com/(something)?after=parens http://code.google.com/events/#&product=browser http://foo.bar/?q=Test%20URL-encoded%20stuff http://foo.bar/foo(bar)baz quux http://foo.bar?q=Spaces should be encoded http://.www.foo.bar/ http://.www.foo.bar./ http:// http://. http://.. http://../ http://? http://?? http://??/ http://# http://## http://##/ // //a ///a /// http:///a foo.com rdar://1234 h://test http:// shouldfail.com :// should fail http://-error-.invalid/ http://-a.b.co http://3628126748 http://en.wikipedia.org/wiki/Tourism_in_Germany foo ftp://user:password@host.com:port/path this has some http://www.google.com/foobar in text this has some www.google.com/foobar in text this has some ftp://user:password@host.com:port/path in text http://www.google.com!!!!!!!!!!!!!!!! http://www.google.com/!!!!!!!!!!!!!!!!foobar http://www.google.com/!!!!!!!!!!!!!!!! foobar a This is my first block quote. This is my second block quote. This is my second block quote
yeah
everythong is ok. This is not a blockquote some text Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nisi est,
ullamcorper euismod iaculis sed, tristique at neque. Nullam metus risus,
malesuada vitae imperdiet ac, tincidunt eget lacus. Proin ullamcorper
vulputate dictum. Vestibulum consequat ultricies nibh, sed tempus nisl mattis a. Phasellus ac porttitor quam. Integer cursus accumsan mauris nec interdum.
Etiam iaculis urna vitae risus facilisis faucibus eu quis risus. Sed aliquet
rutrum dictum. Vivamus pulvinar malesuada ultricies. Pellentesque in commodo
nibh. Maecenas justo erat, sodales vel bibendum a, dignissim in orci. Duis
blandit ornare mi non facilisis. Aliquam rutrum fringilla lacus in semper.
Sed vel pretium lorem. | First Header | Second Header | Markdown for readmes is pretty popular. So, I've given you a demo
here of all the markup we support. In some cases, I copied the doc/examples entirely from the Fireball Markdown site. I didn't duplicate all the Markdown doc everything tho. For the entire docs and a deeper explanation of Markdown, you still need to go to the Markdown site. You can also use Markdown mark up in comments, issues, and commit messages. On this page: These elements occur within a line of text. So, for example font changes or links. Markdown treats * (asterisk) as emphasis markers. single asterisks
double asterisks All are created from this: double underscores triple underscores All are created from this: You must use the same character must be used to open and close an emphasis span. Emphasis can be used in the middle of a word. But if you surround an * or _ with spaces, it will be treated as a literal asterisk or underscore. To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it: Markdown's Markdown parser supports strikethrough by wrapping text in ~~text that has been struckthrough~~ is created from: To indicate a span of code, wrap it with Use the is produced from: To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: Markdown supports inline and reference links. In both styles, the link text is delimited by [square brackets]. To create an inline link, use this syntax: So an inline link to Yahoo looks like this: Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link: Which gives you a link like this: This is an example reference-style link. Elsewhere in the document, usually at the bottom of the file, you define your link label on a line by itself: Links can get pretty fancy, so if you want the long form version, visit the
official Markdown docs. Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference. Images appear like this: These are elements that are a single or multiple lines in length You can create Atx-style headings by prefixing with a # (hash mark) You can also create Setext-style headings which have two levels. A paragraph is one or more consecutive lines of text separated by one or more
blank lines. A blank line contains nothing but spaces or tabs. Do not indent
normal paragraphs with spaces or tabs. New lines/carriage returns within paragraphs require two spaces at the end of the preceding line. This is one paragraph. This is a second. Markdown uses email-style > (greater than) characters for blockquoting. If you’re familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a > before every line: This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing. Blockquotes can be nested (i.e. a blockquote-in-a-blockquote): This is the first level of quoting. This is nested blockquote. Back to the first level. Blockquotes can contain other Markdown elements, including headers, lists, and code blocks: Here's some example code: Markdown supports ordered (numbered) and unordered (bulleted) lists. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab. Form bulleted lists with any of * (asterisk), + (plus), or - (dash). You can one or any or mix of these to form a list: Red Green Blue Ordered lists require a numeric character followed by a . (period). Item one Item two Item three Notice the actual value of the number doesn't matter in the list result. However, for readability better to use this markup: Lists can be embedded in lists. List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab: Red Green Blue Item one Item two This is is a first paragraph. This is a second paragraph. Item three The code for these embedded lists or paragraphs is: You can also embed blockquotes in a list. What is this? It is embedded blockquote. Mix 'em and match 'em. You can also embed code blocks in a list. Green Try this code: Then this: Blue Red Markdown does not support The second line must be a mandatory separator line between the headers and the content. Subsequent lines are table rows. Columns are always separated by the pipe (|) character. For example this table: First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell Comes from this code: You can only put simple lines in a table. You can specify alignment for each column by adding colons to separator lines. A colon at the left of the separator line, left-aligns the column. A colon on the right, right-aligns the column. Add colons to both sides to center the column is center-aligned. Right | Left | Center
---------:| :----- |:-----:
Computer | $1600 | one
Phone | $12 | three
Pipe | $1 | eleven You can apply inline formatting (span-level changes such as fonts or links) to the content of each cell using regular Markdown syntax: | Function name | Description |
| ------------- | ------------------------------ |
| Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the code block linesare interpreted literally. Markdown wraps a code block in both To produce a code block in Markdown, indent every line of the block by at least 4 spaces or 1 tab. For : This is a normal paragraph: The code reveals the indentation. A code block continues until it reaches a line that is not indented (or the end of the page). Within a code block, & (ampersands) and < > (angle brackets) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown — just paste it and indent it. Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this: Here is an example of AppleScript: To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example, given this input: You can also highlight snippets of text (Markdown uses the excellent Pygments library) to allow you to use code highlighting Here's an example of some Python code: To do this, do not indent the block. Start the block with You can also use a fence style for code. Which you create with this code: See Michel Fortin's blog to try out more examples of this coding style. Not everything he demos is guaranteed to work though. You can produce a horizontal line with any of the following codes: The output looks like this: Here is an example of AppleScript: Here is an example of AppleScript: this is underlined word an underlined sentence three underscores are fine _single_ underscores are left alone multiple underlines in a paragraph The quick brown fox[^1] jumped over the lazy dog[^2]. Combined with Prism.js in the Ghost theme: foo_bar_baz foo_bar_baz_bar_foo foo_bar baz_bar baz_foo baz_bar_foo baz_bar_foo baz_bar_foo baz bar foo baz_bar_foo foo bar baz and foo foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo foo_bar_baz foo_bar_baz_bar_foo foo_bar baz_bar baz_foo foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo blockquote foo_bar_baz foo_bar_baz_bar_foo foo_bar baz_bar baz_foo http://en.wikipedia.org/wiki/Tourism_in_Germany Another example of a link http://myurl.com/foo_bar_baz_bar_foo http://myurl.com/foo_bar_baz_bar_foo italics. italics . escaped word_with_underscores escaped word__with__double underscores escaped word_with_single italic underscore escaped word*with*asterixs escaped word**with**asterixs escaped word*with*bold asterixs 2015-10-04 Hi, I am a thing I am another thing! a blockquote Test pre in a list this is a long paragraph this is another long paragraph this is a long paragraph this should be this should be this should be this should> appear this text <should appear foo foo foo foo foo foo list item 1 list item 2 foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo a a a - - a - * - - + a 2. 3. 4. 5. 2. 3. 4. 5. a fooo - - aaaaa bbbbb foo *bar *baz foo **bar **baz foo ***bar ***baz foo _bar _baz foo __bar __baz foo ___bar ___baz foo *bar *baz *bazinga foo **bar **baz **bazinga foo ***bar ***baz ***bazinga foo _bar _baz __bazinga foo __bar __baz __bazinga foo ___bar ___baz ___bazinga f f f f foo **bar **baz bazinga bla foo bar **baz **bazinga bla foo **bar **baz **bazinga bla this is imbued link with strong this is imbued link with strong this | This is an This is another This is a link. This is another link2. link4(this should work) malformed malformed
================================================
FILE: test/functional/makehtml/cases/issues/#397.unordered-list-strange-behavior.html
================================================
Customer – Opens the Customer List. Refer to the document “Customer Management”. Designer - Opens the Designer List. Refer to the document “Designer Commissions”. Code block as part of list This remove dissolved When placed in your filter [^1]:a [^1]:a [ one two three plain text link http://test.com/this_has/one.html with underscores legit·word_with·1·underscore a wordwith2underscores (gets em) this is a underscore_test another hmm [We] are going to show [you]: sunshine! [x]: take out the garbage This is a first paragraph,
on multiple lines. This is a second paragraph.
There are spaces in between the two. This is a first paragraph,
on multiple lines. This is a second paragraph
which has multiple lines too. A first paragraph. A second paragraph after 3 CR (carriage return). This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line. This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. 1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line. This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. A new long long long long long long long long long long long long long long long long paragraph on 1 line. These lines all end with end of line (EOL) sequences. Seriously, they really do. If you don't believe me: HEX EDIT! These lines all end with end of line (EOL) sequences. Seriously, they really do. If you don't believe me: HEX EDIT! These lines all end with end of line (EOL) sequences. Seriously, they really do. If you don't believe me: HEX EDIT! An ampersand & in the text flow is escaped as an html entity. There is an ampersand in the URI. This is *an asterisk which should stay as is. This is * an asterisk which should stay as is. \ backslash
` backtick
* asterisk
_ underscore
{} curly braces
[] square brackets
() parentheses
# hash mark
+ plus sign
- minus sign (hyphen)
. dot
! exclamation mark paragraph A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line. and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line. This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a blockquote. A blockquote
on multiple lines
like this. A blockquote
on multiple lines
like this. A blockquote
on multiple lines
like this. But it has
two paragraphs. A blockquote
on multiple lines
like this This is the first level of quoting. This is nested blockquote. Back to the first level. This is the first level of quoting. This is nested blockquote. This is the first level of quoting. This is nested blockquote.
Back to the first level. This is the first level of quoting. This is nested blockquote. asterisks single asterisks single underscores HTML entities are written using ampersand notation: © # This is an H1 A new paragraph. We love A first sentence A first sentence This is an automatic link http://www.w3.org/ a list containing a blockquote this the blockquote in the list a list containing a block of code This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. 1. ordered list escape 1 2 This is a paragraph
on multiple lines
with hard return. This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. This is a paragraph with a trailing and leading space. This is a paragraph with 1 trailing tab. This is a paragraph with 2 leading spaces. This is a paragraph with 3 leading spaces. This is a paragraph with 1 leading space. This is a paragraph with a trailing space. asterisks double asterisks double underscores list item in paragraph another list item in paragraph Reserved Keywords found at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar Object property names found at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object prototype.propertyIsEnumerable This is an example reference-style link.
This is another reference-style link.
This is a third reference-style link.
This is a fourth reference-style link. This is a link (some other text) This is a link (some other text) This is a link (some other text) This is a link (some other text) a blockquote
with a 4 space indented line (not code) sep a blockquote foo Here's some example code: This is a multi line blockquote test With more than one line. This is some HTML: This is a normal paragraph: a strong and em thingy barbazingabar a strong and em thingy barbazingabar Bird Magic ellipsis in text… … ellipsis in blockquote… 1… 1… some text single asterisks single underscores double asterisks double underscores text with italic sentence in middle text with bold sentence in middle text with bold text that
spans across multiple lines underscored_word doubleunderscore__word asterix*word doubleasterix**word line with_underscored word line with__doubleunderscored word line with*asterixed word line with**doubleasterixed word some linewithinner underscores some linewithinner double underscores some linewithinner asterixs some linewithinner double asterixs another line with just _one underscore another line with just __one double underscore another line with just *one asterix another line with just **one double asterix a sentence withunderscore and anotherunderscore a sentence withdoubleunderscore and anotherdoubleunderscore a sentence withasterix and anotherasterix a sentence withdoubleasterix and anotherdoubleasterix escaped word_with_underscores escaped word__with__double underscores escaped word_with_single italic underscore escaped word*with*asterixs escaped word**with**asterixs escaped word*with*bold asterixs foobarbaz foobarbaz this is imbued link with strong this is imbued link with strong this link has underscore some_link multiple italics and bolds with underscores in a paragraph multiple italics and bolds with asterisks in a paragraph multiple bolds with underscores in a paragraph multiple bolds with asterisks in a paragraph multiple italics with underscores in a paragraph multiple italics with asterisks in a paragraph this is code It happened in 1986. What a great season. These should all be escaped: \ ` * _ { } [ ] ( ) # + - . ! That is some code! Define a function in javascript: And some nested quote Define a function in javascript: And some HTML And some CSS with spaces before the language declaration Use more than 3 backticks Use tilde as delimiter words words words <!---------------------------------------------------------------------------------------------------------------------------------------------------- list item 1 These HTML5 tags should pass through just fine. the end Explain the details Explain the details ![leave me alone] ![leave me alone][] Search the web at Google or Daring Fireball. Search the web at Google or Daring Fireball. This is an example inline link. This link has no title attribute. Create a new Use the backtick in MySQL syntax A single backtick in a code span: A backtick-delimited string in a code span: Please don't use any this strikethrough`
* **tables**: (boolean) [default false] Enable support for tables syntax. Example:
```md
| h1 | h2 | h3 |
|:------|:-------:|--------:|
| 100 | [a][1] | ![b][2] |
| *foo* | **bar** | ~~baz~~ |
```
See the wiki for more info
* **tablesHeaderId**: (boolean) [default false] If enabled adds an id property to table headers tags.
* **ghCodeBlocks**: (boolean) [default true] Enable support for GFM code block style.
* **tasklists**: (boolean) [default false] Enable support for GFM tasklists. Example:
```md
- [x] This task is done
- [ ] This is still pending
```
* **smoothLivePreview**: (boolean) [default false] Prevents weird effects in live previews due to incomplete input
* **smartIndentationFix**: (boolean) [default false] Tries to smartly fix indentation problems related to es6 template
strings in the midst of indented code.
* **disableForced4SpacesIndentedSublists**: (boolean) [default false] Disables the requirement of indenting sublists
by 4 spaces for them to be nested, effectively reverting to the old behavior where 2 or 3 spaces were enough.
**(since v1.5.0)**
* **simpleLineBreaks**: (boolean) [default false] Parses line breaks as `
`, without
needing 2 spaces at the end of the line **(since v1.5.1)**
```md
a line
wrapped in two
```
turns into:
```html
wrapped in two
[](https://www.jetbrains.com/webstorm/)
[sd-logo]: https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png
[legacy-branch]: https://github.com/showdownjs/showdown/tree/legacy
[releases]: https://github.com/showdownjs/showdown/releases
[changelog]: https://github.com/showdownjs/showdown/blob/master/CHANGELOG.md
[wiki]: https://github.com/showdownjs/showdown/wiki
[cli-wiki]: https://github.com/showdownjs/showdown/wiki/CLI-tool
[definitely-typed]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/showdown
[xss-wiki]: https://github.com/showdownjs/showdown/wiki/Markdown's-XSS-Vulnerability-(and-how-to-mitigate-it)
[ext-wiki]: https://github.com/showdownjs/showdown/wiki/extensions
[coding-rules]: https://github.com/showdownjs/code-style/blob/master/README.md
[conventional-commits]: https://www.conventionalcommits.org/
[boilerplate-repo]: https://github.com/showdownjs/extension-boilerplate
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
Security fixes are addressed for the following versions of Showdown.
| Version | Supported |
| ------- | ------------------ |
| 2.0.x | :white_check_mark: |
| 1.x.x | :x: (Known security issue with yargs dependecy) |
Showdown targets the node.js versions targeted in the [node.js release schedule](https://nodejs.org/en/about/releases/). Our test suite follows this release schedule. Consequently, older versions of node may become unusable.
## Reporting a Vulnerability
To report a vulnerability, please add an issue to our main github page: https://github.com/showdownjs/showdown/issues
================================================
FILE: TASKS.TODO.md
================================================
# ROADMAP TO VERSION 3.0
## Options
- [ ] **ghCompatibleHeaderId** (removal)
Will be removed and **will become the default behavior**.
- [ ] **customizedHeaderId** (removal)
This option introduced non compliant syntax so it really belongs in an extension.
The new **listener extension system** allows users to directly modify and customize
the HTML and add any attributes they wish.
- [ ] **rawPrefixHeaderId** (removal)
This option will be superseeded by the option `rawHeaderId`. So basically activating `rawHeaderId` will make
showdown only to replace spaces, ', ", > and < with dashes (-) from generated header ids, including prefixes.
- [X] **literalMidWordAsterisks** (removal)
This option is weird, hard to maintain and really... makes little sense.
- [X] **excludeTrailingPunctuationFromURLs** (removal)
This option will be removed and will be the default behavior from now on.
- [ ] **strikethrough** (change)
Will be enabled by default
- [ ] **disableForced4SpacesIndentedSublists** (to think/postpone)
This was only a temporary option for backwards compatibility reason. However, most flavours support lists indented
with 2 spaces, so it puts us in a tight spot, specially since some markdown beautifiers out there insist in
indenting lists with 2 spaces, probably in a misguided try to follow the CommonMark spec.
The CommonMark spec is, IMHO, a bit confusing for users regarding this, since list sub-blocks (and lists)
are determined by the spaces from the start of the line and the first character after the list mark. And the proof
are the MD beautifiers out there, which misinterpreted the spec and made a mess
Showdown syntax is actually easier (and fully compliant with the original spec): if you indent something 4 spaces,
it becomes a sub-block. Since lists are blocks, you must indent it 4 spaces for it to become a sub-block.
Regardless, we kinda have 2 solutions:
- Drop support for 2 space indentation (and make a lot of users confused since GFM, CommonMark and others allow this)
- Create a new list subparser that can be turned on with an option, like gfmListStyle
(but postpones even more the alpha 3.0 release since the list subparser is probably the hardest thing to rewrite)
Tough choices...
- [ ] **simpleLineBreaks** (change)
Will be removed from Github Flavor since github only does this in comments (which is weird...)
- [ ] **openLinksInNewWindow** (removal)
Will be removed in favor of the new listener extension, which will allow users to manipulate HTML tags attributes
directly.
- [ ] Revamp the option system
Revamp the option system so that it becomes more simple. Right now, it's really confusing. And option names are weird
too. The idea is to pass options to the constructor under an option object, that can have hierarchical structure.
Ex:
```js
var conv = new showdown.Converter({
options: {
links: {
autoLinks: true
},
headings: {
startLevel: 2
}
}
});
```
## Legacy Code Removal
- [ ] Legacy extension support
Old extensions that inject directly into extensions object property will no longer be supported
- [ ] HTML and OUTPUT extensions
HTML and OTP extensions will be dropped in favor of Listener Extensions. We might even give them a new name
## Subparsers
- [X] **Anchors**: Revamp the anchors subparser so it calls strikethrough, bold, italic and underline directly
- [X] **autoLinks**: Fix some lingering bugs and issues with autolinks
## Priority Bugs
- [X] **#355**: *simplifiedAutoLink URLs inside parenthesis followed by another character are not parsed correctly*
- [X] **#534**: *Multiple parentheses () in url link is not parsed correctly*
- [ ] **#367**: *sublists rendering with 2 spaces* - related to disableForced4SpacesIndentedSublists option...
- [ ] **#537**: *master branch doesn't work in a web worker*
## CLI
- [ ] Refactor the CLI
- [ ] **#381**: *Support for src and dst directories in showdown cli*
- [X] **#584**: *Fails to read from stdin*
- [X] **#554**: *CLI not working with jsdom v10*
## Other stuff
- [X] Regexp rewrite for more performance oompf
- [X] Full unit testing
- [ ] Better error reporting
## Stuff that probably won't make it to v2.0
- [ ] **#486**: *A backslash at the end of the line is a hard line break*
- [ ] **#548**: *anchors and images of subParser are errors when they are specific strings*
- [ ] **#549**: *Strange parsing issue with ``*
- [ ] Rethink the global variable
## NEW Features
### Event system
- [X] Listener system revamp
- [ ] Standardize events for all event types
- [ ] Unit testing
- [ ] Functional testing
This should address:
- **#567**: Allow not making header ids lowercase
- **#540**: Add complete class to the tasklist list element
### MD to HTML conversion
- [X] Basic support
- [X] Basic functional testcase
- [ ] Advanced support for all showdown MD features
- [ ] Advanced functional testcase
- [ ] Unit testing
## Documentation (for v2.0)
- [ ] Options
- [ ] Extensions (and the new event system)
- [ ] Cookbook (with stuff for backwards compatibility, specially regarding removed options)
## Browser Testing
- [X] Implement unit tests in Karma
- [ ] Implement functional tests in Karma
- [ ] Integrate with browserstack
================================================
FILE: bin/showdown.js
================================================
#!/usr/bin/env node
var showdown,version,fs=require("fs"),path=require("path"),Command=require("commander").Command,program=new Command,path1=path.resolve(__dirname+"/../dist/showdown.js"),path2=path.resolve(__dirname+"/../../.build/showdown.js");function Messenger(o,t,e){"use strict";t=!!t||!!e,e=!!e,this._print="stdout"===(o=o||"stderr")?console.log:console.error,this.errorExit=function(o){e||(console.error("ERROR: "+o.message),console.error("Run 'showdown
(GFM Style)',
type: 'boolean'
},
requireSpaceBeforeHeadingText: {
defaultValue: false,
describe: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
type: 'boolean'
},
ghMentions: {
defaultValue: false,
describe: 'Enables github @mentions',
type: 'boolean'
},
ghMentionsLink: {
defaultValue: 'https://github.com/{u}',
describe: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
type: 'string'
},
encodeEmails: {
defaultValue: true,
describe: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
type: 'boolean'
},
openLinksInNewWindow: {
defaultValue: false,
describe: 'Open all links in new windows',
type: 'boolean'
},
backslashEscapesHTMLTags: {
defaultValue: false,
describe: 'Support for HTML Tag escaping. ex: \>t<>", "<", ">", "g")
* returns: ["t<", ""]
* matchRecursiveRegExp("
',
'basecamp': '
',
'basecampy': '
',
'bowtie': '
',
'electron': '
',
'feelsgood': '
',
'finnadie': '
',
'goberserk': '
',
'godmode': '
',
'hurtrealbad': '
',
'neckbeard': '
',
'octocat': '
',
'rage1': '
',
'rage2': '
',
'rage3': '
',
'rage4': '
',
'shipit': '
',
'suspect': '
',
'trollface': '
',
'showdown': ''
};
/**
* These are all the transformations that form block-level
* tags like paragraphs, headers, and list items.
*/
showdown.subParser('makehtml.blockGamut', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.blockGamut.before', text, options, globals).getText();
// we parse blockquotes first so that we can have headings and hrs
// inside blockquotes
text = showdown.subParser('makehtml.blockQuotes')(text, options, globals);
text = showdown.subParser('makehtml.headers')(text, options, globals);
// Do Horizontal Rules:
text = showdown.subParser('makehtml.horizontalRule')(text, options, globals);
text = showdown.subParser('makehtml.lists')(text, options, globals);
text = showdown.subParser('makehtml.codeBlocks')(text, options, globals);
text = showdown.subParser('makehtml.tables')(text, options, globals);
// We already ran _HashHTMLBlocks() before, in Markdown(), but that
// was to escape raw HTML in the original Markdown source. This time,
// we're escaping the markup we've just created, so that we don't wrap
//
content, so we need to fix that:
bq = bq.replace(/(\s*[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
var pre = m1;
// attacklab: hack around Konqueror 3.5.4 bug:
pre = pre.replace(/^ /mg, '¨0');
pre = pre.replace(/¨0/g, '');
return pre;
});
return showdown.subParser('makehtml.hashBlock')('\n' + bq + '\n
', options, globals);
});
text = globals.converter._dispatch('makehtml.blockQuotes.after', text, options, globals).getText();
return text;
});
/**
* Process Markdown `` blocks.
*/
showdown.subParser('makehtml.codeBlocks', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.codeBlocks.before', text, options, globals).getText();
// sentinel workarounds for lack of \A and \Z, safari\khtml bug
text += '¨0';
var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
text = text.replace(pattern, function (wholeMatch, m1, m2) {
var codeblock = m1,
nextChar = m2,
end = '\n';
codeblock = showdown.subParser('makehtml.outdent')(codeblock, options, globals);
codeblock = showdown.subParser('makehtml.encodeCode')(codeblock, options, globals);
codeblock = showdown.subParser('makehtml.detab')(codeblock, options, globals);
codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
if (options.omitExtraWLInCodeBlocks) {
end = '';
}
codeblock = '
';
return showdown.subParser('makehtml.hashBlock')(codeblock, options, globals) + nextChar;
});
// strip sentinel
text = text.replace(/¨0/, '');
text = globals.converter._dispatch('makehtml.codeBlocks.after', text, options, globals).getText();
return text;
});
/**
*
* * Backtick quotes are used for ' + codeblock + end + ' spans.
*
* * You can use multiple backticks as the delimiters if you want to
* include literal backticks in the code span. So, this input:
*
* Just type ``foo `bar` baz`` at the prompt.
*
* Will translate to:
*
* foo `bar` baz at the prompt.`bar` ...
*/
showdown.subParser('makehtml.codeSpans', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.codeSpans.before', text, options, globals).getText();
if (typeof (text) === 'undefined') {
text = '';
}
text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
function (wholeMatch, m1, m2, m3) {
var c = m3;
c = c.replace(/^([ \t]*)/g, ''); // leading whitespace
c = c.replace(/[ \t]*$/g, ''); // trailing whitespace
c = showdown.subParser('makehtml.encodeCode')(c, options, globals);
c = m1 + '' + c + '';
c = showdown.subParser('makehtml.hashHTMLSpans')(c, options, globals);
return c;
}
);
text = globals.converter._dispatch('makehtml.codeSpans.after', text, options, globals).getText();
return text;
});
/**
* Create a full HTML document from the processed markdown
*/
showdown.subParser('makehtml.completeHTMLDocument', function (text, options, globals) {
'use strict';
if (!options.completeHTMLDocument) {
return text;
}
text = globals.converter._dispatch('makehtml.completeHTMLDocument.before', text, options, globals).getText();
var doctype = 'html',
doctypeParsed = '\n',
title = '',
charset = '\n',
lang = '',
metadata = '';
if (typeof globals.metadata.parsed.doctype !== 'undefined') {
doctypeParsed = '\n';
doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
if (doctype === 'html' || doctype === 'html5') {
charset = '';
}
}
for (var meta in globals.metadata.parsed) {
if (globals.metadata.parsed.hasOwnProperty(meta)) {
switch (meta.toLowerCase()) {
case 'doctype':
break;
case 'title':
title = '
';
codeblock = showdown.subParser('makehtml.hashBlock')(codeblock, options, globals);
// Since GHCodeblocks can be false positives, we need to
// store the primitive text and the parsed text in a global var,
// and then return a token
return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
});
// attacklab: strip sentinel
text = text.replace(/¨0/, '');
return globals.converter._dispatch('makehtml.githubCodeBlocks.after', text, options, globals).getText();
});
showdown.subParser('makehtml.hashBlock', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashBlock.before', text, options, globals).getText();
text = text.replace(/(^\n+|\n+$)/g, '');
text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
text = globals.converter._dispatch('makehtml.hashBlock.after', text, options, globals).getText();
return text;
});
/**
* Hash and escape ' + codeblock + end + ' elements that should not be parsed as markdown
*/
showdown.subParser('makehtml.hashCodeTags', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashCodeTags.before', text, options, globals).getText();
var repFunc = function (wholeMatch, match, left, right) {
var codeblock = left + showdown.subParser('makehtml.encodeCode')(match, options, globals) + right;
return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
};
// Hash naked
text = showdown.helper.replaceRecursiveRegExp(text, repFunc, ']*>', '', 'gim');
text = globals.converter._dispatch('makehtml.hashCodeTags.after', text, options, globals).getText();
return text;
});
showdown.subParser('makehtml.hashElement', function (text, options, globals) {
'use strict';
return function (wholeMatch, m1) {
var blockText = m1;
// Undo double lines
blockText = blockText.replace(/\n\n/g, '\n');
blockText = blockText.replace(/^\n/, '');
// strip trailing blank lines
blockText = blockText.replace(/\n+$/g, '');
// Replace the element text with a marker ("¨KxK" where x is its key)
blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
return blockText;
};
});
showdown.subParser('makehtml.hashHTMLBlocks', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashHTMLBlocks.before', text, options, globals).getText();
var blockTags = [
'pre',
'div',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'blockquote',
'table',
'dl',
'ol',
'ul',
'script',
'noscript',
'form',
'fieldset',
'iframe',
'math',
'style',
'section',
'header',
'footer',
'nav',
'article',
'aside',
'address',
'audio',
'canvas',
'figure',
'hgroup',
'output',
'video',
'details',
'p'
],
repFunc = function (wholeMatch, match, left, right) {
var txt = wholeMatch;
// check if this html element is marked as markdown
// if so, it's contents should be parsed as markdown
if (left.search(/\bmarkdown\b/) !== -1) {
txt = left + globals.converter.makeHtml(match) + right;
}
return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
};
if (options.backslashEscapesHTMLTags) {
// encode backslash escaped HTML tags
text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
return '<' + inside + '>';
});
}
// hash HTML Blocks
for (var i = 0; i < blockTags.length; ++i) {
var opTagPos,
rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
patLeft = '<' + blockTags[i] + '\\b[^>]*>',
patRight = '' + blockTags[i] + '>';
// 1. Look for the first position of the first opening HTML tag in the text
while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
// if the HTML tag is \ escaped, we need to escape it and break
//2. Split the text in that position
var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
//3. Match recursively
newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
// prevent an infinite loop
if (newSubText1 === subTexts[1]) {
break;
}
text = subTexts[0].concat(newSubText1);
}
}
// HR SPECIAL CASE
text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
showdown.subParser('makehtml.hashElement')(text, options, globals));
// Special case for standalone HTML comments
text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
}, '^ {0,3}', 'gm');
// PHP and ASP-style processor instructions (...?> and <%...%>)
text = text.replace(/\n\n( {0,3}<([?%])[^\r]*?\2>[ \t]*(?=\n{2,}))/g,
showdown.subParser('makehtml.hashElement')(text, options, globals));
text = globals.converter._dispatch('makehtml.hashHTMLBlocks.after', text, options, globals).getText();
return text;
});
/**
* Hash span elements that should not be parsed as markdown
*/
showdown.subParser('makehtml.hashHTMLSpans', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashHTMLSpans.before', text, options, globals).getText();
// Hash Self Closing tags
text = text.replace(/<[^>]+?\/>/gi, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
// Hash tags without properties
text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
// Hash tags with properties
text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
// Hash self closing tags without />
text = text.replace(/<[^>]+?>/gi, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
text = globals.converter._dispatch('makehtml.hashHTMLSpans.after', text, options, globals).getText();
return text;
});
/**
* Unhash HTML spans
*/
showdown.subParser('makehtml.unhashHTMLSpans', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.unhashHTMLSpans.before', text, options, globals).getText();
for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
var repText = globals.gHtmlSpans[i],
// limiter to prevent infinite loop (assume 10 as limit for recurse)
limit = 0;
while (/¨C(\d+)C/.test(repText)) {
var num = RegExp.$1;
repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
if (limit === 10) {
console.error('maximum nesting of 10 spans reached!!!');
break;
}
++limit;
}
text = text.replace('¨C' + i + 'C', repText);
}
text = globals.converter._dispatch('makehtml.unhashHTMLSpans.after', text, options, globals).getText();
return text;
});
/**
* Hash and escape elements that should not be parsed as markdown
*/
showdown.subParser('makehtml.hashPreCodeTags', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashPreCodeTags.before', text, options, globals).getText();
var repFunc = function (wholeMatch, match, left, right) {
// encode html entities
var codeblock = left + showdown.subParser('makehtml.encodeCode')(match, options, globals) + right;
return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
};
// Hash
text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}]*>\\s*
', 'gim');
text = globals.converter._dispatch('makehtml.hashPreCodeTags.after', text, options, globals).getText();
return text;
});
showdown.subParser('makehtml.headers', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.headers.before', text, options, globals).getText();
var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
// Set text-style headers:
// Header 1
// ========
//
// Header 2
// --------
//
setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
text = text.replace(setextRegexH1, function (wholeMatch, m1) {
var spanGamut = showdown.subParser('makehtml.spanGamut')(m1, options, globals),
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
hLevel = headerLevelStart,
hashBlock = ']*>', '^ {0,3}\\s*
tags.
*
* Any 3 or more unindented consecutive hyphens, asterisks or underscores with or without a space beetween them
* in a single line is considered a horizontal rule
*/
showdown.subParser('makehtml.horizontalRule', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.horizontalRule.before', text, options, globals).getText();
var key = showdown.subParser('makehtml.hashBlock')('
', options, globals);
text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
text = globals.converter._dispatch('makehtml.horizontalRule.after', text, options, globals).getText();
return text;
});
/**
* Turn Markdown image shortcuts into tags.
*/
showdown.subParser('makehtml.images', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.images.before', text, options, globals).getText();
var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
url = url.replace(/\s/g, '');
return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
}
function writeImageTagBaseUrl (wholeMatch, altText, linkId, url, width, height, m5, title) {
url = showdown.helper.applyBaseUrl(options.relativePathBaseUrl, url);
return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
}
function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
var gUrls = globals.gUrls,
gTitles = globals.gTitles,
gDims = globals.gDimensions;
linkId = linkId.toLowerCase();
if (!title) {
title = '';
}
// Special case for explicit empty url
if (wholeMatch.search(/\(\s*>? ?(['"].*['"])?\)$/m) > -1) {
url = '';
} else if (url === '' || url === null) {
if (linkId === '' || linkId === null) {
// lower-case and turn embedded newlines into spaces
linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
}
url = '#' + linkId;
if (!showdown.helper.isUndefined(gUrls[linkId])) {
url = gUrls[linkId];
if (!showdown.helper.isUndefined(gTitles[linkId])) {
title = gTitles[linkId];
}
if (!showdown.helper.isUndefined(gDims[linkId])) {
width = gDims[linkId].width;
height = gDims[linkId].height;
}
} else {
return wholeMatch;
}
}
altText = altText
.replace(/"/g, '"')
//altText = showdown.helper.escapeCharacters(altText, '*_', false);
.replace(showdown.helper.regexes.asteriskDashTildeAndColon, showdown.helper.escapeCharactersCallback);
//url = showdown.helper.escapeCharacters(url, '*_', false);
url = url.replace(showdown.helper.regexes.asteriskDashTildeAndColon, showdown.helper.escapeCharactersCallback);
var result = '
';
return result;
}
// First, handle reference-style labeled images: ![alt text][id]
text = text.replace(referenceRegExp, writeImageTag);
// Next, handle inline images:  {
return showdown.helper._hashHTMLSpan(wholeMatch, globals);
});
// 7. Handle naked links (if option is enabled)
text = showdown.subParser('makehtml.links.naked')(text, options, globals);
text = globals.converter._dispatch(evtRootName + '.end', text, options, globals).getText();
return text;
});
/**
* TODO WRITE THIS DOCUMENTATION
*/
showdown.subParser('makehtml.links.inline', function (text, options, globals) {
var evtRootName = evtRootName + '.inline';
text = globals.converter._dispatch(evtRootName + '.start', text, options, globals).getText();
// 1. Look for empty cases: []() and [empty]() and []("title")
var rgxEmpty = /\[(.*?)]()()()()\( ?>? ?(?:["'](.*)["'])?\)/g;
text = text.replace(rgxEmpty, replaceAnchorTagBaseUrl(rgxEmpty, evtRootName, options, globals, true));
// 2. Look for cases with crazy urls like ./image/cat1).png
var rgxCrazy = /\[((?:\[[^\]]*]|[^\[\]])*)]()\s?\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g;
text = text.replace(rgxCrazy, replaceAnchorTagBaseUrl(rgxCrazy, evtRootName, options, globals));
// 3. inline links with no title or titles wrapped in ' or ":
// [text](url.com) || [text](
// instead of:
//
// So, to prevent it, we will put a marker (¨A)in the beginning of the line
// Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
return '¨A' + wm2;
});
// SPECIAL CASE: a heading followed by a paragraph of text that is not separated by a double newline
// or/nor indented. ex:
//
// - # foo
// bar is great
//
// While this does now follow the spec per se, not allowing for this might cause confusion since
// header blocks don't need double-newlines after
if (/^#+.+\n.+/.test(item)) {
item = item.replace(/^(#+.+)$/m, '$1\n');
}
// m1 - Leading line or
// Has a double return (multi paragraph)
if (m1 || (item.search(/\n{2,}/) > -1)) {
item = showdown.subParser('makehtml.githubCodeBlocks')(item, options, globals);
item = showdown.subParser('makehtml.blockQuotes')(item, options, globals);
item = showdown.subParser('makehtml.headers')(item, options, globals);
item = showdown.subParser('makehtml.lists')(item, options, globals);
item = showdown.subParser('makehtml.codeBlocks')(item, options, globals);
item = showdown.subParser('makehtml.tables')(item, options, globals);
item = showdown.subParser('makehtml.hashHTMLBlocks')(item, options, globals);
//item = showdown.subParser('makehtml.paragraphs')(item, options, globals);
// TODO: This is a copy of the paragraph parser
// This is a provisory fix for issue #494
// For a permanente fix we need to rewrite the paragraph parser, passing the unhashify logic outside
// so that we can call the paragraph parser without accidently unashifying previously parsed blocks
// Strip leading and trailing lines:
item = item.replace(/^\n+/g, '');
item = item.replace(/\n+$/g, '');
var grafs = item.split(/\n{2,}/g),
grafsOut = [],
end = grafs.length; // Wrap ]*>\s*
]*>/.test(grafsOutIt)) {
codeFlag = true;
}
}
grafsOut[i] = grafsOutIt;
}
text = grafsOut.join('\n');
// Strip leading and trailing lines:
text = text.replace(/^\n+/g, '');
text = text.replace(/\n+$/g, '');
return globals.converter._dispatch('makehtml.paragraphs.after', text, options, globals).getText();
});
/**
* Run extension
*/
showdown.subParser('makehtml.runExtension', function (ext, text, options, globals) {
'use strict';
if (ext.filter) {
text = ext.filter(text, globals.converter, options);
} else if (ext.regex) {
// TODO remove this when old extension loading mechanism is deprecated
var re = ext.regex;
if (!(re instanceof RegExp)) {
re = new RegExp(re, 'g');
}
text = text.replace(re, ext.replace);
}
return text;
});
/**
* These are all the transformations that occur *within* block-level
* tags like paragraphs, headers, and list items.
*/
showdown.subParser('makehtml.spanGamut', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.span.before', text, options, globals).getText();
text = showdown.subParser('makehtml.codeSpans')(text, options, globals);
text = showdown.subParser('makehtml.escapeSpecialCharsWithinTagAttributes')(text, options, globals);
text = showdown.subParser('makehtml.encodeBackslashEscapes')(text, options, globals);
// Process link and image tags. Images must come first,
// because ![foo][f] looks like a link.
text = showdown.subParser('makehtml.images')(text, options, globals);
text = globals.converter._dispatch('smakehtml.links.before', text, options, globals).getText();
text = showdown.subParser('makehtml.links')(text, options, globals);
text = globals.converter._dispatch('smakehtml.links.after', text, options, globals).getText();
//text = showdown.subParser('makehtml.autoLinks')(text, options, globals);
//text = showdown.subParser('makehtml.simplifiedAutoLinks')(text, options, globals);
text = showdown.subParser('makehtml.emoji')(text, options, globals);
text = showdown.subParser('makehtml.underline')(text, options, globals);
text = showdown.subParser('makehtml.italicsAndBold')(text, options, globals);
text = showdown.subParser('makehtml.strikethrough')(text, options, globals);
text = showdown.subParser('makehtml.ellipsis')(text, options, globals);
// we need to hash HTML tags inside spans
text = showdown.subParser('makehtml.hashHTMLSpans')(text, options, globals);
// now we encode amps and angles
text = showdown.subParser('makehtml.encodeAmpsAndAngles')(text, options, globals);
// Do hard breaks
if (options.simpleLineBreaks) {
// GFM style hard breaks
// only add line breaks if the text does not contain a block (special case for lists)
if (!/\n\n¨K/.test(text)) {
text = text.replace(/\n+/g, '
\n');
}
} else {
// Vanilla hard breaks
text = text.replace(/ +\n/g, '
\n');
}
text = globals.converter._dispatch('makehtml.spanGamut.after', text, options, globals).getText();
return text;
});
showdown.subParser('makehtml.strikethrough', function (text, options, globals) {
'use strict';
if (options.strikethrough) {
text = globals.converter._dispatch('makehtml.strikethrough.before', text, options, globals).getText();
text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return '' + txt + ''; });
text = globals.converter._dispatch('makehtml.strikethrough.after', text, options, globals).getText();
}
return text;
});
/**
* Strips link definitions from text, stores the URLs and titles in
* hash references.
* Link defs are in the form: ^[id]: url "optional title"
*/
showdown.subParser('makehtml.stripLinkDefinitions', function (text, options, globals) {
'use strict';
var regex = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,
base64Regex = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
text += '¨0';
var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
// if there aren't two instances of linkId it must not be a reference link so back out
linkId = linkId.toLowerCase();
if (text.toLowerCase().split(linkId).length - 1 < 2) {
return wholeMatch;
}
if (url.match(/^data:.+?\/.+?;base64,/)) {
// remove newlines
globals.gUrls[linkId] = url.replace(/\s/g, '');
} else {
url = showdown.helper.applyBaseUrl(options.relativePathBaseUrl, url);
globals.gUrls[linkId] = showdown.subParser('makehtml.encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive
}
if (blankLines) {
// Oops, found blank lines, so it's not a title.
// Put back the parenthetical statement we stole.
return blankLines + title;
} else {
if (title) {
globals.gTitles[linkId] = title.replace(/"|'/g, '"');
}
if (options.parseImgDimensions && width && height) {
globals.gDimensions[linkId] = {
width: width,
height: height
};
}
}
// Completely remove the definition from the text
return '';
};
// first we try to find base64 link references
text = text.replace(base64Regex, replaceFunc);
text = text.replace(regex, replaceFunc);
// attacklab: strip sentinel
text = text.replace(/¨0/, '');
return text;
});
showdown.subParser('makehtml.tables', function (text, options, globals) {
'use strict';
if (!options.tables) {
return text;
}
var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*[-=]{2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*[-=]{2,}[\s\S]+?(?:\n\n|¨0)/gm,
//singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*[-=]{2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
function parseStyles (sLine) {
if (/^:[ \t]*--*$/.test(sLine)) {
return ' style="text-align:left;"';
} else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
return ' style="text-align:right;"';
} else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
return ' style="text-align:center;"';
} else {
return '';
}
}
function parseHeaders (header, style) {
var id = '';
header = header.trim();
// support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility
if (options.tablesHeaderId || options.tableHeaderId) {
id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
}
header = showdown.subParser('makehtml.spanGamut')(header, options, globals);
return '' + header + ' \n';
}
function parseCells (cell, style) {
var subText = showdown.subParser('makehtml.spanGamut')(cell, options, globals);
return '' + subText + ' \n';
}
function buildTable (headers, cells) {
var tb = '\n\n
\n';
return tb;
}
function parseTable (rawTable) {
var i, tableLines = rawTable.split('\n');
for (i = 0; i < tableLines.length; ++i) {
// strip wrong first and last column if wrapped tables are used
if (/^ {0,3}\|/.test(tableLines[i])) {
tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
}
if (/\|[ \t]*$/.test(tableLines[i])) {
tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
}
// parse code spans first, but we only support one line code spans
tableLines[i] = showdown.subParser('makehtml.codeSpans')(tableLines[i], options, globals);
}
var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
rawCells = [],
headers = [],
styles = [],
cells = [];
tableLines.shift();
tableLines.shift();
for (i = 0; i < tableLines.length; ++i) {
if (tableLines[i].trim() === '') {
continue;
}
rawCells.push(
tableLines[i]
.split('|')
.map(function (s) {
return s.trim();
})
);
}
if (rawHeaders.length < rawStyles.length) {
return rawTable;
}
for (i = 0; i < rawStyles.length; ++i) {
styles.push(parseStyles(rawStyles[i]));
}
for (i = 0; i < rawHeaders.length; ++i) {
if (showdown.helper.isUndefined(styles[i])) {
styles[i] = '';
}
headers.push(parseHeaders(rawHeaders[i], styles[i]));
}
for (i = 0; i < rawCells.length; ++i) {
var row = [];
for (var ii = 0; ii < headers.length; ++ii) {
if (showdown.helper.isUndefined(rawCells[i][ii])) {
}
row.push(parseCells(rawCells[i][ii], styles[ii]));
}
cells.push(row);
}
return buildTable(headers, cells);
}
text = globals.converter._dispatch('makehtml.tables.before', text, options, globals).getText();
// find escaped pipe characters
text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
// parse multi column tables
text = text.replace(tableRgx, parseTable);
// parse one column tables
text = text.replace(singeColTblRgx, parseTable);
text = globals.converter._dispatch('makehtml.tables.after', text, options, globals).getText();
return text;
});
showdown.subParser('makehtml.underline', function (text, options, globals) {
'use strict';
if (!options.underline) {
return text;
}
text = globals.converter._dispatch('makehtml.underline.before', text, options, globals).getText();
if (options.literalMidWordUnderscores) {
text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
return '' + txt + '';
});
text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
return '' + txt + '';
});
} else {
text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
return (/\S$/.test(m)) ? '' + m + '' : wm;
});
text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
return (/\S$/.test(m)) ? '' + m + '' : wm;
});
}
// escape remaining underscores to prevent them being parsed by italic and bold
text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);
text = globals.converter._dispatch('makehtml.underline.after', text, options, globals).getText();
return text;
});
/**
* Swap back in all the special characters we've hidden.
*/
showdown.subParser('makehtml.unescapeSpecialChars', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.unescapeSpecialChars.before', text, options, globals).getText();
text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
var charCodeToReplace = parseInt(m1);
return String.fromCharCode(charCodeToReplace);
});
text = globals.converter._dispatch('makehtml.unescapeSpecialChars.after', text, options, globals).getText();
return text;
});
showdown.subParser('makeMarkdown.blockquote', function (node, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);
if (innerTxt === '') {
continue;
}
txt += innerTxt;
}
}
// cleanup
txt = txt.trim();
txt = '> ' + txt.split('\n').join('\n> ');
return txt;
});
showdown.subParser('makeMarkdown.break', function () {
'use strict';
return ' \n';
});
showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {
'use strict';
var lang = node.getAttribute('language'),
num = node.getAttribute('precodenum');
return '```' + lang + '\n' + globals.preList[num] + '\n```';
});
showdown.subParser('makeMarkdown.codeSpan', function (node) {
'use strict';
return '`' + node.innerHTML + '`';
});
showdown.subParser('makeMarkdown.emphasis', function (node, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
txt += '*';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
txt += '*';
}
return txt;
});
showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {
'use strict';
var headerMark = new Array(headerLevel + 1).join('#'),
txt = '';
if (node.hasChildNodes()) {
txt = headerMark + ' ';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
}
return txt;
});
showdown.subParser('makeMarkdown.hr', function () {
'use strict';
return '---';
});
showdown.subParser('makeMarkdown.image', function (node) {
'use strict';
var txt = '';
if (node.hasAttribute('src')) {
txt += ' + '>';
if (node.hasAttribute('width') && node.hasAttribute('height')) {
txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');
}
if (node.hasAttribute('title')) {
txt += ' "' + node.getAttribute('title') + '"';
}
txt += ')';
}
return txt;
});
showdown.subParser('makeMarkdown.input', function (node, globals) {
'use strict';
var txt = '';
if (node.getAttribute('checked') !== null) {
txt += '[x]';
} else {
txt += '[ ]';
}
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
return txt;
});
showdown.subParser('makeMarkdown.links', function (node, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes() && node.hasAttribute('href')) {
var children = node.childNodes,
childrenLength = children.length;
txt = '[';
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
txt += '](';
txt += '<' + node.getAttribute('href') + '>';
if (node.hasAttribute('title')) {
txt += ' "' + node.getAttribute('title') + '"';
}
txt += ')';
}
return txt;
});
showdown.subParser('makeMarkdown.list', function (node, globals, type) {
'use strict';
var txt = '';
if (!node.hasChildNodes()) {
return '';
}
var listItems = node.childNodes,
listItemsLenght = listItems.length,
listNum = node.getAttribute('start') || 1;
for (var i = 0; i < listItemsLenght; ++i) {
if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {
continue;
}
// define the bullet to use in list
var bullet = '';
if (type === 'ol') {
bullet = listNum.toString() + '. ';
} else {
bullet = '- ';
}
// parse list item
txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);
++listNum;
}
return txt.trim();
});
showdown.subParser('makeMarkdown.listItem', function (node, globals) {
'use strict';
var listItemTxt = '';
var children = node.childNodes,
childrenLenght = children.length;
for (var i = 0; i < childrenLenght; ++i) {
listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
// if it's only one liner, we need to add a newline at the end
if (!/\n$/.test(listItemTxt)) {
listItemTxt += '\n';
} else {
// it's multiparagraph, so we need to indent
listItemTxt = listItemTxt
.split('\n')
.join('\n ')
.replace(/^ {4}$/gm, '')
.replace(/\n\n+/g, '\n\n');
}
return listItemTxt;
});
showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {
'use strict';
spansOnly = spansOnly || false;
var txt = '';
// edge case of text without wrapper paragraph
if (node.nodeType === 3) {
return showdown.subParser('makeMarkdown.txt')(node, globals);
}
// HTML comment
if (node.nodeType === 8) {
return '\n\n';
}
// process only node elements
if (node.nodeType !== 1) {
return '';
}
var tagName = node.tagName.toLowerCase();
switch (tagName) {
//
// BLOCKS
//
case 'h1':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\n\n'; }
break;
case 'h2':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\n\n'; }
break;
case 'h3':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\n\n'; }
break;
case 'h4':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\n\n'; }
break;
case 'h5':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\n\n'; }
break;
case 'h6':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\n\n'; }
break;
case 'p':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\n\n'; }
break;
case 'blockquote':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\n\n'; }
break;
case 'hr':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\n\n'; }
break;
case 'ol':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\n\n'; }
break;
case 'ul':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\n\n'; }
break;
case 'precode':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\n\n'; }
break;
case 'pre':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\n\n'; }
break;
case 'table':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\n\n'; }
break;
//
// SPANS
//
case 'code':
txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);
break;
case 'em':
case 'i':
txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);
break;
case 'strong':
case 'b':
txt = showdown.subParser('makeMarkdown.strong')(node, globals);
break;
case 'del':
txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);
break;
case 'a':
txt = showdown.subParser('makeMarkdown.links')(node, globals);
break;
case 'img':
txt = showdown.subParser('makeMarkdown.image')(node, globals);
break;
case 'br':
txt = showdown.subParser('makeMarkdown.break')(node, globals);
break;
case 'input':
txt = showdown.subParser('makeMarkdown.input')(node, globals);
break;
default:
txt = node.outerHTML + '\n\n';
}
// common normalization
// TODO eventually
return txt;
});
showdown.subParser('makeMarkdown.paragraph', function (node, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
}
// some text normalization
txt = txt.trim();
return txt;
});
showdown.subParser('makeMarkdown.pre', function (node, globals) {
'use strict';
var num = node.getAttribute('prenum');
return '\n',
tblLgn = headers.length;
for (var i = 0; i < tblLgn; ++i) {
tb += headers[i];
}
tb += ' \n\n\n';
for (i = 0; i < cells.length; ++i) {
tb += '\n';
for (var ii = 0; ii < tblLgn; ++ii) {
tb += cells[i][ii];
}
tb += ' \n';
}
tb += '\n' + globals.preList[num] + '
';
});
showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
txt += '~~';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
txt += '~~';
}
return txt;
});
showdown.subParser('makeMarkdown.strong', function (node, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
txt += '**';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
}
txt += '**';
}
return txt;
});
showdown.subParser('makeMarkdown.table', function (node, globals) {
'use strict';
var txt = '',
tableArray = [[], []],
headings = node.querySelectorAll('thead>tr>th'),
rows = node.querySelectorAll('tbody>tr'),
i, ii;
for (i = 0; i < headings.length; ++i) {
var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),
allign = '---';
if (headings[i].hasAttribute('style')) {
var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, '');
switch (style) {
case 'text-align:left;':
allign = ':---';
break;
case 'text-align:right;':
allign = '---:';
break;
case 'text-align:center;':
allign = ':---:';
break;
}
}
tableArray[0][i] = headContent.trim();
tableArray[1][i] = allign;
}
for (i = 0; i < rows.length; ++i) {
var r = tableArray.push([]) - 1,
cols = rows[i].getElementsByTagName('td');
for (ii = 0; ii < headings.length; ++ii) {
var cellContent = ' ';
if (typeof cols[ii] !== 'undefined') {
cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);
}
tableArray[r].push(cellContent);
}
}
var cellSpacesCount = 3;
for (i = 0; i < tableArray.length; ++i) {
for (ii = 0; ii < tableArray[i].length; ++ii) {
var strLen = tableArray[i][ii].length;
if (strLen > cellSpacesCount) {
cellSpacesCount = strLen;
}
}
}
for (i = 0; i < tableArray.length; ++i) {
for (ii = 0; ii < tableArray[i].length; ++ii) {
if (i === 1) {
if (tableArray[i][ii].slice(-1) === ':') {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(0, -1), cellSpacesCount - 1, '-') + ':';
} else {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
}
} else {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
}
}
txt += '| ' + tableArray[i].join(' | ') + ' |\n';
}
return txt.trim();
});
showdown.subParser('makeMarkdown.tableCell', function (node, globals) {
'use strict';
var txt = '';
if (!node.hasChildNodes()) {
return '';
}
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);
}
return txt.trim();
});
showdown.subParser('makeMarkdown.txt', function (node) {
'use strict';
var txt = node.nodeValue;
// multiple spaces are collapsed
txt = txt.replace(/ +/g, ' ');
// replace the custom ¨NBSP; with a space
txt = txt.replace(/¨NBSP;/g, ' ');
// ", <, > and & should replace escaped html entities
txt = showdown.helper.unescapeHTMLEntities(txt);
// escape markdown magic characters
// emphasis, strong and strikethrough - can appear everywhere
// we also escape pipe (|) because of tables
// and escape ` because of code blocks and spans
txt = txt.replace(/([*_~|`])/g, '\\$1');
// escape > because of blockquotes
txt = txt.replace(/^(\s*)>/g, '\\$1>');
// hash character, only troublesome at the beginning of a line because of headers
txt = txt.replace(/^#/gm, '\\#');
// horizontal rules
txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
// dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
// +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
// images and links, ] followed by ( is problematic, so we escape it
txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
// reference URIs must also be escaped
txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
return txt;
});
/**
* Created by Estevao on 31-05-2015.
*/
/**
* Showdown Converter class
* @class
* @param {object} [converterOptions]
* @returns {Converter}
*/
showdown.Converter = function (converterOptions) {
'use strict';
var
/**
* Options used by this converter
* @private
* @type {{}}
*/
options = {},
/**
* Language extensions used by this converter
* @private
* @type {Array}
*/
langExtensions = [],
/**
* Output modifiers extensions used by this converter
* @private
* @type {Array}
*/
outputModifiers = [],
/**
* Event listeners
* @private
* @type {{}}
*/
listeners = {},
/**
* The flavor set in this converter
*/
setConvFlavor = setFlavor,
/**
* Metadata of the document
* @type {{parsed: {}, raw: string, format: string}}
*/
metadata = {
parsed: {},
raw: '',
format: ''
};
_constructor();
/**
* Converter constructor
* @private
*/
function _constructor () {
converterOptions = converterOptions || {};
for (var gOpt in globalOptions) {
if (globalOptions.hasOwnProperty(gOpt)) {
options[gOpt] = globalOptions[gOpt];
}
}
// Merge options
if (typeof converterOptions === 'object') {
for (var opt in converterOptions) {
if (converterOptions.hasOwnProperty(opt)) {
options[opt] = converterOptions[opt];
}
}
} else {
throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
' was passed instead.');
}
if (options.extensions) {
showdown.helper.forEach(options.extensions, _parseExtension);
}
}
/**
* Parse extension
* @param {*} ext
* @param {string} [name='']
* @private
*/
function _parseExtension (ext, name) {
name = name || null;
// If it's a string, the extension was previously loaded
if (showdown.helper.isString(ext)) {
ext = showdown.helper.stdExtName(ext);
name = ext;
// LEGACY_SUPPORT CODE
if (showdown.extensions[ext]) {
console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +
'Please inform the developer that the extension should be updated!');
legacyExtensionLoading(showdown.extensions[ext], ext);
return;
// END LEGACY SUPPORT CODE
} else if (!showdown.helper.isUndefined(extensions[ext])) {
ext = extensions[ext];
} else {
throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
}
}
if (typeof ext === 'function') {
ext = ext();
}
if (!showdown.helper.isArray(ext)) {
ext = [ext];
}
var validExt = validate(ext, name);
if (!validExt.valid) {
throw Error(validExt.error);
}
for (var i = 0; i < ext.length; ++i) {
switch (ext[i].type) {
case 'lang':
langExtensions.push(ext[i]);
break;
case 'output':
outputModifiers.push(ext[i]);
break;
}
if (ext[i].hasOwnProperty('listeners')) {
for (var ln in ext[i].listeners) {
if (ext[i].listeners.hasOwnProperty(ln)) {
listen(ln, ext[i].listeners[ln]);
}
}
}
}
}
/**
* LEGACY_SUPPORT
* @param {*} ext
* @param {string} name
*/
function legacyExtensionLoading (ext, name) {
if (typeof ext === 'function') {
ext = ext(new showdown.Converter());
}
if (!showdown.helper.isArray(ext)) {
ext = [ext];
}
var valid = validate(ext, name);
if (!valid.valid) {
throw Error(valid.error);
}
for (var i = 0; i < ext.length; ++i) {
switch (ext[i].type) {
case 'lang':
langExtensions.push(ext[i]);
break;
case 'output':
outputModifiers.push(ext[i]);
break;
default:// should never reach here
throw Error('Extension loader error: Type unrecognized!!!');
}
}
}
/**
* Listen to an event
* @param {string} name
* @param {function} callback
*/
function listen (name, callback) {
if (!showdown.helper.isString(name)) {
throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
}
if (typeof callback !== 'function') {
throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
}
name = name.toLowerCase();
if (!listeners.hasOwnProperty(name)) {
listeners[name] = [];
}
listeners[name].push(callback);
}
function rTrimInputText (text) {
var rsp = text.match(/^\s*/)[0].length,
rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm');
return text.replace(rgx, '');
}
/**
*
* @param {string} evtName Event name
* @param {string} text Text
* @param {{}} options Converter Options
* @param {{}} globals Converter globals
* @param {{}} [pParams] extra params for event
* @returns showdown.helper.Event
* @private
*/
this._dispatch = function dispatch (evtName, text, options, globals, pParams) {
evtName = evtName.toLowerCase();
var params = pParams || {};
params.converter = this;
params.text = text;
params.options = options;
params.globals = globals;
var event = new showdown.helper.Event(evtName, text, params);
if (listeners.hasOwnProperty(evtName)) {
for (var ei = 0; ei < listeners[evtName].length; ++ei) {
var nText = listeners[evtName][ei](event);
if (nText && typeof nText !== 'undefined') {
event.setText(nText);
}
}
}
return event;
};
/**
* Listen to an event
* @param {string} name
* @param {function} callback
* @returns {showdown.Converter}
*/
this.listen = function (name, callback) {
listen(name, callback);
return this;
};
/**
* Converts a markdown string into HTML string
* @param {string} text
* @returns {*}
*/
this.makeHtml = function (text) {
//check if text is not falsy
if (!text) {
return text;
}
var globals = {
gHtmlBlocks: [],
gHtmlMdBlocks: [],
gHtmlSpans: [],
gUrls: {},
gTitles: {},
gDimensions: {},
gListLevel: 0,
hashLinkCounts: {},
langExtensions: langExtensions,
outputModifiers: outputModifiers,
converter: this,
ghCodeBlocks: [],
metadata: {
parsed: {},
raw: '',
format: ''
}
};
// This lets us use ¨ trema as an escape char to avoid md5 hashes
// The choice of character is arbitrary; anything that isn't
// magic in Markdown will work.
text = text.replace(/¨/g, '¨T');
// Replace $ with ¨D
// RegExp interprets $ as a special character
// when it's in a replacement string
text = text.replace(/\$/g, '¨D');
// Standardize line endings
text = text.replace(/\r\n/g, '\n'); // DOS to Unix
text = text.replace(/\r/g, '\n'); // Mac to Unix
// Stardardize line spaces
text = text.replace(/\u00A0/g, ' ');
if (options.smartIndentationFix) {
text = rTrimInputText(text);
}
// Make sure text begins and ends with a couple of newlines:
text = '\n\n' + text + '\n\n';
// detab
text = showdown.subParser('makehtml.detab')(text, options, globals);
/**
* Strip any lines consisting only of spaces and tabs.
* This makes subsequent regexs easier to write, because we can
* match consecutive blank lines with /\n+/ instead of something
* contorted like /[ \t]*\n+/
*/
text = text.replace(/^[ \t]+$/mg, '');
//run languageExtensions
showdown.helper.forEach(langExtensions, function (ext) {
text = showdown.subParser('makehtml.runExtension')(ext, text, options, globals);
});
// run the sub parsers
text = showdown.subParser('makehtml.metadata')(text, options, globals);
text = showdown.subParser('makehtml.hashPreCodeTags')(text, options, globals);
text = showdown.subParser('makehtml.githubCodeBlocks')(text, options, globals);
text = showdown.subParser('makehtml.hashHTMLBlocks')(text, options, globals);
text = showdown.subParser('makehtml.hashCodeTags')(text, options, globals);
text = showdown.subParser('makehtml.stripLinkDefinitions')(text, options, globals);
text = showdown.subParser('makehtml.blockGamut')(text, options, globals);
text = showdown.subParser('makehtml.unhashHTMLSpans')(text, options, globals);
text = showdown.subParser('makehtml.unescapeSpecialChars')(text, options, globals);
// attacklab: Restore dollar signs
text = text.replace(/¨D/g, '$$');
// attacklab: Restore tremas
text = text.replace(/¨T/g, '¨');
// render a complete html document instead of a partial if the option is enabled
text = showdown.subParser('makehtml.completeHTMLDocument')(text, options, globals);
// Run output modifiers
showdown.helper.forEach(outputModifiers, function (ext) {
text = showdown.subParser('makehtml.runExtension')(ext, text, options, globals);
});
// update metadata
metadata = globals.metadata;
return text;
};
/**
* Converts an HTML string into a markdown string
* @param src
* @returns {string}
*/
this.makeMarkdown = function (src) {
// replace \r\n with \n
src = src.replace(/\r\n/g, '\n');
src = src.replace(/\r/g, '\n'); // old macs
// due to an edge case, we need to find this: > <
// to prevent removing of non silent white spaces
// ex: this is sparta
src = src.replace(/>[ \t]+, '>¨NBSP;<');
var doc = showdown.helper.document.createElement('div');
doc.innerHTML = src;
var globals = {
preList: substitutePreCodeTags(doc)
};
// remove all newlines and collapse spaces
clean(doc);
// some stuff, like accidental reference links must now be escaped
// TODO
// doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/);
var nodes = doc.childNodes,
mdDoc = '';
for (var i = 0; i < nodes.length; i++) {
mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);
}
function clean (node) {
for (var n = 0; n < node.childNodes.length; ++n) {
var child = node.childNodes[n];
if (child.nodeType === 3) {
if (!/\S/.test(child.nodeValue) && !/^[ ]+$/.test(child.nodeValue)) {
node.removeChild(child);
--n;
} else {
child.nodeValue = child.nodeValue.split('\n').join(' ');
child.nodeValue = child.nodeValue.replace(/(\s)+/g, '$1');
}
} else if (child.nodeType === 1) {
clean(child);
}
}
}
// find all pre tags and replace contents with placeholder
// we need this so that we can remove all indentation from html
// to ease up parsing
function substitutePreCodeTags (doc) {
var pres = doc.querySelectorAll('pre'),
presPH = [];
for (var i = 0; i < pres.length; ++i) {
if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {
var content = pres[i].firstChild.innerHTML.trim(),
language = pres[i].firstChild.getAttribute('data-language') || '';
// if data-language attribute is not defined, then we look for class language-*
if (language === '') {
var classes = pres[i].firstChild.className.split(' ');
for (var c = 0; c < classes.length; ++c) {
var matches = classes[c].match(/^language-(.+)$/);
if (matches !== null) {
language = matches[1];
break;
}
}
}
// unescape html entities in content
content = showdown.helper.unescapeHTMLEntities(content);
presPH.push(content);
pres[i].outerHTML = 'This is a heading
```
!!! hint ""
For better readability and human-friendliness of the heading IDs, it is also recommended to set the [`ghCompatibleHeaderId`](#ghcompatibleheaderid) option to `true`.
### disableForced4SpacesIndentedSublists
Disable the rule of 4 spaces to indent sub-lists. If enabled, this option effectively reverts to the old behavior where you can indent sub-lists with 2 or 3 spaces.
* type: `boolean`
* default value: `false`
* introduced in: `1.5.0`
=== "input"
```
- one
- two
...
- one
- two
```
=== "output (value is `false`)"
```html
```
=== "output (value is `true`)"
```html
```
### emoji
Enable emoji support. For more info on available emojis, see https://github.com/showdownjs/showdown/wiki/Emojis (since v.1.8.0)
* type: `boolean`
* default value: `false`
* introduced in: `1.8.0`
=== "input"
```
this is a :smile: emoji
```
=== "output (value is `false`)"
```html
This is a heading
```
=== "output (value is `true`)"
```html
This is a heading with @#$%
```
### ghMentions
Enables support for GitHub `@mentions` that allows you to link to the GitHub profile page of the mentioned username.
* type: `boolean`
* default value: `false`
* introduced in: `1.6.0`
=== "input"
```
hello there @tivie
```
=== "output (value is `false`)"
```html
This is a heading
```
=== "output (value is `3`)"
```html
This is a heading
```
### literalMidWordUnderscores
Treat underscores in the middle of words as literal characters.
Underscores allow you to specify the words that should be emphasized. However, in some cases, this may be unwanted behavior. With this option enabled, underscores in the middle of words will no longer be interpreted as `` and ``, but as literal underscores.
* type: `boolean`
* default value: `false`
* introduced in: `1.2.0`
=== "input"
```
some text with__underscores__in the middle
```
=== "output (value is `false`)"
```html
This is a heading
```
=== "output (value is `true`)"
```html
This is a heading
```
### omitExtraWLInCodeBlocks
Omit trailing newline in code blocks (which is set by default before the closing tag). This option affects both indented and fenced (gfm style) code blocks.
* type: `boolean`
* default value: `false`
* introduced in: `1.0.0`
=== "input"
```
var foo = 'bar';
```
=== "output (value is `false`)"
```html
```
=== "output (value is `true`)"
```html
var foo = 'bar';
```
### openLinksInNewWindow
Open links in new windows.
* type: `boolean`
* default value: `false`
* introduced in: `1.7.0`
=== "input"
```
[link](https://google.com)
```
=== "output (value is `false`)"
```html
link
```
=== "output (value is `true`)"
```html
link
```
### parseImgDimensions
Set image dimensions from within Markdown syntax.
* type: `boolean`
* default value: `false`
* introduced in: `1.1.0`
=== "example"
```
 set width to 100px and height to 80px
 set width to 100px and height to "auto"
 set width to 80% and height to 5em
```
### prefixHeaderId
Add a prefix to the generated heading ID:
* Passing a string will add that string to the heading ID.
* Passing `true` will add a generic `section` prefix.
!!! warning ""
This option can be overridden with the [`noHeaderId`](#noheaderid) option.
* type: `string / boolean`
* default value: `false`
=== "input"
```
# This is a heading
```
=== "output (value is `false`)"
```html
var foo = 'bar';
This is a heading
```
=== "output (value is `true`)"
```html
This is a heading
```
=== "output (value is `showdown`)"
```html
This is a heading
```
### rawHeaderId
Replace ` ` (space), `'` (single quote), and `"` (double quote) with `-` (dash) in the generated heading IDs, including prefixes.
!!! danger ""
**Use with caution** as it might result in malformed IDs.
* type:
* default value:
* introduced in: `1.7.3`
### rawPrefixHeaderId
Prevent Showndown from modifying the prefix. Works only when [`prefixHeaderId`](#prefixheaderid) is set to a string value.
!!! danger ""
**Use with caution** as it might result in malformed IDs. For example, when the prefix contains special characters like `"` `\` `/` or others.
* type: `boolean`
* default value: `false`
* introduced in: `1.7.3`
### requireSpaceBeforeHeadingText
Require a space between a heading `#` and the heading text.
* type: `boolean`
* default value: `false`
* introduced in: `1.5.3`
=== "input"
```
#heading
```
=== "output (value is `false`)"
```html
heading
```
=== "output (value is `true`)"
```html
` in paragraphs (GitHub-style behavior).
* type: `boolean`
* default value: `false`
* introduced in: `1.5.1`
=== "input"
```
a line
wrapped in two
```
=== "output (value is `false`)"
```html
wrapped in two
```
=== "output (value is `true`)"
```html
```
### strikethrough
Enable support for strikethrough (`
`).
* type: `boolean`
* default value: `false`
* introduced in: `1.2.0`
=== "input"
```
~~strikethrough~~
```
=== "output (value is `true`)"
```html
strikethrough
```
### tables
Enable support for tables syntax.
* type: `boolean`
* default value: `false`
* introduced in: `1.2.0`
=== "example"
```
| h1 | h2 | h3 |
|:------|:-------:|--------:|
| 100 | [a][1] | ![b][2] |
| *foo* | **bar** | ~~baz~~ |
```
### tablesHeaderId
Generate automatic IDs for table headings. Works only when [`tables: true`](#tables).
* type: `boolean`
* default value: `false`
* introduced in: `1.2.0`
### tasklists
Enable support for GitHub style tasklists.
* type: `boolean`
* default value: `false`
* introduced in: `1.2.0`
=== "example"
```
- [x] This task is done
- [ ] This task is still pending
```
### underline
Enable support for underline. If enabled, underscores will no longer be parsed as `` and ``.
* type: `boolean`
* default value: `false`
* status: `Experimental`
=== "example"
```
__underlined word__ // double underscores
___underlined word___ // triple underscores
```
================================================
FILE: docs/cli.md
================================================
Showdown comes bundled with a Command-line interface (CLI) tool that allows you to run Showdown converter from the command line.
## Requirements
* [Node.js](https://nodejs.org/en/)
## Quick start guide
1. Check that Showdown CLI is accessible.
* If you installed Showdown globally via `npm install showdown -g`, you can access the CLI tool help by typing `showdown -h` in the command line:
=== "input"
```sh
showdown -h
```
=== "output"
```
Usage: showdown
Firefox 1.5 and 2.0
*
Chrome 12.0
*
Internet Explorer 6 and 7
*
Safari 2.0.4
*
Opera 8.54 and 9.10
*
Netscape 8.1.2
* Konqueror 3.5.4
Generally, Showdown should work in any browser that supports ECMA 262 3rd Edition (JavaScript 1.5).
The converter might even work in things that aren't web browsers, like Acrobat. However, no promises.
## Node.js
Showdown is intended to work on any supported Node.js version (see the [Node.js releases schedule](https://nodejs.org/en/about/releases/).
Previous versions may also be supported, but no accomodations are made to ensure this.
================================================
FILE: docs/configuration.md
================================================
You can change Showdown's default behavior via options.
## Set option
### Globally
Setting an option globally affects all Showdown instances.
```js
showdown.setOption('optionKey', 'value');
```
### Locally
Setting an option locally affects the specified Converter object only. You can set local options via:
=== "Constructor"
```js
var converter = new showdown.Converter({optionKey: 'value'});
```
=== "setOption() method"
```js
var converter = new showdown.Converter();
converter.setOption('optionKey', 'value');
```
## Get option
Showdown provides both local and global methods to retrieve previously set options:
=== "getOption()"
```js
// Global
var myOption = showdown.getOption('optionKey');
//Local
var myOption = converter.getOption('optionKey');
```
=== "getOptions()"
```js
// Global
var showdownGlobalOptions = showdown.getOptions();
//Local
var thisConverterSpecificOptions = converter.getOptions();
```
### Get default options
You can get Showdown's default options with:
```js
var defaultOptions = showdown.getDefaultOptions();
```
================================================
FILE: docs/create-extension.md
================================================
A Showdown extension is a function that returns an array of language or outputs extensions (henceforth called "sub-extensions").
```js
var myext = function () {
var myext1 = {
type: 'lang',
regex: /markdown/g,
replace: 'showdown'
};
var myext2 = {
/* extension code */
};
return [myext1, myext2];
}
```
Each sub-extension (`myext1` and `myext2` in the example above) should be an object that defines the behavior of the corresponding sub-extension.
## Sub-extension object properties
A sub-extension object should have a [`type` property](#type) that defines the type of the sub-extension, and either [`regex` and `replace` properties](#regex-and-replace) or a [`filter` property](#filter).
### Type
**Type** is a **required** property that defines the nature of the corresponding sub-extensions. It takes one of the two values:
* **`lang`**: language extension to add new Markdown syntax to Showdown.
`lang` extensions have the **highest priority** in the subparser order, so they are called after [escaping and normalizing](#escape-and-normalization) the input text and before calling any other subparser (or extension).
!!! example "When to use `lang` type"
For example, if you want the `^^youtube http://www.youtube.com/watch?v=oHg5SJYRHA0` syntax to automatically be rendered as an embedded YouTube video.
* **`output`**: output extension (or modifier) to alter the HTML output generated by Showdown.
`output` extensions have the **lowest priority** in the subparser order, so they are called right before the cleanup step and after calling all other subparsers.
!!! example "When to use `output` type"
For example, if you want the `
` in HTML) to a paragraph,
you can do so by adding 3 space characters to the end of the line.
You can also force every line break in paragraphs to translate to `
` (as Github does) by
enabling the option [**`simpleLineBreaks`**][simpleLineBreaks].
[simpleLineBreaks]: available-options.md#simplelinebreaks
## Headings
### Atx Style
You can create a heading by adding one or more `#` symbols before your heading text. The number of `#` determines the level of the heading. This is similar to [**atx style**][atx].
```md
# The 1st level heading (an tag)
## The 2nd level heading (an
tag)
…
###### The 6th level heading (an
tag)
```
The space between `#` and the heading text is not required but you can make it mandatory by enabling the option [**`requireSpaceBeforeHeadingText`**][requireSpaceBeforeHeadingText].
[requireSpaceBeforeHeadingText]: available-options.md#requirespacebeforeheadingtext
You can wrap the headings in `#`. Both leading and trailing `#` will be removed.
```md
## My Heading ##
```
If, for some reason, you need to keep a leading or trailing `#`, you can either add a space or escape it:
```md
# # My header # #
#\# My Header \# #
```
### Setext style
You can also use [**setext style**][setext] headings, although only two levels are available.
```md
This is an H1
=============
This is an H2
-------------
```
!!! warning ""
There is an awkward effect when a paragraph is followed by a list. This effect appears on some circumstances, in live preview editors.
![awkward effect][]
You can prevent this by enabling the option [**`smoothPreview`**][smoothlivepreview].
[smoothlivepreview]: available-options.md#smoothlivepreview
### Header IDs
Showdown automatically generates bookmark anchors in titles by adding an id property to a heading.
```md
# My cool header with ID
```
```html
My cool header with ID
```
This behavior can be modified with options:
- [**`noHeaderId`**][noHeaderId] disables automatic id generation;
- [**`ghCompatibleHeaderId`**][ghCompatibleHeaderId] generates header ids compatible with github style (spaces are replaced with dashes and a bunch of non alphanumeric chars are removed)
- [**`prefixHeaderId`**][prefixHeaderId] adds a prefix to the generated header ids (either automatic or custom).
- [**`headerLevelStart`**][headerLevelStart] sets the header starting level. For instance, setting this to 3 means that `# header` will be converted to ``.
Read the [README.md][readme] for more info
[noHeaderId]: available-options.md#noheaderid
[ghCompatibleHeaderId]: available-options.md#ghcompatibleheaderid
[prefixHeaderId]: available-options.md#prefixheaderid
[headerLevelStart]: available-options.md#headerlevelstart
## Blockquotes
You can indicate blockquotes with a `>`.
```md
In the words of Abraham Lincoln:
> Pardon my french
```
Blockquotes can have multiple paragraphs and can have other block elements inside.
```md
> A paragraph of text
>
> Another paragraph
>
> - A list
> - with items
```
## Bold and Italic
You can make text bold or italic.
```md
*This text will be italic*
**This text will be bold**
```
Both bold and italic can use either a `*` or an `_` around the text for styling. This allows you to combine both bold and italic if needed.
```md
**Everyone _must_ attend the meeting at 5 o'clock today.**
```
## Strikethrough
With the option [**`strikethrough`**][] enabled, Showdown supports strikethrough elements.
The syntax is the same as GFM, that is, by adding two tilde (`~~`) characters around
a word or groups of words.
```md
a ~~strikethrough~~ element
```
a
strikethrough element
[strikethrough]: available-options.md#strikethrough
## Emojis
Since version 1.8.0, Showdown supports Github's emojis. A complete list of available emojis can be found [here][emoji list].
```md
this is a :smile: smile emoji
```
this is a :smile: smile emoji
## Code formatting
### Inline formats
Use single backticks (`) to format text in a special monospace format. Everything within the backticks appear as-is, with no other special formatting.
```md
Here's an idea: why don't we take `SuperiorProject` and turn it into `**Reasonable**Project`.
```
```html
SuperiorProject and turn it into **Reasonable**Project.``` to format text as its own distinct block.
Check out this neat program I wrote:
```
x = 0
x = 2 + 2
what is x
```
[ghCodeBlocks]: available-options.md#ghcodeblocks
## Lists
Showdown supports unordered (bulleted) and ordered (numbered) lists.
### Unordered lists
You can make an unordered list by preceding list items with either `*`, `-`, or `+`. Markers are interchangeable too.
```md
* Item
+ Item
- Item
```
### Ordered lists
You can make an ordered list by preceding list items with a number.
```md
1. Item 1
2. Item 2
3. Item 3
```
!!! earning ""
The actual numbers you use to mark the list have no effect on the HTML output that Showdown produces. So you can use the same number in all items if you wish to. For example:
```md
1. Item 1
1. Item 2
1. Item 3
2. Item 1
2. Item 2
2. Item 3
```
### TaskLists (GFM Style)
Showdown supports GFM-styled takslists if the [**`tasklists`**][tasklists] option is enabled.
```md
- [x] checked list item
- [ ] unchecked list item
```
- [x] checked list item
- [ ] unchecked list item
[tasklists]: available-options.md#tasklists
### List syntax
List markers typically start at the left margin, but may be indented by up to three spaces.
```md
* valid list item
* this is valid too
* this is too
```
List markers must be followed by one or more spaces or a tab.
To make lists look nicer, you can wrap items with hanging indents:
```md
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
```
But if you want to be lazy, you don't have to :grin:
If one list item is separated by a blank line, Showdown will wrap all the list items in `
```
This differs from other Markdown implementations such as GFM (GitHub) or CommonMark.
### Nested blocks
List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:
```md
1. This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.
```
This is valid for other block elements such as blockquotes:
```md
* A list item with a blockquote:
> This is a blockquote
> inside a list item.
```
or even other lists.
### Nested lists
You can create nested lists by indenting list items by **four** spaces.
```md
1. Item 1
1. A corollary to the above item.
2. Yet another point to consider.
2. Item 2
* A corollary that does not need to be ordered.
* This is indented four spaces
* You might want to consider making a new list.
3. Item 3
```
This behavior is consistent with the original spec but differs from other implementations such as GFM or CommonMark. Prior to version 1.5, you just needed to indent two spaces for it to be considered a sublist.
You can disable the **four spaces requirement** with option [**`disableForced4SpacesIndentedSublists`**][disableForced4SpacesIndentedSublists]
To nest a third (or more) sublist level, you need to indent 4 extra spaces (or 1 extra tab) for each level:
```md
1. level 1
1. Level 2
* Level 3
2. level 2
1. Level 3
1. Level 1
```
[disableForced4SpacesIndentedSublists]: available-options.md#disableforced4spacesindentedsublists
### Nested code blocks
You can nest fenced codeblocks the same way you nest other block elements, by indenting by four spaces or a tab:
```md
1. Some code:
```js
var foo = 'bar';
console.log(foo);
```
```
To put an *indented style* code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs:
```md
1. Some code:
var foo = 'bar';
console.log(foo);
```
## Links
### Simple
If you wrap a valid URL or email in `<>` it will be turned into a link whose text is the link itself.
```md
link to ` and `` tags is always escaped.
```md
some markdown **here** with foo & bar
```
```html
foo & bar <baz></baz>
```
This new ruleset is based on the comments of Markdown's author John Gruber in the [Markdown discussion list][md-newsletter].
[md-spec]: http://daringfireball.net/projects/markdown/
[md-newsletter]: https://pairlist6.pair.net/mailman/listinfo/markdown-discuss
[atx]: http://www.aaronsw.com/2002/atx/intro
[setext]: https://en.wikipedia.org/wiki/Setext
[readme]: https://github.com/showdownjs/showdown/blob/master/README.md
[awkward effect]: http://i.imgur.com/YQ9iHTL.gif
[emoji list]: https://github.com/showdownjs/showdown/wiki/emojis
================================================
FILE: docs/quickstart.md
================================================
To quickstart with Showdown, install it as a package (for server-side) or include it to your browser (client-side) via CDN:
## Installation
### Server-side
=== "npm"
```
npm install showdown
```
=== "bower"
```
bower install showdown
```
=== "NuGet"
```
PM> Install-Package showdownjs
```
More information about the package you can find on the [NuGet website](https://www.nuget.org/packages/showdownjs/).
### Client-side
=== "jsDelivr"
```
https://cdn.jsdelivr.net/npm/showdown@hello, markdown!
```
### Client-side
!!! example "Browser"
=== "code"
```js
var converter = new showdown.Converter(),
text = '# hello, markdown!',
html = converter.makeHtml(text);
```
=== "output"
```html
hello, markdown!
```
!!! warning "Potential XSS vulnerabilities"
Showdown doesn't sanitize the input since Markdown relies on it to parse certain features correctly into HTML. As a result, this may lead to potential XSS injection vulnerabilities.
Please refer to the [Markdown's XSS vulnerability](xss.md) page for more information.
## Other installation methods
### Tarball
You can download the latest tarball directly from [releases][releases].
## Previous versions
If you're looking for Showdown prior to version 1.0.0, you can find them in the [legacy branch][legacy-branch].
## Changelog
The full changelog is available [here][changelog].
[legacy-branch]: https://github.com/showdownjs/showdown/tree/legacy
[releases]: https://github.com/showdownjs/showdown/releases
[changelog]: https://github.com/showdownjs/showdown/blob/master/CHANGELOG.md
================================================
FILE: docs/tutorials/add-default-class-to-html.md
================================================
# Add default class for each HTML element
Many people use CSS kits like Bootstrap, Semantic UI, or others that require default name classes for HTML elements:
```html
1st Heading
2nd Heading
```
Showdown does not support this out-of-the-box. But you can create an extension for this:
```js
const showdown = require('showdown');
const classMap = {
h1: 'ui large header',
h2: 'ui medium header',
ul: 'ui list',
li: 'ui item'
}
const bindings = Object.keys(classMap)
.map(key => ({
type: 'output',
regex: new RegExp(`<${key}(.*)>`, 'g'),
replace: `<${key} class="${classMap[key]}" $1>`
}));
const conv = new showdown.Converter({
extensions: [...bindings]
});
const text = `
# 1st Heading
## 2nd Heading
- first item
- second item
`;
```
With this extension, the output will be as follows:
```html
1st Heading
2nd Heading
```
## Credits
* Initial creator: [@zusamann](https://github.com/zusamann), [(original issue)](https://github.com/showdownjs/showdown/issues/376).
* Updated by [@Kameelridder](https://github.com/Kameelridder), [(original issue)](https://github.com/showdownjs/showdown/issues/509).
================================================
FILE: docs/tutorials/index.md
================================================
# Tutorials
* [Add default class for each HTML element](add-default-class-to-html.md)
* [Markdown editor with Showdown](markdown-editor-with-showdown.md)
* [Use language and output extensions on the same block](use-both-extension-types-together.md)
================================================
FILE: docs/tutorials/markdown-editor-with-showdown.md
================================================
# Markdown editor with Showdown
## Introduction
In this tutorial, you will create a simple in-browser Markdown editor using Showdown and some of its extensions. The purpose is to show how easy it is to include and configure Showdown in your project.
The fully working example you can see in [Fiddle][1].
## Step 1: Prepare project
1. Install [node.js](https://nodejs.org/en/).
1. Install project package management tool
!!! info ""
Showdown core library doesn't have any dependencies so the setup is pretty straightforward. However, you are strongly encouraged to use a package manager such as [**npm**](http://npmjs.com) or [**yarn**](https://yarnpkg.com) to manage project dependencies.
To install package management tool:
1. Create a directory called `showdown-editor` and recreate the following structure:
```
showdown-editor
├── css
│ └── style.css
├── js
│ └── script.js
└── index.html
```
1. Initialize `package.json` file by running the following interactive console command:
```
npm init -y
```
This command creates `package.json` file in the root of the project folder, and populates the default content that you can change later if you wish.
## Step 2: Install Showdown
Inside the `showdown-editor` directory, run the following command:
```
npm install showdown --save
```
This command will install `showdown` inside the `node_modules` directory and save `showdown` as a dependency in the `package.json` file.
## Step 3: Update project files
Add the following content to the corresponding project files:
=== "index.html"
```html
```
!!! warning ""
Please note how Showdown and the script file are included to the `index.html` via the `script` tag at the bottom of the file.
=== "style.css"
```css
#sourceTA {
display: block;
}
#targetDiv {
border: 1px dashed #333333;
width: 600px;
height: 400px;
}
```
=== "script.js"
```js
function run() {
var text = document.getElementById('sourceTA').value,
target = document.getElementById('targetDiv'),
converter = new showdown.Converter(),
html = converter.makeHtml(text);
target.innerHTML = html;
}
```
The `script.js` file is simple: when the `runBtn` button is clicked, the script gets the text of the textarea, passes it through Showdown to convert the markdown text into HTML. The resulting HTML is then put inside the `targetDiv`, replacing the previous content.
## Step 4: Check the result
1. Open your `index.html` file. You should see your editor with prefilled markdown text in the text area.
1. Click `Convert` button. You show see the text to be converted to HTML:

The fully working example you can see in [Fiddle][1].
## Conclusion
Congratulations! :tada: You have successfully created a simple Markdown editor!
[1]: http://jsfiddle.net/tivie/6bnpptkb/
================================================
FILE: docs/tutorials/use-both-extension-types-together.md
================================================
# Use language and output extensions on the same block
## Overview
Showdown allows you to define and use any number of extensions that act on the same block. These extensions can be executed sequentially or at different moments.
This enables you to pre-parse/mark a block of text but defer any modifications for the last by using a combination of language and output extensions.
This is useful if you, for example, don't want Showdown to parse the contents of your new language construct.
## Example
Let's say you create an extension that captures everything between `%start%` and `%end%`. However, that content should not be modified by Showdown. Obviously, you can use `` tags but that is beside the point.
Although Showdown doesn't have any flag to prevent parsing the content of an extension, the same effect can be easily achieved by using lang and output extensions together.
!!! example ""
The fully working example you can see in [Fiddle][1].
### Code
[Create your extensions](../create-extension.md) with the following content:
```js
showdown.extension('myExt', function() {
var matches = [];
return [
{
type: 'lang',
regex: /%start%([^]+?)%end%/gi,
replace: function(s, match) {
matches.push(match);
var n = matches.length - 1;
return '%PLACEHOLDER' + n + '%';
}
},
{
type: 'output',
filter: function (text) {
for (var i=0; i< matches.length; ++i) {
var pat = '
This is another regular paragraph.
```
This means that an attacker could do something like this:
```md
This is a regular paragraph.
This is another regular paragraph.
```
While `alert('xss');` is hardly problematic (maybe just annoying) a real-world scenario might be a lot worse. Obviously, you can easily prevent this kind of this straightforward attack. For example, you can define a whitelist for Showdown that will contain a limited set of allowed HTML tags. However, an attacker can easily circumvent this "defense".
## Whitelist / blacklist can't prevent XSS
Consider the following Markdown content:
```md
hello *you*
```
As you can see, it's a link, nothing malicious about this. And `` tags are pretty innocuous, right? Showdown should definitely allow them. But what if the content is slightly altered, like this:
```md
hello *you*
```
Now this is a lot more problematic. Once again, it's not that hard to filter Showdown's input to expunge problematic attributes (such as `href` in `` tags) of scripting attacks. In fact, a regular HTML XSS prevention library should catch this kind of straightforward attack.
At this point you're probably thinking that the best way is to follow Stackoverflow's cue and disallow embedded HTML in Markdown. Unfortunately it's still not enough.
## Strip HTML tags is not enough
Consider the following Markdown input:
```md
[some text](javascript:alert('xss'))
```
Showdown will correctly parse this piece of Markdown input as:
```html
some text
```
In this case, it was Markdown's syntax itself to create the dangerous link. HTML XSS filter cannot catch this. And unless you start striping dangerous words like *javascript* (which would make this article extremely hard to write), there's nothing you can really do to filter XSS attacks from your input. Things get even harder when you tightly mix HTML with Markdown.
## Mixed HTML/Markdown XSS attack
Consider the following piece of Markdown:
```md
> hello href="javascript:alert('xss')">*you*
```
If you apply an XSS filter to filter bad HTML in this Markdown input, the XSS filter, expecting HTML, will likely think the `` tag ends with the first character on the second line and will leave the text snippet untouched. It will probably fail to see that the `href="javascript:…"` is part of the `` element and leave it alone. But when Markdown converts this to HTML, you get this:
```html
Foo
```
After parsing with Markdown, the first `>` on the second line disappears because it was the blockquote marker in the Markdown blockquote syntax. As a result, you’ve got a link containing an XSS attack!
Did Markdown generate the HTML? No, the HTML was already in plain sight in the input. The XSS filter couldn’t catch it because the input doesn’t follow HTML rules: it’s a mix of Markdown and HTML, and the filter doesn’t know a dime about Markdown.
## Mitigate XSS
So, is it all lost? Not really. The answer is not to filter the *input* but rather the *output*. After the *input* text is converted into full-fledged HTML, you can reliably apply the correct XSS filters to remove any dangerous or malicious content.
Also, client-side validations are not reliable. It should be a given, but in case you're wondering, you should (almost) never trust data sent by the client. If there's some critical operation you must perform on the data (such as XSS filtering), you should do it *SERVER-SIDE* not client-side.
HTML XSS filtering libraries are useful here since they prevent most of the attacks. However, you should not use them blindly: a library can't predict all the contexts and situations your application may face.
## Conclusion
Showdown tries to convert the input text as closely as possible, without any concerns for XSS attacks or malicious intent. So, the basic rules are:
* **removing HTML entities from Markdown does not prevent XSS**. Markdown syntax can generate XSS attacks.
* **XSS filtering should be done after Showdown has processed input, not before or during**. If you filter before, it will break some of Markdown’s features and will leave security holes.
* **perform the necessary filtering server-side, not client-side**. XSS filtering libraries are useful but should not be used blindly.
## Disclaimer
This page is based on the excellent article: ["Markdown and XSS"][1] by [Michel Fortin][2]
[1]: https://michelf.ca/blog/2010/markdown-and-xss/
[2]: https://github.com/michelf
================================================
FILE: karma.browserstack.js
================================================
module.exports = function (config) {
config.set({
// global config of your BrowserStack account
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESSKEY,
project: process.env.BROWSERSTACK_PROJECT_NAME || 'showdown',
build: process.env.BROWSERSTACK_BUILD_NAME || require('./package.json').version,
name: process.env.COMMIT_MSG || 'Unit Testing'
},
// define browsers
customLaunchers: {
bstack_chrome_windows: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: '49',
os: 'Windows',
os_version: '10'
},
bstack_firefox_windows: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: '44',
os: 'Windows',
os_version: '10'
},
bstack_edge_windows: {
base: 'BrowserStack',
browser: 'edge',
browser_version: '15',
os: 'Windows',
os_version: '10'
},
bstack_ie11_windows: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11',
os: 'Windows',
os_version: '10'
},
bstack_macos_safari: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '10.1',
os: 'OS X',
os_version: 'Sierra'
},
bstack_iphoneX: {
base: 'BrowserStack',
browser: 'safari',
os: 'ios',
os_version: '11.0',
device: 'iPhone X',
real_mobile: true
},
bstack_android: {
base: 'BrowserStack',
browser: 'chrome',
os: 'android',
os_version:'4.4',
device: 'Samsung Galaxy Tab 4',
realMobile: true
}
},
browsers: ['bstack_chrome_windows', 'bstack_firefox_windows', 'bstack_ie11_windows', 'bstack_edge_windows', 'bstack_iphoneX', 'bstack_macos_safari', 'bstack_android'],
frameworks: ['mocha', 'chai'],
reporters: ['dots', 'BrowserStack'],
files: [
{ pattern: '.build/showdown.js'},
{ pattern: 'src/options.js'},
// tests
{ pattern: 'test/unit/showdown*.js' }
//{ pattern: 'test/functional/showdown*.js' },
],
singleRun: true,
concurrency: Infinity
});
};
================================================
FILE: karma.conf.js
================================================
module.exports = function (config) {
config.set({
client: {
captureConsole: true
},
browserConsoleLogOptions: {
level: 'log',
format: '%b %T: %m',
terminal: true
},
logLevel: config.LOG_LOG,
frameworks: ['mocha', 'chai'],
files: [
{ pattern: '.build/showdown.js'},
{ pattern: 'src/options.js'},
// tests
{ pattern: 'test/unit/showdown*.js' },
{ pattern: 'test/functional/showdown*.js' },
],
reporters: ['progress'],
port: 9876, // karma web server port
colors: true,
browsers: ['ChromeHeadless', 'FirefoxHeadless', 'jsdom'],
autoWatch: false,
singleRun: true, // Karma captures browsers, runs the tests and exits
//concurrency: Infinity,
customLaunchers: {
'FirefoxHeadless': {
base: 'Firefox',
flags: [
'-headless',
]
}
},
});
};
================================================
FILE: mkdocs.yml
================================================
site_name: Showdown documentation
site_description: Showdown is a JavaScript Markdown to HTML converter
theme:
name: material
logo: http://showdownjs.com/apple-touch-icon.png
favicon: http://showdownjs.com/apple-touch-icon.png
icon:
repo: fontawesome/brands/github
features:
- navigation.tabs
markdown_extensions:
- admonition
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
extra_css:
- assets/extra.css
repo_url: https://github.com/showdownjs/showdown
repo_name: showdownjs/showdown
site_dir: public
nav:
- Home:
- Introduction: index.md
- Donations: donations.md
- Credits: credits.md
- Quickstart:
- Quickstart: quickstart.md
- Showdown's Markdown syntax: markdown-syntax.md
- Compatibility: compatibility.md
- Configuration:
- Showdown options: configuration.md
- Available options: available-options.md
- Flavors: flavors.md
- CLI: cli.md
- Integrations: integrations.md
- Extensions:
- Overview: extensions.md
- Create an extension: create-extension.md
- List of known extensions: extensions-list.md
- Tutorials: tutorials/index.md
================================================
FILE: package.json
================================================
{
"name": "showdown",
"version": "3.0.0-alpha",
"description": "A Markdown to HTML converter written in Javascript",
"author": "Estevão Santos",
"homepage": "http://showdownjs.com/",
"keywords": [
"markdown",
"converter"
],
"contributors": [
"John Gruber",
"John Fraser",
"Corey Innis",
"Remy Sharp",
"Konstantin Käfer",
"Roger Braun",
"Dominic Tarr",
"Cat Chen",
"Titus Stone",
"Rob Sutherland",
"Pavel Lang",
"Ben Combee",
"Adam Backstrom",
"Pascal Deschênes",
"Estevão Santos"
],
"funding": {
"type": "individual",
"url": "https://www.paypal.me/tiviesantos"
},
"repository": {
"type": "git",
"url": "https://github.com/showdownjs/showdown.git",
"web": "https://github.com/showdownjs/showdown"
},
"license": "MIT",
"main": "./dist/showdown.js",
"scripts": {
"test": "grunt test"
},
"bin": {
"showdown": "bin/showdown.js"
},
"files": [
"bin",
"dist"
],
"devDependencies": {
"chai": "*",
"chai-match": "*",
"grunt": "^1.4.1",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-concat": "^2.0.0",
"grunt-contrib-jshint": "^3.1.0",
"grunt-contrib-uglify": "^5.0.1",
"grunt-conventional-changelog": "^6.1.0",
"grunt-conventional-github-releaser": "^1.0.0",
"grunt-endline": "^0.7.0",
"grunt-eslint": "^24.0.0",
"grunt-mocha-test": "^0.13.3",
"grunt-simple-mocha": "^0.4.0",
"karma": "^6.3.17",
"karma-browserstack-launcher": "^1.6.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.1",
"karma-firefox-launcher": "^2.1.2",
"karma-jsdom-launcher": "^12.0.0",
"karma-mocha": "^2.0.1",
"load-grunt-tasks": "^5.1.0",
"performance-now": "^2.1.0",
"quiet-grunt": "^0.2.0",
"semver-sort": "^1.0.0",
"sinon": "*",
"source-map-support": "^0.5.21"
},
"dependencies": {
"commander": "^9.0.0",
"jsdom": "^19.0.0"
},
"overrides": {
"minimist": "^1.2.6"
}
}
================================================
FILE: performance.json
================================================
{"2.0.0":[{"suiteName":"Basic","cycles":50,"tests":[{"name":"Simple \"Hello World\"","time":0.5814020752906799,"maxTime":12.278934955596924,"minTime":0.15148591995239258},{"name":"performance.testfile.md","time":35.49076347827911,"maxTime":79.40457594394684,"minTime":29.04559099674225}]},{"suiteName":"subParsers","cycles":20,"tests":[{"name":"hashHTMLBlocks","time":4.561372250318527,"maxTime":7.806509017944336,"minTime":2.461485981941223},{"name":"anchors","time":2.9101044595241548,"maxTime":6.510464072227478,"minTime":1.055580973625183},{"name":"blockQuotes","time":4.141605257987976,"maxTime":19.022807955741882,"minTime":2.540547013282776},{"name":"codeBlocks","time":0.263570636510849,"maxTime":0.8583500385284424,"minTime":0.19387996196746826},{"name":"codeSpans","time":0.3651615560054779,"maxTime":1.4206420183181763,"minTime":0.27775895595550537},{"name":"detab","time":0.054944151639938356,"maxTime":0.11614596843719482,"minTime":0.04707300662994385},{"name":"encodeAmpsAndAngles","time":0.144669109582901,"maxTime":0.796051025390625,"minTime":0.09184098243713379},{"name":"encodeBackslashEscapes","time":0.08684400320053101,"maxTime":0.2664440870285034,"minTime":0.0629270076751709},{"name":"encodeCode","time":0.6048604607582092,"maxTime":1.1443489789962769,"minTime":0.5217140913009644},{"name":"escapeSpecialCharsWithinTagAttributes","time":0.2064647912979126,"maxTime":0.2871870994567871,"minTime":0.1843109130859375},{"name":"githubCodeBlocks","time":0.25113869905471803,"maxTime":1.0032700300216675,"minTime":0.19171404838562012},{"name":"hashBlock","time":0.038335990905761716,"maxTime":0.10441303253173828,"minTime":0.034361958503723145},{"name":"hashElement","time":0.0046201348304748535,"maxTime":0.05286991596221924,"minTime":0.0013968944549560547},{"name":"hashHTMLSpans","time":5.228999066352844,"maxTime":9.835397958755493,"minTime":4.239645004272461},{"name":"hashPreCodeTags","time":0.15527103543281556,"maxTime":0.7053269147872925,"minTime":0.11698400974273682},{"name":"headers","time":2.277534711360931,"maxTime":4.824635028839111,"minTime":1.6311440467834473},{"name":"horizontalRule","time":0.1592068076133728,"maxTime":0.27559399604797363,"minTime":0.14848291873931885},{"name":"images","time":0.15910540223121644,"maxTime":0.3903430700302124,"minTime":0.1241079568862915},{"name":"italicsAndBold","time":0.2797422528266907,"maxTime":0.7730040550231934,"minTime":0.21085107326507568},{"name":"lists","time":4.25269467830658,"maxTime":8.173315048217773,"minTime":3.1456509828567505},{"name":"outdent","time":0.18059219121932985,"maxTime":0.23801898956298828,"minTime":0.16182196140289307},{"name":"paragraphs","time":8.96755729317665,"maxTime":11.331398010253906,"minTime":7.8572129011154175},{"name":"spanGamut","time":2.985103452205658,"maxTime":4.162191033363342,"minTime":2.48593008518219},{"name":"strikethrough","time":0.006921297311782837,"maxTime":0.09889602661132812,"minTime":0.001326918601989746},{"name":"stripLinkDefinitions","time":1.9106478571891785,"maxTime":2.8545520305633545,"minTime":1.446552038192749},{"name":"tables","time":0.008185452222824097,"maxTime":0.12662196159362793,"minTime":0.0015370845794677734},{"name":"unescapeSpecialChars","time":0.013451296091079711,"maxTime":0.07347309589385986,"minTime":0.009706974029541016}]}]}
================================================
FILE: performance.log.md
================================================
# Performance Tests for showdown
## [version 2.0.0](https://github.com/showdownjs/showdown/tree/2.0.0)
### Test Suite: Basic (50 cycles)
| test | avgTime | max | min |
|:-----|--------:|----:|----:|
|Simple "Hello World"|0.581|12.279|0.151|
|performance.testfile.md|35.491|79.405|29.046|
### Test Suite: subParsers (20 cycles)
| test | avgTime | max | min |
|:-----|--------:|----:|----:|
|hashHTMLBlocks|4.561|7.807|2.461|
|anchors|2.910|6.510|1.056|
|blockQuotes|4.142|19.023|2.541|
|codeBlocks|0.264|0.858|0.194|
|codeSpans|0.365|1.421|0.278|
|detab|0.055|0.116|0.047|
|encodeAmpsAndAngles|0.145|0.796|0.092|
|encodeBackslashEscapes|0.087|0.266|0.063|
|encodeCode|0.605|1.144|0.522|
|escapeSpecialCharsWithinTagAttributes|0.206|0.287|0.184|
|githubCodeBlocks|0.251|1.003|0.192|
|hashBlock|0.038|0.104|0.034|
|hashElement|0.005|0.053|0.001|
|hashHTMLSpans|5.229|9.835|4.240|
|hashPreCodeTags|0.155|0.705|0.117|
|headers|2.278|4.825|1.631|
|horizontalRule|0.159|0.276|0.148|
|images|0.159|0.390|0.124|
|italicsAndBold|0.280|0.773|0.211|
|lists|4.253|8.173|3.146|
|outdent|0.181|0.238|0.162|
|paragraphs|8.968|11.331|7.857|
|spanGamut|2.985|4.162|2.486|
|strikethrough|0.007|0.099|0.001|
|stripLinkDefinitions|1.911|2.855|1.447|
|tables|0.008|0.127|0.002|
|unescapeSpecialChars|0.013|0.073|0.010|
================================================
FILE: src/cli/cli.js
================================================
/**
* Created by tivie
*/
var fs = require('fs'),
path = require('path'),
Command = require('commander').Command,
program = new Command(),
path1 = path.resolve(__dirname + '/../dist/showdown.js'),
path2 = path.resolve(__dirname + '/../../.build/showdown.js'),
showdown,
version;
// require shodown. We use conditional loading for each use case
if (fs.existsSync(path1)) {
// production. File lives in bin directory
showdown = require(path1);
version = require(path.resolve(__dirname + '/../package.json')).version;
} else if (fs.existsSync(path2)) {
// testing envo, uses the concatenated stuff for testing
showdown = require(path2);
version = require(path.resolve(__dirname + '/../../package.json')).version;
} else {
// cold testing (manual) of cli.js in the src file. We load the dist file
showdown = require('../../dist/showdown');
version = require('../../package.json');
}
program
.name('showdown')
.description('CLI to Showdownjs markdown parser v' + version)
.version(version)
.usage('>t<>", "<", ">", "g")
* returns: ["t<", ""]
* matchRecursiveRegExp("
',
'basecamp': '
',
'basecampy': '
',
'bowtie': '
',
'electron': '
',
'feelsgood': '
',
'finnadie': '
',
'goberserk': '
',
'godmode': '
',
'hurtrealbad': '
',
'neckbeard': '
',
'octocat': '
',
'rage1': '
',
'rage2': '
',
'rage3': '
',
'rage4': '
',
'shipit': '
',
'suspect': '
',
'trollface': '
',
'showdown': ''
};
================================================
FILE: src/loader.js
================================================
var root = this;
// AMD Loader
if (typeof define === 'function' && define.amd) {
define(function () {
'use strict';
return showdown;
});
// CommonJS/nodeJS Loader
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = showdown;
// Regular Browser loader
} else {
root.showdown = showdown;
}
================================================
FILE: src/options.js
================================================
/**
* Created by Tivie on 13-07-2015.
*/
function getDefaultOpts (simple) {
'use strict';
var defaultOptions = {
omitExtraWLInCodeBlocks: {
defaultValue: false,
describe: 'Omit the default extra whiteline added to code blocks',
type: 'boolean'
},
noHeaderId: {
defaultValue: false,
describe: 'Turn on/off generated header id',
type: 'boolean'
},
prefixHeaderId: {
defaultValue: false,
describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \'section-\' prefix',
type: 'string'
},
rawPrefixHeaderId: {
defaultValue: false,
describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
type: 'boolean'
},
ghCompatibleHeaderId: {
defaultValue: false,
describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
type: 'boolean'
},
rawHeaderId: {
defaultValue: false,
describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
type: 'boolean'
},
headerLevelStart: {
defaultValue: false,
describe: 'The header blocks level start',
type: 'integer'
},
parseImgDimensions: {
defaultValue: false,
describe: 'Turn on/off image dimension parsing',
type: 'boolean'
},
simplifiedAutoLink: {
defaultValue: false,
describe: 'Turn on/off GFM autolink style',
type: 'boolean'
},
literalMidWordUnderscores: {
defaultValue: false,
describe: 'Parse midword underscores as literal underscores',
type: 'boolean'
},
literalMidWordAsterisks: {
defaultValue: false,
describe: 'Parse midword asterisks as literal asterisks',
type: 'boolean'
},
strikethrough: {
defaultValue: false,
describe: 'Turn on/off strikethrough support',
type: 'boolean'
},
tables: {
defaultValue: false,
describe: 'Turn on/off tables support',
type: 'boolean'
},
tablesHeaderId: {
defaultValue: false,
describe: 'Add an id to table headers',
type: 'boolean'
},
ghCodeBlocks: {
defaultValue: true,
describe: 'Turn on/off GFM fenced code blocks support',
type: 'boolean'
},
tasklists: {
defaultValue: false,
describe: 'Turn on/off GFM tasklist support',
type: 'boolean'
},
smoothLivePreview: {
defaultValue: false,
describe: 'Prevents weird effects in live previews due to incomplete input',
type: 'boolean'
},
smartIndentationFix: {
defaultValue: false,
describe: 'Tries to smartly fix indentation in es6 strings',
type: 'boolean'
},
disableForced4SpacesIndentedSublists: {
defaultValue: false,
describe: 'Disables the requirement of indenting nested sublists by 4 spaces',
type: 'boolean'
},
simpleLineBreaks: {
defaultValue: false,
describe: 'Parses simple line breaks as
(GFM Style)',
type: 'boolean'
},
requireSpaceBeforeHeadingText: {
defaultValue: false,
describe: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
type: 'boolean'
},
ghMentions: {
defaultValue: false,
describe: 'Enables github @mentions',
type: 'boolean'
},
ghMentionsLink: {
defaultValue: 'https://github.com/{u}',
describe: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
type: 'string'
},
encodeEmails: {
defaultValue: true,
describe: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
type: 'boolean'
},
openLinksInNewWindow: {
defaultValue: false,
describe: 'Open all links in new windows',
type: 'boolean'
},
backslashEscapesHTMLTags: {
defaultValue: false,
describe: 'Support for HTML Tag escaping. ex: \ content, so we need to fix that:
bq = bq.replace(/(\s*[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
var pre = m1;
// attacklab: hack around Konqueror 3.5.4 bug:
pre = pre.replace(/^ /mg, '¨0');
pre = pre.replace(/¨0/g, '');
return pre;
});
return showdown.subParser('makehtml.hashBlock')('\n' + bq + '\n
', options, globals);
});
text = globals.converter._dispatch('makehtml.blockQuotes.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/codeBlocks.js
================================================
/**
* Process Markdown `` blocks.
*/
showdown.subParser('makehtml.codeBlocks', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.codeBlocks.before', text, options, globals).getText();
// sentinel workarounds for lack of \A and \Z, safari\khtml bug
text += '¨0';
var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
text = text.replace(pattern, function (wholeMatch, m1, m2) {
var codeblock = m1,
nextChar = m2,
end = '\n';
codeblock = showdown.subParser('makehtml.outdent')(codeblock, options, globals);
codeblock = showdown.subParser('makehtml.encodeCode')(codeblock, options, globals);
codeblock = showdown.subParser('makehtml.detab')(codeblock, options, globals);
codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
if (options.omitExtraWLInCodeBlocks) {
end = '';
}
codeblock = '
';
return showdown.subParser('makehtml.hashBlock')(codeblock, options, globals) + nextChar;
});
// strip sentinel
text = text.replace(/¨0/, '');
text = globals.converter._dispatch('makehtml.codeBlocks.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/codeSpans.js
================================================
/**
*
* * Backtick quotes are used for ' + codeblock + end + ' spans.
*
* * You can use multiple backticks as the delimiters if you want to
* include literal backticks in the code span. So, this input:
*
* Just type ``foo `bar` baz`` at the prompt.
*
* Will translate to:
*
* foo `bar` baz at the prompt.`bar` ...
*/
showdown.subParser('makehtml.codeSpans', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.codeSpans.before', text, options, globals).getText();
if (typeof (text) === 'undefined') {
text = '';
}
text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
function (wholeMatch, m1, m2, m3) {
var c = m3;
c = c.replace(/^([ \t]*)/g, ''); // leading whitespace
c = c.replace(/[ \t]*$/g, ''); // trailing whitespace
c = showdown.subParser('makehtml.encodeCode')(c, options, globals);
c = m1 + '' + c + '';
c = showdown.subParser('makehtml.hashHTMLSpans')(c, options, globals);
return c;
}
);
text = globals.converter._dispatch('makehtml.codeSpans.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/completeHTMLDocument.js
================================================
/**
* Create a full HTML document from the processed markdown
*/
showdown.subParser('makehtml.completeHTMLDocument', function (text, options, globals) {
'use strict';
if (!options.completeHTMLDocument) {
return text;
}
text = globals.converter._dispatch('makehtml.completeHTMLDocument.before', text, options, globals).getText();
var doctype = 'html',
doctypeParsed = '\n',
title = '',
charset = '\n',
lang = '',
metadata = '';
if (typeof globals.metadata.parsed.doctype !== 'undefined') {
doctypeParsed = '\n';
doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
if (doctype === 'html' || doctype === 'html5') {
charset = '';
}
}
for (var meta in globals.metadata.parsed) {
if (globals.metadata.parsed.hasOwnProperty(meta)) {
switch (meta.toLowerCase()) {
case 'doctype':
break;
case 'title':
title = '
';
codeblock = showdown.subParser('makehtml.hashBlock')(codeblock, options, globals);
// Since GHCodeblocks can be false positives, we need to
// store the primitive text and the parsed text in a global var,
// and then return a token
return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
});
// attacklab: strip sentinel
text = text.replace(/¨0/, '');
return globals.converter._dispatch('makehtml.githubCodeBlocks.after', text, options, globals).getText();
});
================================================
FILE: src/subParsers/makehtml/hashBlock.js
================================================
showdown.subParser('makehtml.hashBlock', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashBlock.before', text, options, globals).getText();
text = text.replace(/(^\n+|\n+$)/g, '');
text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
text = globals.converter._dispatch('makehtml.hashBlock.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/hashCodeTags.js
================================================
/**
* Hash and escape ' + codeblock + end + ' elements that should not be parsed as markdown
*/
showdown.subParser('makehtml.hashCodeTags', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashCodeTags.before', text, options, globals).getText();
var repFunc = function (wholeMatch, match, left, right) {
var codeblock = left + showdown.subParser('makehtml.encodeCode')(match, options, globals) + right;
return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
};
// Hash naked
text = showdown.helper.replaceRecursiveRegExp(text, repFunc, ']*>', '', 'gim');
text = globals.converter._dispatch('makehtml.hashCodeTags.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/hashElement.js
================================================
showdown.subParser('makehtml.hashElement', function (text, options, globals) {
'use strict';
return function (wholeMatch, m1) {
var blockText = m1;
// Undo double lines
blockText = blockText.replace(/\n\n/g, '\n');
blockText = blockText.replace(/^\n/, '');
// strip trailing blank lines
blockText = blockText.replace(/\n+$/g, '');
// Replace the element text with a marker ("¨KxK" where x is its key)
blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
return blockText;
};
});
================================================
FILE: src/subParsers/makehtml/hashHTMLBlocks.js
================================================
showdown.subParser('makehtml.hashHTMLBlocks', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashHTMLBlocks.before', text, options, globals).getText();
var blockTags = [
'pre',
'div',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'blockquote',
'table',
'dl',
'ol',
'ul',
'script',
'noscript',
'form',
'fieldset',
'iframe',
'math',
'style',
'section',
'header',
'footer',
'nav',
'article',
'aside',
'address',
'audio',
'canvas',
'figure',
'hgroup',
'output',
'video',
'details',
'p'
],
repFunc = function (wholeMatch, match, left, right) {
var txt = wholeMatch;
// check if this html element is marked as markdown
// if so, it's contents should be parsed as markdown
if (left.search(/\bmarkdown\b/) !== -1) {
txt = left + globals.converter.makeHtml(match) + right;
}
return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
};
if (options.backslashEscapesHTMLTags) {
// encode backslash escaped HTML tags
text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
return '<' + inside + '>';
});
}
// hash HTML Blocks
for (var i = 0; i < blockTags.length; ++i) {
var opTagPos,
rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
patLeft = '<' + blockTags[i] + '\\b[^>]*>',
patRight = '' + blockTags[i] + '>';
// 1. Look for the first position of the first opening HTML tag in the text
while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
// if the HTML tag is \ escaped, we need to escape it and break
//2. Split the text in that position
var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
//3. Match recursively
newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
// prevent an infinite loop
if (newSubText1 === subTexts[1]) {
break;
}
text = subTexts[0].concat(newSubText1);
}
}
// HR SPECIAL CASE
text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
showdown.subParser('makehtml.hashElement')(text, options, globals));
// Special case for standalone HTML comments
text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
}, '^ {0,3}', 'gm');
// PHP and ASP-style processor instructions (...?> and <%...%>)
text = text.replace(/\n\n( {0,3}<([?%])[^\r]*?\2>[ \t]*(?=\n{2,}))/g,
showdown.subParser('makehtml.hashElement')(text, options, globals));
text = globals.converter._dispatch('makehtml.hashHTMLBlocks.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/hashHTMLSpans.js
================================================
/**
* Hash span elements that should not be parsed as markdown
*/
showdown.subParser('makehtml.hashHTMLSpans', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashHTMLSpans.before', text, options, globals).getText();
// Hash Self Closing tags
text = text.replace(/<[^>]+?\/>/gi, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
// Hash tags without properties
text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
// Hash tags with properties
text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
// Hash self closing tags without />
text = text.replace(/<[^>]+?>/gi, function (wm) {
return showdown.helper._hashHTMLSpan(wm, globals);
});
text = globals.converter._dispatch('makehtml.hashHTMLSpans.after', text, options, globals).getText();
return text;
});
/**
* Unhash HTML spans
*/
showdown.subParser('makehtml.unhashHTMLSpans', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.unhashHTMLSpans.before', text, options, globals).getText();
for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
var repText = globals.gHtmlSpans[i],
// limiter to prevent infinite loop (assume 10 as limit for recurse)
limit = 0;
while (/¨C(\d+)C/.test(repText)) {
var num = RegExp.$1;
repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
if (limit === 10) {
console.error('maximum nesting of 10 spans reached!!!');
break;
}
++limit;
}
text = text.replace('¨C' + i + 'C', repText);
}
text = globals.converter._dispatch('makehtml.unhashHTMLSpans.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/hashPreCodeTags.js
================================================
/**
* Hash and escape elements that should not be parsed as markdown
*/
showdown.subParser('makehtml.hashPreCodeTags', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashPreCodeTags.before', text, options, globals).getText();
var repFunc = function (wholeMatch, match, left, right) {
// encode html entities
var codeblock = left + showdown.subParser('makehtml.encodeCode')(match, options, globals) + right;
return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
};
// Hash
text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}]*>\\s*
', 'gim');
text = globals.converter._dispatch('makehtml.hashPreCodeTags.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/headers.js
================================================
showdown.subParser('makehtml.headers', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.headers.before', text, options, globals).getText();
var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
// Set text-style headers:
// Header 1
// ========
//
// Header 2
// --------
//
setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
text = text.replace(setextRegexH1, function (wholeMatch, m1) {
var spanGamut = showdown.subParser('makehtml.spanGamut')(m1, options, globals),
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
hLevel = headerLevelStart,
hashBlock = ']*>', '^ {0,3}\\s*
tags.
*
* Any 3 or more unindented consecutive hyphens, asterisks or underscores with or without a space beetween them
* in a single line is considered a horizontal rule
*/
showdown.subParser('makehtml.horizontalRule', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.horizontalRule.before', text, options, globals).getText();
var key = showdown.subParser('makehtml.hashBlock')('
', options, globals);
text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
text = globals.converter._dispatch('makehtml.horizontalRule.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/images.js
================================================
/**
* Turn Markdown image shortcuts into tags.
*/
showdown.subParser('makehtml.images', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.images.before', text, options, globals).getText();
var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
url = url.replace(/\s/g, '');
return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
}
function writeImageTagBaseUrl (wholeMatch, altText, linkId, url, width, height, m5, title) {
url = showdown.helper.applyBaseUrl(options.relativePathBaseUrl, url);
return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
}
function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
var gUrls = globals.gUrls,
gTitles = globals.gTitles,
gDims = globals.gDimensions;
linkId = linkId.toLowerCase();
if (!title) {
title = '';
}
// Special case for explicit empty url
if (wholeMatch.search(/\(\s*>? ?(['"].*['"])?\)$/m) > -1) {
url = '';
} else if (url === '' || url === null) {
if (linkId === '' || linkId === null) {
// lower-case and turn embedded newlines into spaces
linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
}
url = '#' + linkId;
if (!showdown.helper.isUndefined(gUrls[linkId])) {
url = gUrls[linkId];
if (!showdown.helper.isUndefined(gTitles[linkId])) {
title = gTitles[linkId];
}
if (!showdown.helper.isUndefined(gDims[linkId])) {
width = gDims[linkId].width;
height = gDims[linkId].height;
}
} else {
return wholeMatch;
}
}
altText = altText
.replace(/"/g, '"')
//altText = showdown.helper.escapeCharacters(altText, '*_', false);
.replace(showdown.helper.regexes.asteriskDashTildeAndColon, showdown.helper.escapeCharactersCallback);
//url = showdown.helper.escapeCharacters(url, '*_', false);
url = url.replace(showdown.helper.regexes.asteriskDashTildeAndColon, showdown.helper.escapeCharactersCallback);
var result = '
';
return result;
}
// First, handle reference-style labeled images: ![alt text][id]
text = text.replace(referenceRegExp, writeImageTag);
// Next, handle inline images:  {
return showdown.helper._hashHTMLSpan(wholeMatch, globals);
});
// 7. Handle naked links (if option is enabled)
text = showdown.subParser('makehtml.links.naked')(text, options, globals);
text = globals.converter._dispatch(evtRootName + '.end', text, options, globals).getText();
return text;
});
/**
* TODO WRITE THIS DOCUMENTATION
*/
showdown.subParser('makehtml.links.inline', function (text, options, globals) {
var evtRootName = evtRootName + '.inline';
text = globals.converter._dispatch(evtRootName + '.start', text, options, globals).getText();
// 1. Look for empty cases: []() and [empty]() and []("title")
var rgxEmpty = /\[(.*?)]()()()()\( ?>? ?(?:["'](.*)["'])?\)/g;
text = text.replace(rgxEmpty, replaceAnchorTagBaseUrl(rgxEmpty, evtRootName, options, globals, true));
// 2. Look for cases with crazy urls like ./image/cat1).png
var rgxCrazy = /\[((?:\[[^\]]*]|[^\[\]])*)]()\s?\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g;
text = text.replace(rgxCrazy, replaceAnchorTagBaseUrl(rgxCrazy, evtRootName, options, globals));
// 3. inline links with no title or titles wrapped in ' or ":
// [text](url.com) || [text](
// instead of:
//
// So, to prevent it, we will put a marker (¨A)in the beginning of the line
// Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
return '¨A' + wm2;
});
// SPECIAL CASE: a heading followed by a paragraph of text that is not separated by a double newline
// or/nor indented. ex:
//
// - # foo
// bar is great
//
// While this does now follow the spec per se, not allowing for this might cause confusion since
// header blocks don't need double-newlines after
if (/^#+.+\n.+/.test(item)) {
item = item.replace(/^(#+.+)$/m, '$1\n');
}
// m1 - Leading line or
// Has a double return (multi paragraph)
if (m1 || (item.search(/\n{2,}/) > -1)) {
item = showdown.subParser('makehtml.githubCodeBlocks')(item, options, globals);
item = showdown.subParser('makehtml.blockQuotes')(item, options, globals);
item = showdown.subParser('makehtml.headers')(item, options, globals);
item = showdown.subParser('makehtml.lists')(item, options, globals);
item = showdown.subParser('makehtml.codeBlocks')(item, options, globals);
item = showdown.subParser('makehtml.tables')(item, options, globals);
item = showdown.subParser('makehtml.hashHTMLBlocks')(item, options, globals);
//item = showdown.subParser('makehtml.paragraphs')(item, options, globals);
// TODO: This is a copy of the paragraph parser
// This is a provisory fix for issue #494
// For a permanente fix we need to rewrite the paragraph parser, passing the unhashify logic outside
// so that we can call the paragraph parser without accidently unashifying previously parsed blocks
// Strip leading and trailing lines:
item = item.replace(/^\n+/g, '');
item = item.replace(/\n+$/g, '');
var grafs = item.split(/\n{2,}/g),
grafsOut = [],
end = grafs.length; // Wrap ]*>\s*
]*>/.test(grafsOutIt)) {
codeFlag = true;
}
}
grafsOut[i] = grafsOutIt;
}
text = grafsOut.join('\n');
// Strip leading and trailing lines:
text = text.replace(/^\n+/g, '');
text = text.replace(/\n+$/g, '');
return globals.converter._dispatch('makehtml.paragraphs.after', text, options, globals).getText();
});
================================================
FILE: src/subParsers/makehtml/runExtension.js
================================================
/**
* Run extension
*/
showdown.subParser('makehtml.runExtension', function (ext, text, options, globals) {
'use strict';
if (ext.filter) {
text = ext.filter(text, globals.converter, options);
} else if (ext.regex) {
// TODO remove this when old extension loading mechanism is deprecated
var re = ext.regex;
if (!(re instanceof RegExp)) {
re = new RegExp(re, 'g');
}
text = text.replace(re, ext.replace);
}
return text;
});
================================================
FILE: src/subParsers/makehtml/spanGamut.js
================================================
/**
* These are all the transformations that occur *within* block-level
* tags like paragraphs, headers, and list items.
*/
showdown.subParser('makehtml.spanGamut', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.span.before', text, options, globals).getText();
text = showdown.subParser('makehtml.codeSpans')(text, options, globals);
text = showdown.subParser('makehtml.escapeSpecialCharsWithinTagAttributes')(text, options, globals);
text = showdown.subParser('makehtml.encodeBackslashEscapes')(text, options, globals);
// Process link and image tags. Images must come first,
// because ![foo][f] looks like a link.
text = showdown.subParser('makehtml.images')(text, options, globals);
text = globals.converter._dispatch('smakehtml.links.before', text, options, globals).getText();
text = showdown.subParser('makehtml.links')(text, options, globals);
text = globals.converter._dispatch('smakehtml.links.after', text, options, globals).getText();
//text = showdown.subParser('makehtml.autoLinks')(text, options, globals);
//text = showdown.subParser('makehtml.simplifiedAutoLinks')(text, options, globals);
text = showdown.subParser('makehtml.emoji')(text, options, globals);
text = showdown.subParser('makehtml.underline')(text, options, globals);
text = showdown.subParser('makehtml.italicsAndBold')(text, options, globals);
text = showdown.subParser('makehtml.strikethrough')(text, options, globals);
text = showdown.subParser('makehtml.ellipsis')(text, options, globals);
// we need to hash HTML tags inside spans
text = showdown.subParser('makehtml.hashHTMLSpans')(text, options, globals);
// now we encode amps and angles
text = showdown.subParser('makehtml.encodeAmpsAndAngles')(text, options, globals);
// Do hard breaks
if (options.simpleLineBreaks) {
// GFM style hard breaks
// only add line breaks if the text does not contain a block (special case for lists)
if (!/\n\n¨K/.test(text)) {
text = text.replace(/\n+/g, '
\n');
}
} else {
// Vanilla hard breaks
text = text.replace(/ +\n/g, '
\n');
}
text = globals.converter._dispatch('makehtml.spanGamut.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/strikethrough.js
================================================
showdown.subParser('makehtml.strikethrough', function (text, options, globals) {
'use strict';
if (options.strikethrough) {
text = globals.converter._dispatch('makehtml.strikethrough.before', text, options, globals).getText();
text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return '' + txt + ''; });
text = globals.converter._dispatch('makehtml.strikethrough.after', text, options, globals).getText();
}
return text;
});
================================================
FILE: src/subParsers/makehtml/stripLinkDefinitions.js
================================================
/**
* Strips link definitions from text, stores the URLs and titles in
* hash references.
* Link defs are in the form: ^[id]: url "optional title"
*/
showdown.subParser('makehtml.stripLinkDefinitions', function (text, options, globals) {
'use strict';
var regex = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,
base64Regex = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
text += '¨0';
var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
// if there aren't two instances of linkId it must not be a reference link so back out
linkId = linkId.toLowerCase();
if (text.toLowerCase().split(linkId).length - 1 < 2) {
return wholeMatch;
}
if (url.match(/^data:.+?\/.+?;base64,/)) {
// remove newlines
globals.gUrls[linkId] = url.replace(/\s/g, '');
} else {
url = showdown.helper.applyBaseUrl(options.relativePathBaseUrl, url);
globals.gUrls[linkId] = showdown.subParser('makehtml.encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive
}
if (blankLines) {
// Oops, found blank lines, so it's not a title.
// Put back the parenthetical statement we stole.
return blankLines + title;
} else {
if (title) {
globals.gTitles[linkId] = title.replace(/"|'/g, '"');
}
if (options.parseImgDimensions && width && height) {
globals.gDimensions[linkId] = {
width: width,
height: height
};
}
}
// Completely remove the definition from the text
return '';
};
// first we try to find base64 link references
text = text.replace(base64Regex, replaceFunc);
text = text.replace(regex, replaceFunc);
// attacklab: strip sentinel
text = text.replace(/¨0/, '');
return text;
});
================================================
FILE: src/subParsers/makehtml/tables.js
================================================
showdown.subParser('makehtml.tables', function (text, options, globals) {
'use strict';
if (!options.tables) {
return text;
}
var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*[-=]{2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*[-=]{2,}[\s\S]+?(?:\n\n|¨0)/gm,
//singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*[-=]{2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
function parseStyles (sLine) {
if (/^:[ \t]*--*$/.test(sLine)) {
return ' style="text-align:left;"';
} else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
return ' style="text-align:right;"';
} else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
return ' style="text-align:center;"';
} else {
return '';
}
}
function parseHeaders (header, style) {
var id = '';
header = header.trim();
// support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility
if (options.tablesHeaderId || options.tableHeaderId) {
id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
}
header = showdown.subParser('makehtml.spanGamut')(header, options, globals);
return '' + header + ' \n';
}
function parseCells (cell, style) {
var subText = showdown.subParser('makehtml.spanGamut')(cell, options, globals);
return '' + subText + ' \n';
}
function buildTable (headers, cells) {
var tb = '\n\n
\n';
return tb;
}
function parseTable (rawTable) {
var i, tableLines = rawTable.split('\n');
for (i = 0; i < tableLines.length; ++i) {
// strip wrong first and last column if wrapped tables are used
if (/^ {0,3}\|/.test(tableLines[i])) {
tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
}
if (/\|[ \t]*$/.test(tableLines[i])) {
tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
}
// parse code spans first, but we only support one line code spans
tableLines[i] = showdown.subParser('makehtml.codeSpans')(tableLines[i], options, globals);
}
var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
rawCells = [],
headers = [],
styles = [],
cells = [];
tableLines.shift();
tableLines.shift();
for (i = 0; i < tableLines.length; ++i) {
if (tableLines[i].trim() === '') {
continue;
}
rawCells.push(
tableLines[i]
.split('|')
.map(function (s) {
return s.trim();
})
);
}
if (rawHeaders.length < rawStyles.length) {
return rawTable;
}
for (i = 0; i < rawStyles.length; ++i) {
styles.push(parseStyles(rawStyles[i]));
}
for (i = 0; i < rawHeaders.length; ++i) {
if (showdown.helper.isUndefined(styles[i])) {
styles[i] = '';
}
headers.push(parseHeaders(rawHeaders[i], styles[i]));
}
for (i = 0; i < rawCells.length; ++i) {
var row = [];
for (var ii = 0; ii < headers.length; ++ii) {
if (showdown.helper.isUndefined(rawCells[i][ii])) {
}
row.push(parseCells(rawCells[i][ii], styles[ii]));
}
cells.push(row);
}
return buildTable(headers, cells);
}
text = globals.converter._dispatch('makehtml.tables.before', text, options, globals).getText();
// find escaped pipe characters
text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
// parse multi column tables
text = text.replace(tableRgx, parseTable);
// parse one column tables
text = text.replace(singeColTblRgx, parseTable);
text = globals.converter._dispatch('makehtml.tables.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/underline.js
================================================
showdown.subParser('makehtml.underline', function (text, options, globals) {
'use strict';
if (!options.underline) {
return text;
}
text = globals.converter._dispatch('makehtml.underline.before', text, options, globals).getText();
if (options.literalMidWordUnderscores) {
text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
return '' + txt + '';
});
text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
return '' + txt + '';
});
} else {
text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
return (/\S$/.test(m)) ? '' + m + '' : wm;
});
text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
return (/\S$/.test(m)) ? '' + m + '' : wm;
});
}
// escape remaining underscores to prevent them being parsed by italic and bold
text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);
text = globals.converter._dispatch('makehtml.underline.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makehtml/unescapeSpecialChars.js
================================================
/**
* Swap back in all the special characters we've hidden.
*/
showdown.subParser('makehtml.unescapeSpecialChars', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.unescapeSpecialChars.before', text, options, globals).getText();
text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
var charCodeToReplace = parseInt(m1);
return String.fromCharCode(charCodeToReplace);
});
text = globals.converter._dispatch('makehtml.unescapeSpecialChars.after', text, options, globals).getText();
return text;
});
================================================
FILE: src/subParsers/makemarkdown/blockquote.js
================================================
showdown.subParser('makeMarkdown.blockquote', function (node, options, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], options, globals);
if (innerTxt === '') {
continue;
}
txt += innerTxt;
}
}
// cleanup
txt = txt.trim();
txt = '> ' + txt.split('\n').join('\n> ');
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/break.js
================================================
showdown.subParser('makeMarkdown.break', function () {
'use strict';
return ' \n';
});
================================================
FILE: src/subParsers/makemarkdown/codeBlock.js
================================================
showdown.subParser('makeMarkdown.codeBlock', function (node, options, globals) {
'use strict';
var lang = node.getAttribute('language'),
num = node.getAttribute('precodenum');
return '```' + lang + '\n' + globals.preList[num] + '\n```';
});
================================================
FILE: src/subParsers/makemarkdown/codeSpan.js
================================================
showdown.subParser('makeMarkdown.codeSpan', function (node) {
'use strict';
return '`' + node.innerHTML + '`';
});
================================================
FILE: src/subParsers/makemarkdown/emphasis.js
================================================
showdown.subParser('makeMarkdown.emphasis', function (node, options, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
txt += '*';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
txt += '*';
}
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/header.js
================================================
showdown.subParser('makeMarkdown.header', function (node, options, globals, headerLevel) {
'use strict';
var headerMark = new Array(headerLevel + 1).join('#'),
txt = '';
if (node.hasChildNodes()) {
txt = headerMark + ' ';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
}
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/hr.js
================================================
showdown.subParser('makeMarkdown.hr', function () {
'use strict';
return '---';
});
================================================
FILE: src/subParsers/makemarkdown/image.js
================================================
showdown.subParser('makeMarkdown.image', function (node) {
'use strict';
var txt = '';
if (node.hasAttribute('src') && node.getAttribute('src') !== '') {
txt += ' + '>';
if (node.hasAttribute('width') && node.hasAttribute('height')) {
var width = node.getAttribute('width');
var height = node.getAttribute('height');
txt += ' =' + (width === 'auto' ? '*' : width) + 'x' + (height === 'auto' ? '*' : height);
}
if (node.hasAttribute('title')) {
txt += ' "' + node.getAttribute('title') + '"';
}
txt += ')';
}
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/input.js
================================================
showdown.subParser('makeMarkdown.input', function (node, options, globals) {
'use strict';
var txt = '';
if (node.getAttribute('checked') !== null) {
txt += '[x]';
} else {
txt += '[ ]';
}
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/links.js
================================================
showdown.subParser('makeMarkdown.links', function (node, options, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes() && node.hasAttribute('href')) {
var children = node.childNodes,
childrenLength = children.length;
// special case for mentions
// to simplify (and not make stuff really complicated) mentions will only work in this circumstance:
// @user
// that is, if there's a "user-mention" class and option ghMentions is true
// otherwise is ignored
var classes = node.getAttribute('class');
if (options.ghMentions && /(?:^| )user-mention\b/.test(classes)) {
for (var ii = 0; ii < childrenLength; ++ii) {
txt += showdown.subParser('makeMarkdown.node')(children[ii], options, globals);
}
} else {
txt = '[';
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
txt += '](';
txt += '<' + node.getAttribute('href') + '>';
if (node.hasAttribute('title')) {
txt += ' "' + node.getAttribute('title') + '"';
}
txt += ')';
}
}
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/list.js
================================================
showdown.subParser('makeMarkdown.list', function (node, options, globals, type) {
'use strict';
var txt = '';
if (!node.hasChildNodes()) {
return '';
}
var listItems = node.childNodes,
listItemsLenght = listItems.length,
listNum = node.getAttribute('start') || 1;
for (var i = 0; i < listItemsLenght; ++i) {
if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {
continue;
}
// define the bullet to use in list
var bullet = '';
if (type === 'ol') {
bullet = listNum.toString() + '. ';
} else {
bullet = '- ';
}
// parse list item
txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], options, globals);
++listNum;
}
return txt.trim();
});
================================================
FILE: src/subParsers/makemarkdown/listItem.js
================================================
showdown.subParser('makeMarkdown.listItem', function (node, options, globals) {
'use strict';
var listItemTxt = '';
var children = node.childNodes,
childrenLenght = children.length;
for (var i = 0; i < childrenLenght; ++i) {
listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
// if it's only one liner, we need to add a newline at the end
if (!/\n$/.test(listItemTxt)) {
listItemTxt += '\n';
} else {
// it's multiparagraph, so we need to indent
listItemTxt = listItemTxt
.split('\n')
.join('\n ')
.replace(/^ {4}$/gm, '')
.replace(/\n\n+/g, '\n\n');
}
return listItemTxt;
});
================================================
FILE: src/subParsers/makemarkdown/node.js
================================================
showdown.subParser('makeMarkdown.node', function (node, options, globals, spansOnly) {
'use strict';
spansOnly = spansOnly || false;
var txt = '';
// edge case of text without wrapper paragraph
if (node.nodeType === 3) {
return showdown.subParser('makeMarkdown.txt')(node, options, globals);
}
// HTML comment
if (node.nodeType === 8) {
return '\n\n';
}
// process only node elements
if (node.nodeType !== 1) {
return '';
}
var tagName = node.tagName.toLowerCase();
switch (tagName) {
//
// BLOCKS
//
case 'h1':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, options, globals, 1) + '\n\n'; }
break;
case 'h2':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, options, globals, 2) + '\n\n'; }
break;
case 'h3':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, options, globals, 3) + '\n\n'; }
break;
case 'h4':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, options, globals, 4) + '\n\n'; }
break;
case 'h5':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, options, globals, 5) + '\n\n'; }
break;
case 'h6':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, options, globals, 6) + '\n\n'; }
break;
case 'p':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, options, globals) + '\n\n'; }
break;
case 'blockquote':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, options, globals) + '\n\n'; }
break;
case 'hr':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, options, globals) + '\n\n'; }
break;
case 'ol':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, options, globals, 'ol') + '\n\n'; }
break;
case 'ul':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, options, globals, 'ul') + '\n\n'; }
break;
case 'precode':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, options, globals) + '\n\n'; }
break;
case 'pre':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, options, globals) + '\n\n'; }
break;
case 'table':
if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, options, globals) + '\n\n'; }
break;
//
// SPANS
//
case 'code':
txt = showdown.subParser('makeMarkdown.codeSpan')(node, options, globals);
break;
case 'em':
case 'i':
txt = showdown.subParser('makeMarkdown.emphasis')(node, options, globals);
break;
case 'strong':
case 'b':
txt = showdown.subParser('makeMarkdown.strong')(node, options, globals);
break;
case 'del':
txt = showdown.subParser('makeMarkdown.strikethrough')(node, options, globals);
break;
case 'a':
txt = showdown.subParser('makeMarkdown.links')(node, options, globals);
break;
case 'img':
txt = showdown.subParser('makeMarkdown.image')(node, options, globals);
break;
case 'br':
txt = showdown.subParser('makeMarkdown.break')(node, options, globals);
break;
case 'input':
txt = showdown.subParser('makeMarkdown.input')(node, options, globals);
break;
default:
txt = node.outerHTML + '\n\n';
}
// common normalization
// TODO eventually
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/paragraph.js
================================================
showdown.subParser('makeMarkdown.paragraph', function (node, options, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
}
// some text normalization
txt = txt.trim();
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/pre.js
================================================
showdown.subParser('makeMarkdown.pre', function (node, options, globals) {
'use strict';
var num = node.getAttribute('prenum');
return '\n',
tblLgn = headers.length;
for (var i = 0; i < tblLgn; ++i) {
tb += headers[i];
}
tb += ' \n\n\n';
for (i = 0; i < cells.length; ++i) {
tb += '\n';
for (var ii = 0; ii < tblLgn; ++ii) {
tb += cells[i][ii];
}
tb += ' \n';
}
tb += '\n' + globals.preList[num] + '
';
});
================================================
FILE: src/subParsers/makemarkdown/strikethrough.js
================================================
showdown.subParser('makeMarkdown.strikethrough', function (node, options, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
txt += '~~';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
txt += '~~';
}
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/strong.js
================================================
showdown.subParser('makeMarkdown.strong', function (node, options, globals) {
'use strict';
var txt = '';
if (node.hasChildNodes()) {
txt += '**';
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals);
}
txt += '**';
}
return txt;
});
================================================
FILE: src/subParsers/makemarkdown/table.js
================================================
showdown.subParser('makeMarkdown.table',
/**
*
* @param {DocumentFragment} node
* @param {{}} options
* @param {{}} globals
* @returns {string}
*/
function (node, options, globals) {
'use strict';
var txt = '',
tableArray = [[], []],
headings,
rows = [],
colCount,
i,
ii;
/**
* @param {Element} tr
*/
function iterateRow (tr) {
var children = tr.childNodes,
cols = [];
// we need to iterate by order, since td and th can be used interchangeably and in any order
// we will ignore malformed stuff, comments and floating text.
for (var i = 0; i < children.length; ++i) {
var childName = children[i].nodeName.toUpperCase();
if (childName === 'TD' || childName === 'TH') {
cols.push(children[i]);
}
}
return cols;
}
// first lets look for
// we will ignore thead without children
// also, since markdown doesn't support tables with multiple heading rows, only the first one will be transformed
// the rest will count as regular rows
if (node.querySelectorAll(':scope>thead').length !== 0 && node.querySelectorAll(':scope>thead>tr').length !== 0) {
var thead = node.querySelectorAll(':scope>thead>tr');
// thead>tr can have td and th children
for (i = 0; i < thead.length; ++i) {
rows.push(iterateRow(thead[i]));
}
}
// now let's look for tbody
// we will ignore tbody without children
if (node.querySelectorAll(':scope>tbody').length !== 0 && node.querySelectorAll(':scope>tbody>tr').length !== 0) {
var tbody = node.querySelectorAll(':scope>tbody>tr');
// tbody>tr can have td and th children, although th are not very screen reader friendly
for (i = 0; i < tbody.length; ++i) {
rows.push(iterateRow(tbody[i]));
}
}
// now look for tfoot
if (node.querySelectorAll(':scope>tfoot').length !== 0 && node.querySelectorAll(':scope>tfoot>tr').length !== 0) {
var tfoot = node.querySelectorAll(':scope>tfoot>tr');
// tfoot>tr can have td and th children, although th are not very screen reader friendly
for (i = 0; i < tfoot.length; ++i) {
rows.push(iterateRow(tfoot[i]));
}
}
// lastly look for naked tr
if (node.querySelectorAll(':scope>tr').length !== 0) {
var tr = node.querySelectorAll(':scope>tr');
// tfoot>tr can have td and th children, although th are not very screen reader friendly
for (i = 0; i < tr.length; ++i) {
rows.push(iterateRow(tr[i]));
}
}
// TODO: implement or equivalent
if (rows.length === 0) {
// table is empty, return empty text
return txt;
}
// count the first row. We need it to trim the table (if table rows have inconsistent number of columns)
colCount = rows[0].length;
// let's shift the first row as a heading
headings = rows.shift();
for (i = 0; i < headings.length; ++i) {
var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),
align = '---';
if (headings[i].hasAttribute('style')) {
var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, '');
switch (style) {
case 'text-align:left;':
align = ':---';
break;
case 'text-align:right;':
align = '---:';
break;
case 'text-align:center;':
align = ':---:';
break;
}
}
tableArray[0][i] = headContent.trim();
tableArray[1][i] = align;
}
// now iterate through the rows and create the pseudo output (not pretty yet)
for (i = 0; i < rows.length; ++i) {
var r = tableArray.push([]) - 1;
for (ii = 0; ii < colCount; ++ii) {
var cellContent = ' ';
if (typeof rows[i][ii] !== 'undefined') {
// Note: if rows[i][ii] is undefined, it means the row has fewer elements than the header,
// and empty content will be added
cellContent = showdown.subParser('makeMarkdown.tableCell')(rows[i][ii], globals);
}
tableArray[r].push(cellContent);
}
}
// now tidy up the output, aligning cells and stuff
var cellSpacesCount = 3;
for (i = 0; i < tableArray.length; ++i) {
for (ii = 0; ii < tableArray[i].length; ++ii) {
var strLen = tableArray[i][ii].length;
if (strLen > cellSpacesCount) {
cellSpacesCount = strLen;
}
}
}
for (i = 0; i < tableArray.length; ++i) {
for (ii = 0; ii < tableArray[i].length; ++ii) {
if (i === 1) {
if (tableArray[i][ii].slice(-1) === ':') {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(0, -1), cellSpacesCount - 1, '-') + ':';
} else {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
}
} else {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
}
}
txt += '| ' + tableArray[i].join(' | ') + ' |\n';
}
return txt.trim();
}
);
================================================
FILE: src/subParsers/makemarkdown/tableCell.js
================================================
showdown.subParser('makeMarkdown.tableCell', function (node, options, globals) {
'use strict';
var txt = '';
if (!node.hasChildNodes()) {
return '';
}
var children = node.childNodes,
childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
txt += showdown.subParser('makeMarkdown.node')(children[i], options, globals, true);
}
return txt.trim();
});
================================================
FILE: src/subParsers/makemarkdown/txt.js
================================================
showdown.subParser('makeMarkdown.txt', function (node) {
'use strict';
var txt = node.nodeValue;
// multiple spaces are collapsed
txt = txt.replace(/ +/g, ' ');
// replace the custom ¨NBSP; with a space
txt = txt.replace(/¨NBSP;/g, ' ');
// ", <, > and & should replace escaped html entities
txt = showdown.helper.unescapeHTMLEntities(txt);
// escape markdown magic characters
// emphasis, strong and strikethrough - can appear everywhere
// we also escape pipe (|) because of tables
// and escape ` because of code blocks and spans
txt = txt.replace(/([*_~|`])/g, '\\$1');
// escape > because of blockquotes
txt = txt.replace(/^(\s*)>/g, '\\$1>');
// hash character, only troublesome at the beginning of a line because of headers
txt = txt.replace(/^#/gm, '\\#');
// horizontal rules
txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
// dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
// +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
// images and links, ] followed by ( is problematic, so we escape it
txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
// reference URIs must also be escaped
txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
return txt;
});
================================================
FILE: test/bootstrap.js
================================================
//.webstorm.bootstrap.js
var chai = require('chai');
global.chai = chai;
global.expect = chai.expect;
global.showdown = require('../.build/showdown.js');
global.getDefaultOpts = require('./optionswp.js').getDefaultOpts;
================================================
FILE: test/cli/basic.html
================================================
some title
================================================
FILE: test/cli/basic.md
================================================
# some title
================================================
FILE: test/functional/makehtml/cases/commonmark.testsuite.json
================================================
[
{
"end_line": 355,
"section": "Tabs",
"html": "
\n",
"markdown": "\tfoo\tbaz\t\tbim\n",
"example": 1,
"start_line": 350
},
{
"end_line": 362,
"section": "Tabs",
"html": "foo\tbaz\t\tbim\n
\n",
"markdown": " \tfoo\tbaz\t\tbim\n",
"example": 2,
"start_line": 357
},
{
"end_line": 371,
"section": "Tabs",
"html": "foo\tbaz\t\tbim\n
\n",
"markdown": " a\ta\n ὐ\ta\n",
"example": 3,
"start_line": 364
},
{
"end_line": 388,
"section": "Tabs",
"html": "a\ta\nὐ\ta\n\n
\n",
"markdown": " - foo\n\n\tbar\n",
"example": 4,
"start_line": 377
},
{
"end_line": 402,
"section": "Tabs",
"html": "\n
\n",
"markdown": "- foo\n\n\t\tbar\n",
"example": 5,
"start_line": 390
},
{
"end_line": 420,
"section": "Tabs",
"html": "
\n bar\n\n
\n",
"markdown": ">\t\tfoo\n",
"example": 6,
"start_line": 413
},
{
"end_line": 431,
"section": "Tabs",
"html": "
\n foo\n\n
\n",
"markdown": "-\t\tfoo\n",
"example": 7,
"start_line": 422
},
{
"end_line": 441,
"section": "Tabs",
"html": "
\n foo\n
\n",
"markdown": " foo\n\tbar\n",
"example": 8,
"start_line": 434
},
{
"end_line": 459,
"section": "Tabs",
"html": "foo\nbar\n\n
\n",
"markdown": " - foo\n - bar\n\t - baz\n",
"example": 9,
"start_line": 443
},
{
"end_line": 465,
"section": "Tabs",
"html": "\n
\n\n
\nFoo
\n",
"markdown": "#\tFoo\n",
"example": 10,
"start_line": 461
},
{
"end_line": 471,
"section": "Tabs",
"html": "
\n",
"markdown": "*\t*\t*\t\n",
"example": 11,
"start_line": 467
},
{
"end_line": 502,
"section": "Precedence",
"html": "\n
\n",
"markdown": "- `one\n- two`\n",
"example": 12,
"start_line": 494
},
{
"end_line": 541,
"section": "Thematic breaks",
"html": "
\n
\n
\n",
"markdown": "***\n\n---\n\n___\n\n",
"example": 13,
"start_line": 533
},
{
"end_line": 550,
"section": "Thematic breaks",
"html": "
\n
\n
\n",
"markdown": " ***\n ***\n ***\n",
"example": 17,
"start_line": 575
},
{
"end_line": 593,
"section": "Thematic breaks",
"html": "
\n",
"markdown": " ***\n",
"example": 18,
"start_line": 588
},
{
"end_line": 602,
"section": "Thematic breaks",
"html": "***\n
\n",
"markdown": "_____________________________________\n",
"example": 20,
"start_line": 607
},
{
"end_line": 620,
"section": "Thematic breaks",
"html": "
\n",
"markdown": " - - -\n",
"example": 21,
"start_line": 616
},
{
"end_line": 627,
"section": "Thematic breaks",
"html": "
\n",
"markdown": " ** * ** * ** * **\n",
"example": 22,
"start_line": 623
},
{
"end_line": 634,
"section": "Thematic breaks",
"html": "
\n",
"markdown": "- - - -\n",
"example": 23,
"start_line": 630
},
{
"end_line": 643,
"section": "Thematic breaks",
"html": "
\n",
"markdown": "- - - - \n",
"example": 24,
"start_line": 639
},
{
"end_line": 658,
"section": "Thematic breaks",
"html": "\n
\n
\n\n
\n",
"markdown": "- foo\n***\n- bar\n",
"example": 27,
"start_line": 673
},
{
"end_line": 698,
"section": "Thematic breaks",
"html": "
\nFoo
\n\n
\n
\n\n
\n",
"markdown": "* Foo\n* * *\n* Bar\n",
"example": 30,
"start_line": 720
},
{
"end_line": 747,
"section": "Thematic breaks",
"html": "\n
\n",
"markdown": "- Foo\n- * * *\n",
"example": 31,
"start_line": 737
},
{
"end_line": 780,
"section": "ATX headings",
"html": "
\nfoo
\nfoo
\nfoo
\nfoo
\nfoo
\nfoo
\n",
"markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n",
"example": 32,
"start_line": 766
},
{
"end_line": 789,
"section": "ATX headings",
"html": "foo bar *baz*
\n",
"markdown": "# foo *bar* \\*baz\\*\n",
"example": 36,
"start_line": 821
},
{
"end_line": 834,
"section": "ATX headings",
"html": "foo
\n",
"markdown": "# foo \n",
"example": 37,
"start_line": 830
},
{
"end_line": 847,
"section": "ATX headings",
"html": "foo
\nfoo
\nfoo
\n",
"markdown": " ### foo\n ## foo\n # foo\n",
"example": 38,
"start_line": 839
},
{
"end_line": 857,
"section": "ATX headings",
"html": "
\n",
"markdown": " # foo\n",
"example": 39,
"start_line": 852
},
{
"end_line": 866,
"section": "ATX headings",
"html": "# foo\nfoo
\nbar
\n",
"markdown": "## foo ##\n ### bar ###\n",
"example": 41,
"start_line": 871
},
{
"end_line": 888,
"section": "ATX headings",
"html": "foo
\nfoo
\n",
"markdown": "# foo ##################################\n##### foo ##\n",
"example": 42,
"start_line": 882
},
{
"end_line": 897,
"section": "ATX headings",
"html": "foo
\n",
"markdown": "### foo ### \n",
"example": 43,
"start_line": 893
},
{
"end_line": 908,
"section": "ATX headings",
"html": "foo ### b
\n",
"markdown": "### foo ### b\n",
"example": 44,
"start_line": 904
},
{
"end_line": 917,
"section": "ATX headings",
"html": "foo#
\n",
"markdown": "# foo#\n",
"example": 45,
"start_line": 913
},
{
"end_line": 931,
"section": "ATX headings",
"html": "foo ###
\nfoo ###
\nfoo #
\n",
"markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n",
"example": 46,
"start_line": 923
},
{
"end_line": 945,
"section": "ATX headings",
"html": "
\nfoo
\n
\n",
"markdown": "****\n## foo\n****\n",
"example": 47,
"start_line": 937
},
{
"end_line": 956,
"section": "ATX headings",
"html": "baz
\nFoo bar
\nFoo bar
\n",
"markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n",
"example": 50,
"start_line": 1004
},
{
"end_line": 1025,
"section": "Setext headings",
"html": "Foo bar\nbaz
\n",
"markdown": "Foo *bar\nbaz*\n====\n",
"example": 51,
"start_line": 1018
},
{
"end_line": 1039,
"section": "Setext headings",
"html": "Foo
\nFoo
\n",
"markdown": "Foo\n-------------------------\n\nFoo\n=\n",
"example": 52,
"start_line": 1030
},
{
"end_line": 1058,
"section": "Setext headings",
"html": "Foo
\nFoo
\nFoo
\n",
"markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n",
"example": 53,
"start_line": 1045
},
{
"end_line": 1076,
"section": "Setext headings",
"html": "
\nFoo\n---\n\nFoo\n
\n",
"markdown": " Foo\n ---\n\n Foo\n---\n",
"example": 54,
"start_line": 1063
},
{
"end_line": 1087,
"section": "Setext headings",
"html": "Foo
\n",
"markdown": "Foo\n ---- \n",
"example": 55,
"start_line": 1082
},
{
"end_line": 1098,
"section": "Setext headings",
"html": "
\n",
"markdown": "Foo\n= =\n\nFoo\n--- -\n",
"example": 57,
"start_line": 1103
},
{
"end_line": 1124,
"section": "Setext headings",
"html": "Foo
\n",
"markdown": "Foo \n-----\n",
"example": 58,
"start_line": 1119
},
{
"end_line": 1134,
"section": "Setext headings",
"html": "Foo\\
\n",
"markdown": "Foo\\\n----\n",
"example": 59,
"start_line": 1129
},
{
"end_line": 1153,
"section": "Setext headings",
"html": "`Foo
\n<a title="a lot
\n\n
\n
\n",
"markdown": "> Foo\n---\n",
"example": 61,
"start_line": 1159
},
{
"end_line": 1180,
"section": "Setext headings",
"html": "\n
\n",
"markdown": "> foo\nbar\n===\n",
"example": 62,
"start_line": 1170
},
{
"end_line": 1191,
"section": "Setext headings",
"html": "\n
\n
\n",
"markdown": "- Foo\n---\n",
"example": 63,
"start_line": 1183
},
{
"end_line": 1205,
"section": "Setext headings",
"html": "Foo\nBar
\n",
"markdown": "Foo\nBar\n---\n",
"example": 64,
"start_line": 1198
},
{
"end_line": 1223,
"section": "Setext headings",
"html": "
\nFoo
\nBar
\n
\n
\n",
"markdown": "---\n---\n",
"example": 67,
"start_line": 1240
},
{
"end_line": 1257,
"section": "Setext headings",
"html": "\n
\n
\n",
"markdown": "- foo\n-----\n",
"example": 68,
"start_line": 1249
},
{
"end_line": 1267,
"section": "Setext headings",
"html": "
\nfoo\n
\n",
"markdown": " foo\n---\n",
"example": 69,
"start_line": 1260
},
{
"end_line": 1278,
"section": "Setext headings",
"html": "\n
\n
\n",
"markdown": "> foo\n-----\n",
"example": 70,
"start_line": 1270
},
{
"end_line": 1289,
"section": "Setext headings",
"html": "> foo
\n",
"markdown": "\\> foo\n------\n",
"example": 71,
"start_line": 1284
},
{
"end_line": 1325,
"section": "Setext headings",
"html": "bar
\n
\n
\n
\n",
"markdown": " a simple\n indented code block\n",
"example": 76,
"start_line": 1392
},
{
"end_line": 1417,
"section": "Indented code blocks",
"html": "a simple\n indented code block\n\n
\n",
"markdown": " - foo\n\n bar\n",
"example": 77,
"start_line": 1406
},
{
"end_line": 1433,
"section": "Indented code blocks",
"html": "\n
\n",
"markdown": "1. foo\n\n - bar\n",
"example": 78,
"start_line": 1420
},
{
"end_line": 1451,
"section": "Indented code blocks",
"html": "\n
\n
\n",
"markdown": " \n *hi*\n\n - one\n",
"example": 79,
"start_line": 1440
},
{
"end_line": 1473,
"section": "Indented code blocks",
"html": "<a/>\n*hi*\n\n- one\n
\n",
"markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n",
"example": 80,
"start_line": 1456
},
{
"end_line": 1488,
"section": "Indented code blocks",
"html": "chunk1\n\nchunk2\n\n\n\nchunk3\n
\n",
"markdown": " chunk1\n \n chunk2\n",
"example": 81,
"start_line": 1479
},
{
"end_line": 1501,
"section": "Indented code blocks",
"html": "chunk1\n \n chunk2\n
\nfoo\nHeading
\n
\nfoo\nHeading
\n
\nfoo\n
\n",
"markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n",
"example": 84,
"start_line": 1521
},
{
"end_line": 1548,
"section": "Indented code blocks",
"html": "
\n",
"markdown": " foo\n bar\n",
"example": 85,
"start_line": 1541
},
{
"end_line": 1563,
"section": "Indented code blocks",
"html": " foo\nbar\n
\n",
"markdown": "\n \n foo\n \n\n",
"example": 86,
"start_line": 1554
},
{
"end_line": 1573,
"section": "Indented code blocks",
"html": "foo\n
\n",
"markdown": " foo \n",
"example": 87,
"start_line": 1568
},
{
"end_line": 1632,
"section": "Fenced code blocks",
"html": "foo \n
\n",
"markdown": "```\n<\n >\n```\n",
"example": 88,
"start_line": 1623
},
{
"end_line": 1646,
"section": "Fenced code blocks",
"html": "<\n >\n
\n",
"markdown": "~~~\n<\n >\n~~~\n",
"example": 89,
"start_line": 1637
},
{
"end_line": 1656,
"section": "Fenced code blocks",
"html": "<\n >\nfoo
\n",
"markdown": "```\naaa\n~~~\n```\n",
"example": 91,
"start_line": 1661
},
{
"end_line": 1682,
"section": "Fenced code blocks",
"html": "aaa\n~~~\n
\n",
"markdown": "~~~\naaa\n```\n~~~\n",
"example": 92,
"start_line": 1673
},
{
"end_line": 1696,
"section": "Fenced code blocks",
"html": "aaa\n```\n
\n",
"markdown": "````\naaa\n```\n``````\n",
"example": 93,
"start_line": 1687
},
{
"end_line": 1708,
"section": "Fenced code blocks",
"html": "aaa\n```\n
\n",
"markdown": "~~~~\naaa\n~~~\n~~~~\n",
"example": 94,
"start_line": 1699
},
{
"end_line": 1718,
"section": "Fenced code blocks",
"html": "aaa\n~~~\n
\n",
"markdown": "```\n",
"example": 95,
"start_line": 1714
},
{
"end_line": 1731,
"section": "Fenced code blocks",
"html": "
\n",
"markdown": "`````\n\n```\naaa\n",
"example": 96,
"start_line": 1721
},
{
"end_line": 1745,
"section": "Fenced code blocks",
"html": "\n```\naaa\n\n
\n
\naaa\n
\n",
"markdown": "```\n\n \n```\n",
"example": 98,
"start_line": 1750
},
{
"end_line": 1769,
"section": "Fenced code blocks",
"html": "\n \n
\n",
"markdown": "```\n```\n",
"example": 99,
"start_line": 1764
},
{
"end_line": 1785,
"section": "Fenced code blocks",
"html": "
\n",
"markdown": " ```\n aaa\naaa\n```\n",
"example": 100,
"start_line": 1776
},
{
"end_line": 1799,
"section": "Fenced code blocks",
"html": "aaa\naaa\n
\n",
"markdown": " ```\naaa\n aaa\naaa\n ```\n",
"example": 101,
"start_line": 1788
},
{
"end_line": 1813,
"section": "Fenced code blocks",
"html": "aaa\naaa\naaa\n
\n",
"markdown": " ```\n aaa\n aaa\n aaa\n ```\n",
"example": 102,
"start_line": 1802
},
{
"end_line": 1827,
"section": "Fenced code blocks",
"html": "aaa\n aaa\naaa\n
\n",
"markdown": " ```\n aaa\n ```\n",
"example": 103,
"start_line": 1818
},
{
"end_line": 1840,
"section": "Fenced code blocks",
"html": "```\naaa\n```\n
\n",
"markdown": "```\naaa\n ```\n",
"example": 104,
"start_line": 1833
},
{
"end_line": 1850,
"section": "Fenced code blocks",
"html": "aaa\n
\n",
"markdown": " ```\naaa\n ```\n",
"example": 105,
"start_line": 1843
},
{
"end_line": 1863,
"section": "Fenced code blocks",
"html": "aaa\n
\n",
"markdown": "```\naaa\n ```\n",
"example": 106,
"start_line": 1855
},
{
"end_line": 1875,
"section": "Fenced code blocks",
"html": "aaa\n ```\n\naaa
\n",
"markdown": "~~~~~~\naaa\n~~~ ~~\n",
"example": 108,
"start_line": 1878
},
{
"end_line": 1903,
"section": "Fenced code blocks",
"html": "aaa\n~~~ ~~\n
\nbar\nfoo
\n
\nbar\nbaz
\n",
"markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n",
"example": 110,
"start_line": 1909
},
{
"end_line": 1940,
"section": "Fenced code blocks",
"html": "
\n",
"markdown": "```ruby\ndef foo(x)\n return 3\nend\n```\n",
"example": 111,
"start_line": 1929
},
{
"end_line": 1954,
"section": "Fenced code blocks",
"html": "def foo(x)\n return 3\nend\n
\n",
"markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n",
"example": 112,
"start_line": 1943
},
{
"end_line": 1962,
"section": "Fenced code blocks",
"html": "def foo(x)\n return 3\nend\n
\n",
"markdown": "````;\n````\n",
"example": 113,
"start_line": 1957
},
{
"end_line": 1973,
"section": "Fenced code blocks",
"html": "aa\nfoo
\n",
"markdown": "```\n``` aaa\n```\n",
"example": 115,
"start_line": 1978
},
{
"end_line": 2070,
"section": "HTML blocks",
"html": "``` aaa\n
\n",
"markdown": "\n \n**Hello**,\n
\n
\n",
"example": 116,
"start_line": 2055
},
{
"end_line": 2103,
"section": "HTML blocks",
"html": "\n \n**Hello**,\n\n_world_.\n
\n\n
\n\n \n\n hi\n \n \n
\n\nokay.\n",
"example": 117,
"start_line": 2084
},
{
"end_line": 2114,
"section": "HTML blocks",
"html": " \n \n\n hi\n \n
\n",
"markdown": "\nfoo\n
\n",
"example": 128,
"start_line": 2225
},
{
"end_line": 2252,
"section": "HTML blocks",
"html": "\n``` c\nint x = 33;\n```\n",
"markdown": "\n``` c\nint x = 33;\n```\n",
"example": 129,
"start_line": 2242
},
{
"end_line": 2267,
"section": "HTML blocks",
"html": "\n*bar*\n\n",
"markdown": "\n*bar*\n\n",
"example": 130,
"start_line": 2259
},
{
"end_line": 2280,
"section": "HTML blocks",
"html": "\nfoo\n \n*foo*\n\n",
"markdown": "\n*foo*\n\n",
"example": 134,
"start_line": 2309
},
{
"end_line": 2334,
"section": "HTML blocks",
"html": "\n\n",
"markdown": "\n\n*foo*\n\n\n",
"example": 135,
"start_line": 2324
},
{
"end_line": 2346,
"section": "HTML blocks",
"html": "foo*foo*\n",
"example": 136,
"start_line": 2342
},
{
"end_line": 2374,
"section": "HTML blocks",
"html": "
\n\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay\n",
"example": 137,
"start_line": 2358
},
{
"end_line": 2393,
"section": "HTML blocks",
"html": "\n\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\n",
"markdown": " \n\n \n",
"example": 150,
"start_line": 2576
},
{
"end_line": 2595,
"section": "HTML blocks",
"html": " <!-- foo -->\n
\n",
"markdown": " <div>\n\n
\n",
"markdown": "\n \n\nHi\n \n\n\n
\n",
"example": 157,
"start_line": 2708
},
{
"end_line": 2756,
"section": "HTML blocks",
"html": "\n\n \n\n\nHi\n \n\n\n
\n",
"markdown": "\n \n
\n <td>\n Hi\n</td>\n\n\n
\n",
"example": 158,
"start_line": 2735
},
{
"end_line": 2789,
"section": "Link reference definitions",
"html": "\n",
"markdown": "[foo]: /url \"title\"\n\n[foo]\n",
"example": 159,
"start_line": 2783
},
{
"end_line": 2800,
"section": "Link reference definitions",
"html": "\n",
"markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n",
"example": 160,
"start_line": 2792
},
{
"end_line": 2809,
"section": "Link reference definitions",
"html": "\n",
"markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n",
"example": 161,
"start_line": 2803
},
{
"end_line": 2820,
"section": "Link reference definitions",
"html": "\n",
"markdown": "[Foo bar]:\n\n\n \n\n\n Hi\n \n\n
\n[foo]: /url "title"\n
\n[foo]: /url\nFoo
\n\n
\n",
"markdown": "# [Foo]\n[foo]: /url\n> bar\n",
"example": 179,
"start_line": 3026
},
{
"end_line": 3054,
"section": "Link reference definitions",
"html": "\n",
"markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n",
"example": 180,
"start_line": 3041
},
{
"end_line": 3070,
"section": "Link reference definitions",
"html": "\n\n
\n",
"markdown": "[foo]\n\n> [foo]: /url\n",
"example": 181,
"start_line": 3062
},
{
"end_line": 3092,
"section": "Paragraphs",
"html": "
\naaa\n
\nbbbaaa
\n",
"markdown": " \n\naaa\n \n\n# aaa\n\n \n",
"example": 190,
"start_line": 3192
},
{
"end_line": 3268,
"section": "Block quotes",
"html": "\n
\n",
"markdown": "> # Foo\n> bar\n> baz\n",
"example": 191,
"start_line": 3258
},
{
"end_line": 3283,
"section": "Block quotes",
"html": "Foo
\n\n
\n",
"markdown": "># Foo\n>bar\n> baz\n",
"example": 192,
"start_line": 3273
},
{
"end_line": 3298,
"section": "Block quotes",
"html": "Foo
\n\n
\n",
"markdown": " > # Foo\n > bar\n > baz\n",
"example": 193,
"start_line": 3288
},
{
"end_line": 3312,
"section": "Block quotes",
"html": "Foo
\n
\n",
"markdown": " > # Foo\n > bar\n > baz\n",
"example": 194,
"start_line": 3303
},
{
"end_line": 3328,
"section": "Block quotes",
"html": "> # Foo\n> bar\n> baz\n\n
\n",
"markdown": "> # Foo\n> bar\nbaz\n",
"example": 195,
"start_line": 3318
},
{
"end_line": 3344,
"section": "Block quotes",
"html": "Foo
\n\n
\n",
"markdown": "> bar\nbaz\n> foo\n",
"example": 196,
"start_line": 3334
},
{
"end_line": 3366,
"section": "Block quotes",
"html": "\n
\n
\n",
"markdown": "> foo\n---\n",
"example": 197,
"start_line": 3358
},
{
"end_line": 3390,
"section": "Block quotes",
"html": "\n
\n\n
\n\n
\n",
"markdown": "> - foo\n- bar\n",
"example": 198,
"start_line": 3378
},
{
"end_line": 3406,
"section": "Block quotes",
"html": "\n
\n
\nfoo\n
\n",
"markdown": "> foo\n bar\n",
"example": 199,
"start_line": 3396
},
{
"end_line": 3419,
"section": "Block quotes",
"html": "bar\n\n
\n
\n
\n",
"markdown": "> ```\nfoo\n```\n",
"example": 200,
"start_line": 3409
},
{
"end_line": 3433,
"section": "Block quotes",
"html": "\n
\n",
"markdown": "> foo\n - bar\n",
"example": 201,
"start_line": 3425
},
{
"end_line": 3454,
"section": "Block quotes",
"html": "\n
\n",
"markdown": ">\n",
"example": 202,
"start_line": 3449
},
{
"end_line": 3464,
"section": "Block quotes",
"html": "\n
\n",
"markdown": ">\n> \n> \n",
"example": 203,
"start_line": 3457
},
{
"end_line": 3477,
"section": "Block quotes",
"html": "\n
\n",
"markdown": ">\n> foo\n> \n",
"example": 204,
"start_line": 3469
},
{
"end_line": 3493,
"section": "Block quotes",
"html": "\n
\n\n
\n",
"markdown": "> foo\n\n> bar\n",
"example": 205,
"start_line": 3482
},
{
"end_line": 3512,
"section": "Block quotes",
"html": "\n
\n",
"markdown": "> foo\n> bar\n",
"example": 206,
"start_line": 3504
},
{
"end_line": 3526,
"section": "Block quotes",
"html": "\n
\n",
"markdown": "> foo\n>\n> bar\n",
"example": 207,
"start_line": 3517
},
{
"end_line": 3539,
"section": "Block quotes",
"html": "\n
\n",
"markdown": "foo\n> bar\n",
"example": 208,
"start_line": 3531
},
{
"end_line": 3557,
"section": "Block quotes",
"html": "\n
\n
\n\n
\n",
"markdown": "> aaa\n***\n> bbb\n",
"example": 209,
"start_line": 3545
},
{
"end_line": 3571,
"section": "Block quotes",
"html": "\n
\n",
"markdown": "> bar\nbaz\n",
"example": 210,
"start_line": 3563
},
{
"end_line": 3583,
"section": "Block quotes",
"html": "\n
\n\n
\n\n
\n",
"markdown": "> > > foo\nbar\n",
"example": 213,
"start_line": 3602
},
{
"end_line": 3631,
"section": "Block quotes",
"html": "\n
\n\n
\n\n
\n",
"markdown": ">>> foo\n> bar\n>>baz\n",
"example": 214,
"start_line": 3617
},
{
"end_line": 3651,
"section": "Block quotes",
"html": "\n
\n\n
\n\n
\n
\ncode\n\n
\n",
"markdown": "> code\n\n> not code\n",
"example": 215,
"start_line": 3639
},
{
"end_line": 3709,
"section": "List items",
"html": "
\nindented code\n\n
\n",
"markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n",
"example": 216,
"start_line": 3694
},
{
"end_line": 3735,
"section": "List items",
"html": "\n
\n",
"markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n",
"example": 217,
"start_line": 3716
},
{
"end_line": 3758,
"section": "List items",
"html": "
\nindented code\n\n
\n\n
\n\n
\n",
"markdown": "- one\n\n two\n",
"example": 219,
"start_line": 3761
},
{
"end_line": 3785,
"section": "List items",
"html": "\n
\n
\n",
"markdown": " - one\n\n two\n",
"example": 220,
"start_line": 3775
},
{
"end_line": 3799,
"section": "List items",
"html": " two\n\n
\n",
"markdown": " - one\n\n two\n",
"example": 221,
"start_line": 3788
},
{
"end_line": 3825,
"section": "List items",
"html": "\n
\n",
"markdown": " > > 1. one\n>>\n>> two\n",
"example": 222,
"start_line": 3810
},
{
"end_line": 3850,
"section": "List items",
"html": "\n
\n\n
\n\n
\n",
"markdown": ">>- one\n>>\n > > two\n",
"example": 223,
"start_line": 3837
},
{
"end_line": 3863,
"section": "List items",
"html": "\n
\n\n
\n\n
\n",
"markdown": "- foo\n\n\n bar\n",
"example": 225,
"start_line": 3869
},
{
"end_line": 3908,
"section": "List items",
"html": "\n
\n",
"markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n",
"example": 226,
"start_line": 3886
},
{
"end_line": 3932,
"section": "List items",
"html": "
\nbar\n\n
\n\n
\n",
"markdown": "- Foo\n\n bar\n\n\n baz\n",
"example": 227,
"start_line": 3914
},
{
"end_line": 3942,
"section": "List items",
"html": "
\nbar\n\n\nbaz\n\n
\n",
"markdown": "123456789. ok\n",
"example": 228,
"start_line": 3936
},
{
"end_line": 3949,
"section": "List items",
"html": "\n
\n",
"markdown": "0. ok\n",
"example": 230,
"start_line": 3954
},
{
"end_line": 3969,
"section": "List items",
"html": "\n
\n",
"markdown": "003. ok\n",
"example": 231,
"start_line": 3963
},
{
"end_line": 3978,
"section": "List items",
"html": "\n
\n",
"markdown": "- foo\n\n bar\n",
"example": 233,
"start_line": 3998
},
{
"end_line": 4027,
"section": "List items",
"html": "
\nbar\n\n
\n",
"markdown": " 10. foo\n\n bar\n",
"example": 234,
"start_line": 4015
},
{
"end_line": 4046,
"section": "List items",
"html": "
\nbar\n
\nindented code\n
\n",
"markdown": " indented code\n\nparagraph\n\n more code\n",
"example": 235,
"start_line": 4034
},
{
"end_line": 4065,
"section": "List items",
"html": "more code\n\n
\n",
"markdown": "1. indented code\n\n paragraph\n\n more code\n",
"example": 236,
"start_line": 4049
},
{
"end_line": 4087,
"section": "List items",
"html": "
\nindented code\n
\nmore code\n\n
\n",
"markdown": "1. indented code\n\n paragraph\n\n more code\n",
"example": 237,
"start_line": 4071
},
{
"end_line": 4105,
"section": "List items",
"html": "
\n indented code\n
\nmore code\n\n
\n\n
\n",
"markdown": "- foo\n\n bar\n",
"example": 240,
"start_line": 4125
},
{
"end_line": 4174,
"section": "List items",
"html": "\n
\n",
"markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n",
"example": 241,
"start_line": 4153
},
{
"end_line": 4186,
"section": "List items",
"html": "
\nbar\n
\nbaz\n\n
\n",
"markdown": "- \n foo\n",
"example": 242,
"start_line": 4179
},
{
"end_line": 4202,
"section": "List items",
"html": "\n\n
\n\n
\n",
"markdown": "- foo\n-\n- bar\n",
"example": 244,
"start_line": 4207
},
{
"end_line": 4232,
"section": "List items",
"html": "\n
\n",
"markdown": "- foo\n- \n- bar\n",
"example": 245,
"start_line": 4222
},
{
"end_line": 4247,
"section": "List items",
"html": "\n
\n",
"markdown": "1. foo\n2.\n3. bar\n",
"example": 246,
"start_line": 4237
},
{
"end_line": 4258,
"section": "List items",
"html": "\n\n
\n",
"markdown": "*\n",
"example": 247,
"start_line": 4252
},
{
"end_line": 4273,
"section": "List items",
"html": "\n
\n",
"markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n",
"example": 249,
"start_line": 4284
},
{
"end_line": 4327,
"section": "List items",
"html": "
\nindented code\n\n
\n\n
\n",
"markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n",
"example": 250,
"start_line": 4308
},
{
"end_line": 4351,
"section": "List items",
"html": "
\nindented code\n\n
\n\n
\n",
"markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n",
"example": 251,
"start_line": 4332
},
{
"end_line": 4371,
"section": "List items",
"html": "
\nindented code\n\n
\n
\n",
"markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n",
"example": 252,
"start_line": 4356
},
{
"end_line": 4405,
"section": "List items",
"html": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n\n
\n",
"markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n",
"example": 253,
"start_line": 4386
},
{
"end_line": 4418,
"section": "List items",
"html": "
\nindented code\n\n
\n\n
\n",
"markdown": " 1. A paragraph\n with two lines.\n",
"example": 254,
"start_line": 4410
},
{
"end_line": 4437,
"section": "List items",
"html": "\n
\n",
"markdown": "> 1. > Blockquote\ncontinued here.\n",
"example": 255,
"start_line": 4423
},
{
"end_line": 4454,
"section": "List items",
"html": "\n
\n\n
\n\n
\n",
"markdown": "> 1. > Blockquote\n> continued here.\n",
"example": 256,
"start_line": 4440
},
{
"end_line": 4488,
"section": "List items",
"html": "\n
\n\n
\n\n
\n",
"markdown": "- foo\n - bar\n - baz\n - boo\n",
"example": 257,
"start_line": 4467
},
{
"end_line": 4505,
"section": "List items",
"html": "\n
\n\n
\n\n
\n\n
\n",
"markdown": "- foo\n - bar\n - baz\n - boo\n",
"example": 258,
"start_line": 4493
},
{
"end_line": 4521,
"section": "List items",
"html": "\n
\n",
"markdown": "10) foo\n - bar\n",
"example": 259,
"start_line": 4510
},
{
"end_line": 4536,
"section": "List items",
"html": "\n
\n\n
\n\n
\n",
"markdown": "10) foo\n - bar\n",
"example": 260,
"start_line": 4526
},
{
"end_line": 4551,
"section": "List items",
"html": "\n
\n",
"markdown": "- - foo\n",
"example": 261,
"start_line": 4541
},
{
"end_line": 4568,
"section": "List items",
"html": "\n
\n\n
\n",
"markdown": "1. - 2. foo\n",
"example": 262,
"start_line": 4554
},
{
"end_line": 4587,
"section": "List items",
"html": "\n
\n\n
\n\n
\n",
"markdown": "- # Foo\n- Bar\n ---\n baz\n",
"example": 263,
"start_line": 4573
},
{
"end_line": 4821,
"section": "Lists",
"html": "Foo
\nBar
\nbaz\n
\n\n
\n",
"markdown": "- foo\n- bar\n+ baz\n",
"example": 264,
"start_line": 4809
},
{
"end_line": 4836,
"section": "Lists",
"html": "\n
\n\n
\n",
"markdown": "1. foo\n2. bar\n3) baz\n",
"example": 265,
"start_line": 4824
},
{
"end_line": 4853,
"section": "Lists",
"html": "\n
\n",
"markdown": "Foo\n- bar\n- baz\n",
"example": 266,
"start_line": 4843
},
{
"end_line": 4926,
"section": "Lists",
"html": "\n
\n",
"markdown": "The number of windows in my house is\n1. The number of doors is 6.\n",
"example": 268,
"start_line": 4930
},
{
"end_line": 4963,
"section": "Lists",
"html": "\n
\n",
"markdown": "- foo\n\n- bar\n\n\n- baz\n",
"example": 269,
"start_line": 4944
},
{
"end_line": 4987,
"section": "Lists",
"html": "\n
\n",
"markdown": "- foo\n - bar\n - baz\n\n\n bim\n",
"example": 270,
"start_line": 4965
},
{
"end_line": 5013,
"section": "Lists",
"html": "\n
\n\n
\n\n
\n\n\n
\n",
"markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n",
"example": 271,
"start_line": 4995
},
{
"end_line": 5039,
"section": "Lists",
"html": "\n
\n\n
\n",
"markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n",
"example": 272,
"start_line": 5016
},
{
"end_line": 5069,
"section": "Lists",
"html": "code\n\n
\n",
"markdown": "- a\n - b\n - c\n - d\n - e\n - f\n - g\n - h\n- i\n",
"example": 273,
"start_line": 5047
},
{
"end_line": 5090,
"section": "Lists",
"html": "\n
\n",
"markdown": "1. a\n\n 2. b\n\n 3. c\n",
"example": 274,
"start_line": 5072
},
{
"end_line": 5113,
"section": "Lists",
"html": "\n
\n",
"markdown": "- a\n- b\n\n- c\n",
"example": 275,
"start_line": 5096
},
{
"end_line": 5133,
"section": "Lists",
"html": "\n
\n",
"markdown": "* a\n*\n\n* c\n",
"example": 276,
"start_line": 5118
},
{
"end_line": 5159,
"section": "Lists",
"html": "\n
\n",
"markdown": "- a\n- b\n\n c\n- d\n",
"example": 277,
"start_line": 5140
},
{
"end_line": 5180,
"section": "Lists",
"html": "\n
\n",
"markdown": "- a\n- b\n\n [ref]: /url\n- d\n",
"example": 278,
"start_line": 5162
},
{
"end_line": 5204,
"section": "Lists",
"html": "\n
\n",
"markdown": "- a\n- ```\n b\n\n\n ```\n- c\n",
"example": 279,
"start_line": 5185
},
{
"end_line": 5229,
"section": "Lists",
"html": "
\nb\n\n\n\n
\n",
"markdown": "- a\n - b\n\n c\n- d\n",
"example": 280,
"start_line": 5211
},
{
"end_line": 5249,
"section": "Lists",
"html": "\n
\n\n
\n",
"markdown": "* a\n > b\n >\n* c\n",
"example": 281,
"start_line": 5235
},
{
"end_line": 5273,
"section": "Lists",
"html": "\n
\n\n
\n",
"markdown": "- a\n > b\n ```\n c\n ```\n- d\n",
"example": 282,
"start_line": 5255
},
{
"end_line": 5284,
"section": "Lists",
"html": "\n
\n
\nc\n\n
\n",
"markdown": "- a\n",
"example": 283,
"start_line": 5278
},
{
"end_line": 5298,
"section": "Lists",
"html": "\n
\n",
"markdown": "- a\n - b\n",
"example": 284,
"start_line": 5287
},
{
"end_line": 5318,
"section": "Lists",
"html": "\n
\n\n
\n",
"markdown": "1. ```\n foo\n ```\n\n bar\n",
"example": 285,
"start_line": 5304
},
{
"end_line": 5338,
"section": "Lists",
"html": "
\nfoo\n\n
\n",
"markdown": "* foo\n * bar\n\n baz\n",
"example": 286,
"start_line": 5323
},
{
"end_line": 5366,
"section": "Lists",
"html": "\n
\n\n
\n",
"markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n",
"example": 287,
"start_line": 5341
},
{
"end_line": 5379,
"section": "Inlines",
"html": "\n
\n\n
\nhilo`
not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n",
"example": 291,
"start_line": 5409
},
{
"end_line": 5436,
"section": "Backslash escapes",
"html": "
\nbar\\[\\`
\n",
"markdown": " \\[\\]\n",
"example": 295,
"start_line": 5460
},
{
"end_line": 5475,
"section": "Backslash escapes",
"html": "\\[\\]\n
\n",
"markdown": "~~~\n\\[\\]\n~~~\n",
"example": 296,
"start_line": 5468
},
{
"end_line": 5482,
"section": "Backslash escapes",
"html": "\n",
"markdown": "\\[\\]\n
\n",
"markdown": "``` foo\\+bar\nfoo\n```\n",
"example": 301,
"start_line": 5511
},
{
"end_line": 5546,
"section": "Entity and numeric character references",
"html": "foo\n
\n",
"markdown": "``` föö\nfoo\n```\n",
"example": 311,
"start_line": 5636
},
{
"end_line": 5653,
"section": "Entity and numeric character references",
"html": "foo\nföö
\n",
"markdown": " föfö\n",
"example": 313,
"start_line": 5656
},
{
"end_line": 5682,
"section": "Code spans",
"html": "föfö\nfoofoo ` bar``foofoo bar baza bfoo `` barfoo\\bar`*link](/foo)<a href="">`<http://foo.bar.baz>`bar\n",
"example": 452,
"start_line": 7118
},
{
"end_line": 7129,
"section": "Emphasis and strong emphasis",
"html": "\n",
"markdown": "**\n",
"example": 453,
"start_line": 7125
},
{
"end_line": 7136,
"section": "Emphasis and strong emphasis",
"html": "\n",
"markdown": "__\n",
"example": 454,
"start_line": 7132
},
{
"end_line": 7143,
"section": "Emphasis and strong emphasis",
"html": "
*_](/uri)][ref]




\n[]
\nbaz
\nbaz
\nbaz
\nbar
\nbar
\nbar
\nbarcode spancode\\ spanfoo\\
\n",
"markdown": "### foo\\\n",
"example": 618,
"start_line": 9000
},
{
"end_line": 9011,
"section": "Hard line breaks",
"html": "foo
\n",
"markdown": "### foo \n",
"example": 619,
"start_line": 9007
},
{
"end_line": 9028,
"section": "Soft line breaks",
"html": "

strikethrough wordstrike-through text~~strikethough inside code span~~my things
some markdown
wrapped linetest* (@test) updated his/her descriptionmarkdown doc
================================================
FILE: test/functional/makehtml/cases/features/#259.es6-template-strings-indentation-issues.md
================================================
## markdown doc
you can use markdown for card documentation
- foo
- bar
================================================
FILE: test/functional/makehtml/cases/features/#284.simplifiedAutoLink-does-not-match-GFM-style.html
================================================
simple linebreakstesting
some
code
to the first list item
also
text
item
list item
text
================================================
FILE: test/functional/makehtml/cases/features/#316.new-simpleLineBreaks-option-breaks-lists.md
================================================
1. One
2. Two
- A
- B
3. Three
> this has
> simple linebreaks
testing
some
code
1. paragraphed list
this belongs
to the first list item
2. This text
also
simple
text
- a list
item
- another
list item
simple
text
- some item
another
paragraph
- And
now
paragraph
sublist
- and
even
another
one
- foo
================================================
FILE: test/functional/makehtml/cases/features/#318.simpleLineBreaks-does-not-work-with-chinese-characters.html
================================================
paragraph
now
sublist
even
one
bar
barsome header
some header with &+$,/:;=?@\"#{}|^~[]`\*()%.!' chars
another header > with < chars
================================================
FILE: test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.md
================================================
# some header
# some header with &+$,/:;=?@\"#{}|^~[]`\\*()%.!' chars
# another header > with < chars
================================================
FILE: test/functional/makehtml/cases/features/#323.simpleLineBreaks-breaks-with-strong.html
================================================
Nom : aaatestGiven
When
Then
foo
bar
================================================
FILE: test/functional/makehtml/cases/features/#69.header-level-start.md
================================================
#Given
#When
#Then
foo
===
bar
---
================================================
FILE: test/functional/makehtml/cases/features/#709.allow-whitespaces-after-end-in-metadata.html
================================================
================================================
FILE: test/functional/makehtml/cases/features/#709.allow-whitespaces-after-end-in-metadata.md
================================================
---
title: This is the document title
language: en
author: Tivie
---
**some** markdown text
- a list
- another list ---
- and stuff
a paragraph --- with dashes
---
================================================
FILE: test/functional/makehtml/cases/features/completeHTMLOutput/simple.html
================================================
================================================
FILE: test/functional/makehtml/cases/features/completeHTMLOutput/simple.md
================================================
This is a **markdown** file
Converted into a full HTML document
- this
- is
- awesome
================================================
FILE: test/functional/makehtml/cases/features/customizedHeaderId-simple.html
================================================
Просто заголовок
Header without curly braces
Headers with multiple braces {braces} {are}
Header
================================================
FILE: test/functional/makehtml/cases/features/customizedHeaderId-simple.md
================================================
# Просто заголовок {simple}
# Header without curly braces
# Headers with multiple braces {braces} {are} {cool}
# Header{withoutspace}
================================================
FILE: test/functional/makehtml/cases/features/disable-email-encoding.html
================================================
php
function thisThing() {
echo "some weird formatted code!";
}
================================================
FILE: test/functional/makehtml/cases/features/disableForced4SpacesIndentedSublists.md
================================================
* foo
* bar
---
* baz
1. bazinga
================================================
FILE: test/functional/makehtml/cases/features/ellipsis/ellipsis.html
================================================
ellipsis in code...
ellipsis in code...
ellipsis in header...
![]()
================================================
FILE: test/functional/makehtml/cases/features/literalMidWordAsterisks/punctation-test.md
================================================
**Bold:**
**Bold**
**Bold**:
- **Bold**
- Tier 2
================================================
FILE: test/functional/makehtml/cases/features/literalMidWordUnderscores/basic.html
================================================
================================================
FILE: test/functional/makehtml/cases/features/literalMidWordUnderscores/punctation-test.md
================================================
__Bold:__
__Bold__
__Bold__:
- __Bold__
- Tier 2
================================================
FILE: test/functional/makehtml/cases/features/metadata/dashes-conflict.html
================================================
================================================
FILE: test/functional/makehtml/cases/features/metadata/dashes-conflict.md
================================================
---
title: This is the document title
language: en
author: Tivie
---
**some** markdown text
- a list
- another list ---
- and stuff
a paragraph --- with dashes
---
================================================
FILE: test/functional/makehtml/cases/features/metadata/embeded-in-output.html
================================================
date: 01-01-2010
date: 01-01-2010
================================================
FILE: test/functional/makehtml/cases/features/moreStyling/tasklists-with-styling.md
================================================
- [ ] test
- [x] testing complete
================================================
FILE: test/functional/makehtml/cases/features/openLinksInNewWindow/hash-links-open-in-same-page.html
================================================
foo header
================================================
FILE: test/functional/makehtml/cases/features/prefixHeaderId-simple.md
================================================
# foo header
================================================
FILE: test/functional/makehtml/cases/features/prefixHeaderId-string-and-ghCompatibleHeaderId.html
================================================
foo header
================================================
FILE: test/functional/makehtml/cases/features/prefixHeaderId-string-and-ghCompatibleHeaderId.md
================================================
# foo header
================================================
FILE: test/functional/makehtml/cases/features/prefixHeaderId-string-and-ghCompatibleHeaderId2.html
================================================
foo header
================================================
FILE: test/functional/makehtml/cases/features/prefixHeaderId-string-and-ghCompatibleHeaderId2.md
================================================
# foo header
================================================
FILE: test/functional/makehtml/cases/features/prefixHeaderId-string.html
================================================
foo header
================================================
FILE: test/functional/makehtml/cases/features/prefixHeaderId-string.md
================================================
# foo header
================================================
FILE: test/functional/makehtml/cases/features/rawHeaderId/simple.html
================================================
123 My#very/ strange \header*`^ªº-_., yeah
================================================
FILE: test/functional/makehtml/cases/features/rawHeaderId/simple.md
================================================
# 123 My#very/ strange \header*`^ªº-_., yeah
================================================
FILE: test/functional/makehtml/cases/features/rawHeaderId/with-prefixHeaderId.html
================================================
some header
another !"#$%&/()=?»@£§{[]}«' header
================================================
FILE: test/functional/makehtml/cases/features/rawHeaderId/with-prefixHeaderId.md
================================================
# some header
# another !"#$%&/()=?»@£§{[]}«' header
================================================
FILE: test/functional/makehtml/cases/features/rawPrefixHeaderId/simple-with-prefixHeaderId.html
================================================
some header &/) foo
================================================
FILE: test/functional/makehtml/cases/features/rawPrefixHeaderId/simple-with-prefixHeaderId.md
================================================
# some header &/) foo
================================================
FILE: test/functional/makehtml/cases/features/relativePathBaseUrl.html
================================================




header
this is `a\_test` and this\_too and finally_this_is
================================================
FILE: test/functional/makehtml/cases/features/simpleLineBreaks-handle-html-pre.md
================================================
hmm
this is `a\_test` and this\_too and finally_this_is
================================================
FILE: test/functional/makehtml/cases/features/simpleLineBreaks2.html
================================================
================================================
FILE: test/functional/makehtml/cases/features/simpleLineBreaks2.md
================================================
1. One
2. Two
foo
bar
bazinga
nhecos
3. Three
- foo
- bar
================================================
FILE: test/functional/makehtml/cases/features/simplifiedAutoLink/autolinks-with-magic-chars.html
================================================
foo
bazinga
================================================
FILE: test/functional/makehtml/cases/features/simplifiedAutoLink/blockquote.md
================================================
> http://www.google.com
================================================
FILE: test/functional/makehtml/cases/features/simplifiedAutoLink/codespans.html
================================================
http://www.gmail.com
================================================
FILE: test/functional/makehtml/cases/features/simplifiedAutoLink/does-not-parse-inside-code.md
================================================
some code with
a link
www.google.com
and another link http://www.google.com
================================================
FILE: test/functional/makehtml/cases/features/simplifiedAutoLink/does-not-parse-reference-links.html
================================================
some code with
a link
www.google.com
and another link http://www.google.com

Block quote 1
================================================
FILE: test/functional/makehtml/cases/features/splitAdjacentBlockquotes/basic.md
================================================
> # Block quote 1
>
> This is my first block quote.
> # Block quote 2
>
> This is my second block quote.
================================================
FILE: test/functional/makehtml/cases/features/splitAdjacentBlockquotes/multiline-paragraph.html
================================================
Block quote 2
================================================
FILE: test/functional/makehtml/cases/features/tables/#179.parse-md-in-table-ths.md
================================================
| *foo* | **bar** | ~~baz~~ |
|-------|---------|---------|
| 100 | blabla | aaa |
================================================
FILE: test/functional/makehtml/cases/features/tables/#256.table-header-separators-should-not-require-3-dashes.html
================================================
foo
bar
baz
100
blabla
aaa
================================================
FILE: test/functional/makehtml/cases/features/tables/#256.table-header-separators-should-not-require-3-dashes.md
================================================
|key|value|
|--|--|
|My Key|My Value|
================================================
FILE: test/functional/makehtml/cases/features/tables/#345.escape-pipe-character.html
================================================
key
value
My Key
My Value
================================================
FILE: test/functional/makehtml/cases/features/tables/#345.escape-pipe-character.md
================================================
| Operator | Description |
|----------|-------------|
| & | Logical AND |
| && | Shortcut AND |
| \| | Logical OR |
| \|\| | Shortcut OR |
| ^ | Logical XOR |
================================================
FILE: test/functional/makehtml/cases/features/tables/#406.does-not-render-one-column-tables.html
================================================
Operator
Description
&
Logical AND
&&
Shortcut AND
|
Logical OR
||
Shortcut OR
^
Logical XOR
some header
some content
some header
some header
some content
some content
some content
some content
some content
some header
some content
some header
some content
================================================
FILE: test/functional/makehtml/cases/features/tables/#406.does-not-render-one-column-tables.md
================================================
|some header |
|------------|
|some content|
|some header |
|------------|
|some header |
|------------|
|some content|
|some content|
|some content|
|some content|
|some content|
|some header |
|:-----------|
|some content|
|some header |
|-----------:|
|some content|
|some header |
|:----------:|
|some content|
================================================
FILE: test/functional/makehtml/cases/features/tables/#442.trailing-spaces-break-one-column-tables.html
================================================
some header
some content
================================================
FILE: test/functional/makehtml/cases/features/tables/#442.trailing-spaces-break-one-column-tables.md
================================================
| Single column |
|:--------------|
| Row one |
| Row two |
================================================
FILE: test/functional/makehtml/cases/features/tables/#443.2.table-followed-by-list-does-not-parse-correctly.html
================================================
Single column
Row one
Row two
Tables
col 3 is
col 2 is
zebra stripes
================================================
FILE: test/functional/makehtml/cases/features/tables/#443.2.table-followed-by-list-does-not-parse-correctly.md
================================================
| Tables |
| ------------- |
| **col 3 is** |
| col 2 is |
| zebra stripes |
1. test
================================================
FILE: test/functional/makehtml/cases/features/tables/#443.table-followed-by-list-does-not-parse-correctly.html
================================================
Tables
Are
Cool
col 3 is
right-aligned
$1600
col 2 is
centered
$12
zebra stripes
are neat
$1
================================================
FILE: test/functional/makehtml/cases/features/tables/#443.table-followed-by-list-does-not-parse-correctly.md
================================================
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| **col 3 is** | right-aligned | $1600 |
| col 2 is | *centered* | $12 |
| zebra stripes | are neat | $1 |
1. test
================================================
FILE: test/functional/makehtml/cases/features/tables/#465.code-spans-with-pipes-break-table.html
================================================
================================================
FILE: test/functional/makehtml/cases/features/tables/#465.code-spans-with-pipes-break-table.md
================================================
|PowerShell command|Example|
|--|--|
|Get-Service|`Get-Service | Stop-Service -WhatIf`|
================================================
FILE: test/functional/makehtml/cases/features/tables/#471.ol-is-not-rendered-correctly-inside-table.html
================================================
PowerShell command
Example
Get-Service
Get-Service | Stop-Service -WhatIf
================================================
FILE: test/functional/makehtml/cases/features/tables/#471.ol-is-not-rendered-correctly-inside-table.md
================================================
| h1 | h2 |
|--------:|:---------------------|
| asdf | one `two
h1
h2
asdf
one
two <ol> three three` |
================================================
FILE: test/functional/makehtml/cases/features/tables/basic-alignment.html
================================================
================================================
FILE: test/functional/makehtml/cases/features/tables/basic-alignment.md
================================================
| First Header | Second Header |
| :------------ | :------------ |
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |
================================================
FILE: test/functional/makehtml/cases/features/tables/basic-with-header-ids.html
================================================
First Header
Second Header
Row 1 Cell 1
Row 1 Cell 2
Row 2 Cell 1
Row 2 Cell 2
================================================
FILE: test/functional/makehtml/cases/features/tables/basic-with-header-ids.md
================================================
| First Header | Second Header |
| ------------- | ------------- |
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |
================================================
FILE: test/functional/makehtml/cases/features/tables/basic.html
================================================
First Header
Second Header
Row 1 Cell 1
Row 1 Cell 2
Row 2 Cell 1
Row 2 Cell 2
================================================
FILE: test/functional/makehtml/cases/features/tables/basic.md
================================================
| First Header | Second Header |
| ------------- | ------------- |
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |
================================================
FILE: test/functional/makehtml/cases/features/tables/gh-style-tables.html
================================================
First Header
Second Header
Row 1 Cell 1
Row 1 Cell 2
Row 2 Cell 1
Row 2 Cell 2
================================================
FILE: test/functional/makehtml/cases/features/tables/gh-style-tables.md
================================================
First Header | Second Header|Third Header
------------- | -------------|---
Content Cell | Content Cell|C
Content Cell | Content Cell|C
================================================
FILE: test/functional/makehtml/cases/features/tables/large-table-with-allignments.html
================================================
First Header
Second Header
Third Header
Content Cell
Content Cell
C
Content Cell
Content Cell
C
================================================
FILE: test/functional/makehtml/cases/features/tables/large-table-with-allignments.md
================================================
| First Header | Second Header | Third Header | Fourth Header |
| :------------ |: ----------- :| ------------ :| ------------- |
| Row 1 Cell 1 | Row 1 Cell 2 | Row 1 Cell 3 | Row 1 Cell 4 |
| Row 2 Cell 1 | Row 2 Cell 2 | Row 2 Cell 3 | Row 2 Cell 4 |
| Row 3 Cell 1 | Row 3 Cell 2 | Row 3 Cell 3 | Row 3 Cell 4 |
| Row 4 Cell 1 | Row 4 Cell 2 | Row 4 Cell 3 | Row 4 Cell 4 |
| Row 5 Cell 1 | Row 5 Cell 2 | Row 5 Cell 3 | Row 5 Cell 4 |
================================================
FILE: test/functional/makehtml/cases/features/tables/large.html
================================================
First Header
Second Header
Third Header
Fourth Header
Row 1 Cell 1
Row 1 Cell 2
Row 1 Cell 3
Row 1 Cell 4
Row 2 Cell 1
Row 2 Cell 2
Row 2 Cell 3
Row 2 Cell 4
Row 3 Cell 1
Row 3 Cell 2
Row 3 Cell 3
Row 3 Cell 4
Row 4 Cell 1
Row 4 Cell 2
Row 4 Cell 3
Row 4 Cell 4
Row 5 Cell 1
Row 5 Cell 2
Row 5 Cell 3
Row 5 Cell 4
================================================
FILE: test/functional/makehtml/cases/features/tables/large.md
================================================
| First Header | Second Header | Third Header | Fourth Header |
| ------------- | ------------- | ------------ | ------------- |
| Row 1 Cell 1 | Row 1 Cell 2 | Row 1 Cell 3 | Row 1 Cell 4 |
| Row 2 Cell 1 | Row 2 Cell 2 | Row 2 Cell 3 | Row 2 Cell 4 |
| Row 3 Cell 1 | Row 3 Cell 2 | Row 3 Cell 3 | Row 3 Cell 4 |
| Row 4 Cell 1 | Row 4 Cell 2 | Row 4 Cell 3 | Row 4 Cell 4 |
| Row 5 Cell 1 | Row 5 Cell 2 | Row 5 Cell 3 | Row 5 Cell 4 |
================================================
FILE: test/functional/makehtml/cases/features/tables/mixed-alignment.html
================================================
First Header
Second Header
Third Header
Fourth Header
Row 1 Cell 1
Row 1 Cell 2
Row 1 Cell 3
Row 1 Cell 4
Row 2 Cell 1
Row 2 Cell 2
Row 2 Cell 3
Row 2 Cell 4
Row 3 Cell 1
Row 3 Cell 2
Row 3 Cell 3
Row 3 Cell 4
Row 4 Cell 1
Row 4 Cell 2
Row 4 Cell 3
Row 4 Cell 4
Row 5 Cell 1
Row 5 Cell 2
Row 5 Cell 3
Row 5 Cell 4
================================================
FILE: test/functional/makehtml/cases/features/tables/mixed-alignment.md
================================================
| Left-Aligned | Center-Aligned | Right-Aligned |
| :------------ |:--------------------:| -------------:|
| col 3 is | some wordy paragraph | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
================================================
FILE: test/functional/makehtml/cases/features/tables/multiple-tables.html
================================================
Left-Aligned
Center-Aligned
Right-Aligned
col 3 is
some wordy paragraph
$1600
col 2 is
centered
$12
zebra stripes
are neat
$1
Table Test
section 1
header1
header2
header3
Value1
Value2
Value3
section 2
================================================
FILE: test/functional/makehtml/cases/features/tables/multiple-tables.md
================================================
Table Test
============
section 1
------------
|header1 |header2 |header3|
|-----------|-----------|---------|
|Value1 |Value2 |Value3 |
section 2
-----------
|headerA |headerB |headerC|
|-----------|-----------|---------|
|ValueA |ValueB |ValueC |
================================================
FILE: test/functional/makehtml/cases/features/tables/table-inside-codeblock.html
================================================
headerA
headerB
headerC
ValueA
ValueB
ValueC
================================================
FILE: test/functional/makehtml/cases/features/tables/table-inside-codeblock.md
================================================
some text
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| **col 3 is** | right-aligned | $1600 |
| col 2 is | *centered* | $12 |
| zebra stripes | ~~are neat~~ | $1 |
================================================
FILE: test/functional/makehtml/cases/features/tables/table-without-leading-pipe.html
================================================
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| **col 3 is** | right-aligned | $1600 |
| col 2 is | *centered* | $12 |
| zebra stripes | ~~are neat~~ | $1 |
Stats
================================================
FILE: test/functional/makehtml/cases/features/tables/table-without-leading-pipe.md
================================================
### Stats
Status | AGENT1 | AGENT2 | AGENT3 | AGENT4 | AGENT5 | AGENT6 | AGENT7 | AGENT8 | AGENT9 | TOTAL |
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
AGENT ERROR | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
APPROVED | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
================================================
FILE: test/functional/makehtml/cases/features/tables/with-equals.html
================================================
Status
AGENT1
AGENT2
AGENT3
AGENT4
AGENT5
AGENT6
AGENT7
AGENT8
AGENT9
TOTAL
AGENT ERROR
0
0
0
0
0
0
0
0
0
APPROVED
0
0
0
0
0
0
0
0
0
================================================
FILE: test/functional/makehtml/cases/features/tables/with-equals.md
================================================
| First Header | Second Header |
| ============= | ============= |
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |
================================================
FILE: test/functional/makehtml/cases/features/tables/with-span-elements.html
================================================
First Header
Second Header
Row 1 Cell 1
Row 1 Cell 2
Row 2 Cell 1
Row 2 Cell 2
================================================
FILE: test/functional/makehtml/cases/features/tables/with-span-elements.md
================================================
| First Header | Second Header |
| ------------- | ----------------- |
| **bold** |  |
| _italic_ | [link](bla.html) |
| `some code` | [google][1] |
|
First Header
Second Header
bold

italic
link
some codegoogle
www.foo.com
normal
First Header
Second Header
Row 1 Cell 1
Row 1 Cell 2
Row 2 Cell 1
Row 2 Cell 2
================================================
FILE: test/functional/makehtml/cases/features/tables/without-body.md
================================================
| First Header | Second Header |
| ------------- | ------------- |
================================================
FILE: test/functional/makehtml/cases/features/tables/without-header-delimiter.html
================================================
First Header
Second Header
Markdown test adapted from BitBucket
Span Elements
Emphasis
*single asterisks*
**double asterisks**
Underline [experimental]
__double underscores__
___triple underscores___
Emphasis can be used in the mi*dd*le of a word.
\*this text is surrounded by literal asterisks\*
Strikethrough
~~:~~text that has been struckthrough~~
Preformatted code
` (backtick). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:printf() function.Use the `printf()` function.
There is a literal backtick (`) here. Links
[ Text for the link ](URL)
So an inline link to [Yahoo](http://www.yahoo.com) looks like this:
This is [an example][id] reference-style link.
[id]: http://example.com/ "Optional Title Here"
Images



Block Elements
Headings
Heading 1 markup
# Heading 1
Heading 2 markup
## Heading 2
Heading 3 markup
### Heading 3
Heading 4 markup
#### Heading 4
Heading 5 markup
##### Heading 5
Heading 6 markup
###### Heading 6
Level 1 markup use an equal sign = (equal sign)
Level 1 markup use an equal sign = (equal sign)
==============================
Level 2 markup uses - (dashes)
Level 2 markup uses - (dashes)
-------------
PARAGRAPHS and BLOCKQUOTES
This is one paragraph.
This is a second.
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
This is a header.
return shell_exec("echo $input | $markdown_script");
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
Lists
* Red
+ Green
- Blue
1. Item one
1. Item two
1. Item three
1. Item one
2. Item two
3. Item three
* Red
+ Green
* dark green
* lime
- Blue
1. Item one
1. subitem 1
1. subitem 2
1. Item two
This is is a first paragraph.
* Green
* Blue
This is a second paragraph.
1. Item three
* Green
> What is this? It is embedded blockquote. Mix 'em and match 'em.
* Blue
* Red
This is an embedded code block.
More code!
* Green
Try this code:
This is an embedded code block.
Then this:
More code!
* Blue
* Red
Tables
<html> so you need to use the - (dash) and the | (pipe) symbols to construct a table. The first line contains column headers. Separate columns with the pipe symbol.First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Right | Left | Center
---------:| :----- |:-----:
Computer | $1600 | one
Phone | $12 | three
Pipe | $1 | eleven
help() | Display the help window. |
| destroy() | Destroy your computer! || Function name | Description |
| ------------- | ------------------------------ |
| `help()` | Display the __help__ window. |
| `destroy()` | **Destroy your computer!** |
Code and Syntax highlighting
<pre> and <code> tags.This is a code block.
This is a normal paragraph:
This is a code block.
<p>Here is an example of AppleScript:</p>
#!python
#
def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text)
``` three ticks. Then, provide the comment with the type of syntax you are using. There is a the vast library of Pygment lexers. Markdown accepts the 'short name' or the 'mimetype' of anything in there.This is a code block, fenced-style
```
This is a code block, fenced-style
```
Horizontal Rules
* * *
***
*****
- - - -
-----------------------
================================================
FILE: test/functional/makehtml/cases/features/underline/fulltext.md
================================================
Markdown test adapted from BitBucket
====================
[Markdown][fireball] for readmes is pretty popular. So, I've given you a demo
here of all the markup we support. In some cases, I copied the doc/examples entirely from the Fireball Markdown site.
I didn't duplicate all the Markdown doc everything tho. For the entire docs and a deeper explanation of Markdown, you still need to go to the [Markdown][fireball] site.
You can also use [Markdown mark up][BBmarkup] in comments, issues, and commit messages.
On this page:
* [Span Elements](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-span-elements)
* [Emphasis](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-emphasis)
* [Strikethrough](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-strikethrough)
* [Preformatted code](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-preformatted-code)
* [Links](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-links)
* [Images](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-images)
* [Block Elements](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-block-elements)
* [Headings](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-headings)
* [Paragraphs and blockquotes](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-paragraphs-and-blockquotes)
* [Lists](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-lists)
* [Tables](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-tables)
* [Code and Syntax highlighting](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-code-and-syntax-highlighting)
* [Horizontal rules](https://Markdown.org/tutorials/markdowndemo/overview#markdown-header-horizontal-rules)
- - -
# Span Elements
These elements occur within a line of text. So, for example font changes or links.
## Emphasis
Markdown treats * (asterisk) as emphasis markers.
*single asterisks*
**double asterisks**
All are created from this:
*single asterisks*
**double asterisks**
## Underline [experimental]
__double underscores__
___triple underscores___
All are created from this:
__double underscores__
___triple underscores___
You must use the same character must be used to open and close an emphasis span. Emphasis can be used in the mi*dd*le of a word.
Emphasis can be used in the mi*dd*le of a word.
But if you surround an * or _ with spaces, it will be treated as a literal asterisk or underscore.
To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it:
\*this text is surrounded by literal asterisks\*
## Strikethrough
Markdown's Markdown parser supports strikethrough by wrapping text in `~~`:
~~text that has been struckthrough~~
is created from:
~~text that has been struckthrough~~
## Preformatted code
To indicate a span of code, wrap it with `` ` `` (backtick). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:
Use the `printf()` function.
is produced from:
Use the `printf()` function.
To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters:
``There is a literal backtick (`) here.``
## Links
Markdown supports inline and reference links. In both styles, the link text is delimited by [square brackets]. To create an inline link, use this syntax:
[ Text for the link ](URL)
So an inline link to [Yahoo](http://www.yahoo.com) looks like this:
So an inline link to [Yahoo](http://www.yahoo.com) looks like this:
Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link:
This is [an example][id] reference-style link.
Which gives you a link like this:
This is [an example][id] reference-style link.
Elsewhere in the document, usually at the bottom of the file, you define your link label on a line by itself:
[id]: http://example.com/ "Optional Title Here"
Links can get pretty fancy, so if you want the long form version, visit the
official [Markdown][fireball] docs.
## Images
Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference. Images appear like this:



- - -
# Block Elements
These are elements that are a single or multiple lines in length
## Headings
You can create Atx-style headings by prefixing with a # (hash mark)
# Heading 1 markup `# Heading 1`
#
## Heading 2 markup `## Heading 2`
##
### Heading 3 markup `### Heading 3`
###
#### Heading 4 markup `#### Heading 4`
####
##### Heading 5 markup `##### Heading 5`
#####
###### Heading 6 markup `###### Heading 6`
######
You can also create Setext-style headings which have two levels.
Level 1 markup use an equal sign = (equal sign)
==============================
Level 1 markup use an equal sign = (equal sign)
==============================
Level 2 markup uses - (dashes)
-------------
Level 2 markup uses - (dashes)
-------------
## PARAGRAPHS and BLOCKQUOTES
A paragraph is one or more consecutive lines of text separated by one or more
blank lines. A blank line contains nothing but spaces or tabs. Do not indent
normal paragraphs with spaces or tabs. New lines/carriage returns within paragraphs require two spaces at the end of the preceding line.
This is one paragraph.
This is a second.
This is one paragraph.
This is a second.
Markdown uses email-style > (greater than) characters for blockquoting. If you’re familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a > before every line:
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
Blockquotes can be nested (i.e. a blockquote-in-a-blockquote):
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
Blockquotes can contain other Markdown elements, including headers, lists, and code blocks:
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
## Lists
Markdown supports ordered (numbered) and unordered (bulleted) lists. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab.
Form bulleted lists with any of * (asterisk), + (plus), or - (dash). You can one or any or mix of these to form a list:
* Red
+ Green
- Blue
* Red
+ Green
- Blue
Ordered lists require a numeric character followed by a . (period).
1. Item one
1. Item two
1. Item three
1. Item one
1. Item two
1. Item three
Notice the actual value of the number doesn't matter in the list result. However, for readability better to use this markup:
1. Item one
2. Item two
3. Item three
Lists can be embedded in lists. List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:
* Red
+ Green
* dark green
* lime
- Blue
1. Item one
1. subitem 1
1. subitem 2
1. Item two
This is is a first paragraph.
* Green
* Blue
This is a second paragraph.
1. Item three
The code for these embedded lists or paragraphs is:
* Red
+ Green
* dark green
* lime
- Blue
1. Item one
1. subitem 1
1. subitem 2
1. Item two
This is is a first paragraph.
* Green
* Blue
This is a second paragraph.
1. Item three
You can also embed blockquotes in a list.
* Green
> What is this? It is embedded blockquote. Mix 'em and match 'em.
* Blue
* Red
* Green
> What is this? It is embedded blockquote. Mix 'em and match 'em.
* Blue
* Red
You can also embed code blocks in a list.
* Green
Try this code:
This is an embedded code block.
Then this:
More code!
* Blue
* Red
* Green
Try this code:
This is an embedded code block.
Then this:
More code!
* Blue
* Red
## Tables
Markdown does not support `` so you need to use the - (dash) and the | (pipe) symbols to construct a table. The first line contains column headers. Separate columns with the pipe symbol.
The second line must be a mandatory separator line between the headers and the content. Subsequent lines are table rows. Columns are always separated by the pipe (|) character. For example this table:
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Comes from this code:
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
You can only put simple lines in a table.
You can specify alignment for each column by adding colons to separator lines. A colon at the left of the separator line, left-aligns the column. A colon on the right, right-aligns the column. Add colons to both sides to center the column is center-aligned.
Right | Left | Center
---------:| :----- |:-----:
Computer | $1600 | one
Phone | $12 | three
Pipe | $1 | eleven
Right | Left | Center
---------:| :----- |:-----:
Computer | $1600 | one
Phone | $12 | three
Pipe | $1 | eleven
You can apply inline formatting (span-level changes such as fonts or links) to the content of each cell using regular Markdown syntax:
| Function name | Description |
| ------------- | ------------------------------ |
| `help()` | Display the __help__ window. |
| `destroy()` | **Destroy your computer!** |
| Function name | Description |
| ------------- | ------------------------------ |
| `help()` | Display the __help__ window. |
| `destroy()` | **Destroy your computer!** |
- - -
## Code and Syntax highlighting
Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the code block linesare interpreted literally. Markdown wraps a code block in both `` and `
` tags.
To produce a code block in Markdown, indent every line of the block by at least 4 spaces or 1 tab. For :
This is a normal paragraph:
This is a code block.
The code reveals the indentation.
This is a normal paragraph:
This is a code block.
A code block continues until it reaches a line that is not indented (or the end of the page).
Within a code block, & (ampersands) and < > (angle brackets) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown — just paste it and indent it. Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this:
Automatic Links
https://ghost.org
Markdown Footnotes
The quick brown fox[^1] jumped over the lazy dog[^2].
[^1]: Foxes are red
[^2]: Dogs are usually not red
Syntax Highlighting
```language-javascript
[...]
```
================================================
FILE: test/functional/makehtml/cases/ghost/markdown-magic.md
================================================
### Automatic Links
```
https://ghost.org
```
https://ghost.org
### Markdown Footnotes
```
The quick brown fox[^1] jumped over the lazy dog[^2].
[^1]: Foxes are red
[^2]: Dogs are usually not red
```
The quick brown fox[^1] jumped over the lazy dog[^2].
### Syntax Highlighting
```language-javascript
[...]
```
Combined with [Prism.js](http://prismjs.com/) in the Ghost theme:
```language-javascript
// # Notifications API
// RESTful API for creating notifications
var Promise = require('bluebird'),
_ = require('lodash'),
canThis = require('../permissions').canThis,
errors = require('../errors'),
utils = require('./utils'),
// Holds the persistent notifications
notificationsStore = [],
// Holds the last used id
notificationCounter = 0,
notifications;
```
================================================
FILE: test/functional/makehtml/cases/ghost/underscore.html
================================================
// # Notifications API
// RESTful API for creating notifications
var Promise = require('bluebird'),
_ = require('lodash'),
canThis = require('../permissions').canThis,
errors = require('../errors'),
utils = require('./utils'),
// Holds the persistent notifications
notificationsStore = [],
// Holds the last used id
notificationCounter = 0,
notifications;
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foofoo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foofoo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foofoo_bar_baz foo_bar_baz_bar_foo foo_bar baz_bar baz_foo
foo_bar_baz foo_bar_baz_bar_foo foo_bar baz_bar baz_foo
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foofoo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foofoo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
[foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo](http://myurl.com/foo_bar_baz_bar_foo)
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
-----
### foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
1. foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
2. foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
> blockquote foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
* foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
* foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
-------
http://en.wikipedia.org/wiki/Tourism_in_Germany
[an example] [wiki]
Another [example][wiki] of a link
[wiki]: http://en.wikipedia.org/wiki/Tourism_in_Germany
foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foofoo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo

http://myurl.com/foo_bar_baz_bar_foo
================================================
FILE: test/functional/makehtml/cases/issues/#142.odd-behaviour-for-multiple-consecutive-lists.md
================================================
* Item 1
* Item 2
1. Item 1
2. Item 2
- Item 1
- Item 2
================================================
FILE: test/functional/makehtml/cases/issues/#150.hyphens-are-getting-removed.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#183.gh-code-blocks-within-lists-do-not-render-properly.md
================================================
1. Hi, I am a thing
```sh
$ git clone thing.git
dfgdfg
```
1. I am another thing!
```sh
$ git clone other-thing.git
foobar
```
================================================
FILE: test/functional/makehtml/cases/issues/#191.blockquote-followed-by-an-heading.html
================================================
$ git clone thing.git
dfgdfg
$ git clone other-thing.git
foobar
================================================
FILE: test/functional/makehtml/cases/issues/#191.blockquote-followed-by-an-heading.md
================================================
> a blockquote
# followed by an heading
================================================
FILE: test/functional/makehtml/cases/issues/#196.entity-in-code-block-in-nested-list.html
================================================
followed by an heading
================================================
FILE: test/functional/makehtml/cases/issues/#196.entity-in-code-block-in-nested-list.md
================================================
Test pre in a list
- & <
- `& <`
- & <
- `& <`
- & <
- `& <`
- & <
- `& <`
================================================
FILE: test/functional/makehtml/cases/issues/#220.html-breaks-markdown-parsing.html
================================================
& <
& <
& <
& <Title 1
Title 2
foo
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
bar
================================================
FILE: test/functional/makehtml/cases/issues/#229.2.code-being-parsed-inside-HTML-code-tags.md
================================================
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
```python
s = "Python syntax highlighting"
print s
```
this is a long paragraph
this is another long paragraph
foo
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
bar
================================================
FILE: test/functional/makehtml/cases/issues/#229.code-being-parsed-inside-HTML-code-tags.html
================================================
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
```python
s = "Python syntax highlighting"
print s
```
================================================
FILE: test/functional/makehtml/cases/issues/#229.code-being-parsed-inside-HTML-code-tags.md
================================================
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
```python
s = "Python syntax highlighting"
print s
```
```
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
```
================================================
FILE: test/functional/makehtml/cases/issues/#230.paragraphs-are-ignored-between-code-tags.html
================================================
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```
```python
s = "Python syntax highlighting"
print s
```
```
No language indicated, so no syntax highlighting.
But let's throw in a tag.
```
```python
var s;
```
================================================
FILE: test/functional/makehtml/cases/issues/#230.paragraphs-are-ignored-between-code-tags.md
================================================
```javascript
var s;
```
this is a long paragraph
```python
var s;
```
================================================
FILE: test/functional/makehtml/cases/issues/#236.wrong-lt-parsing-when-attached-to-word.html
================================================
```javascript
var s;
```
sd-ref


<parent>
<child>child1</child>
<!-- This is a comment -->
<child>child2</child>
<child>some text <!-- a comment --></child>
</parent>
================================================
FILE: test/functional/makehtml/cases/issues/#288.code-blocks-containing-xml-comments-are-not-converted-correctly-when-nested-in-list-items.md
================================================
* list item 1
```
<parent>
<child>child1</child>
<!-- This is a comment -->
<child>child2</child>
<child>some text <!-- a comment --></child>
</parent>
================================================
FILE: test/functional/makehtml/cases/issues/#299.nested-ordered-unordered-list-inconsistent-behavior-2.md
================================================
* one
1. two
foo
* one
1. two
foo
* one
1. two
foo
* one
1. two
foo
* one
* two
foo
* one
* two
foo
* one
* two
foo
* one
* two
foo
* one
* two
================================================
FILE: test/functional/makehtml/cases/issues/#299.nested-ordered-unordered-list-inconsistent-behavior-3.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#299.nested-ordered-unordered-list-inconsistent-behavior-3.md
================================================
* one long paragraph of
text
1. two
foo
* one long paragraph of
text
1. two
================================================
FILE: test/functional/makehtml/cases/issues/#299.nested-ordered-unordered-list-inconsistent-behavior.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#299.nested-ordered-unordered-list-inconsistent-behavior.md
================================================
* one
1. two
foo
* one
1. two
foo
* one
1. two
foo
* one
1. two
foo
* uli one
* uli two
foo
* uli one
* uli two
foo
* uli one
* uli two
foo
* uli one
* uli two
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char.md
================================================
- - - a
a
+ - * - - + a
a
1. 2. 3. 4. 5.
a
1. 2. 3. 4. 5. a
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char2.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char2.md
================================================
- - - a
+ - * - - + a
1. 2. 3. 4. 5.
1. 2. 3. 4. 5. a
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char3.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char3.md
================================================
- -
a
fooo
- - - aaaaa
bbbbb
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char4.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#312.spaced-dashes-followed-by-char4.md
================================================
- - - - -- - - - - - - -- - - - - - - - - - - - - - - - - - - - abcd
================================================
FILE: test/functional/makehtml/cases/issues/#317.spaces-before-hr.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#317.spaces-before-hr.md
================================================
---
- - -
================================================
FILE: test/functional/makehtml/cases/issues/#332.inconsistent-behavior-of-emphasis-and-strong.html
================================================
.png)
.png)
================================================
FILE: test/functional/makehtml/cases/issues/#397.unordered-list-strange-behavior.md
================================================
- **Customer** – Opens the Customer List. Refer to the document “Customer Management”.
- Customer List
- New Customer
- Customer Prices
- Appointments
- **Designer** - Opens the Designer List. Refer to the document “Designer Commissions”.
- Designer List
- New Designer
- Designer Payment List
- New Designer Payment
================================================
FILE: test/functional/makehtml/cases/issues/#429.multiline-base64-image-support.html
================================================
header id in h2
header id in h3
header id in h4
header id in h5
header id in h6
================================================
FILE: test/functional/makehtml/cases/issues/#467.header-ids-for-subheadings.md
================================================
## header id in h2
### header id in h3
#### header id in h4
##### header id in h5
###### header id in h6
================================================
FILE: test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code-2.md
================================================
```
public static void main(String[] args) {
for (int i = 0; i < 10 && true; i++) {
System.out.println("Hello World");
}
// stuff here is affected as well <>&&%
}
```
================================================
FILE: test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.html
================================================
public static void main(String[] args) {
for (int i = 0; i < 10 && true; i++) {
System.out.println("Hello World");
}
// stuff here is affected as well <>&&%
}
================================================
FILE: test/functional/makehtml/cases/issues/#494.enumerated-code-blocks-are-partially-escaped-when-including-empy-lines-between-code.md
================================================
1. Code block as part of list
```
public static void main(String[] args) {
for (int i = 0; i < 10 && true; i++) {
System.out.println("Hello World");
}
// stuff here is affected as well <>&&%
}
```
================================================
FILE: test/functional/makehtml/cases/issues/#495.headings-different-behavior-in-paragraphs-and-lists.html
================================================
public static void main(String[] args) {
for (int i = 0; i < 10 && true; i++) {
System.out.println("Hello World");
}
// stuff here is affected as well <>&&%
}
================================================
FILE: test/functional/makehtml/cases/issues/#495.headings-different-behavior-in-paragraphs-and-lists.md
================================================
- Increase the number of water changes.
- # Protein skimmers:
This remove dissolved
- # Chemical filter media:
When placed in your filter
- #
- something
- #
something
- \# something
================================================
FILE: test/functional/makehtml/cases/issues/#510.specific-string-gets-removed-from-text.html
================================================
Protein skimmers:
Chemical filter media:
var test = test;
function foo() {
return 'bar';
}
var test = test;
function foo() {
return 'bar';
}
================================================
FILE: test/functional/makehtml/cases/issues/#523.leading-space-breaks-gfm-code-blocks.md
================================================
```javascript
var test = test;
function foo() {
return 'bar';
}
```
```javascript
var test = test;
function foo() {
return 'bar';
}
```
```javascript
var test = test;
function foo() {
return 'bar';
}
```
================================================
FILE: test/functional/makehtml/cases/issues/#585.error-when-using-image-references.html
================================================
var test = test;
function foo() {
return 'bar';
}
]{
"custom": true
}
================================================
FILE: test/functional/makehtml/cases/issues/#856.gfm-codeblock-with-language-with-spaces.md
================================================
```json custom data
{
"custom": true
}
```
```json custom data
{
"custom": false
}
```
================================================
FILE: test/functional/makehtml/cases/issues/#96.underscores-in-links.html
================================================
{
"custom": false
}

underscore_test bla/cat(1).png)
/cat(1).png)
/cat(1).png)
/cat(1).png)
this is `a\_test` and this\_too and finally_this_is
================================================
FILE: test/functional/makehtml/cases/issues/handle-html-pre.md
================================================
hmm
this is `a\_test` and this\_too and finally_this_is
================================================
FILE: test/functional/makehtml/cases/issues/one-line-HTML-input.html
================================================
================================================
FILE: test/functional/makehtml/cases/issues/one-line-HTML-input.md
================================================
<div>**foobar**</div>
[ ]: bring up the coal
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-added-markup.md
================================================
> # heading level 1
>
> paragraph
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-line-2-paragraphs.html
================================================
heading level 1
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-line-2-paragraphs.md
================================================
>A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.
>and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-line.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-line.md
================================================
>This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a blockquote.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline-1-space-begin.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline-1-space-begin.md
================================================
> A blockquote
> on multiple lines
> like this.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline-1-space-end.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline-1-space-end.md
================================================
>A blockquote
>on multiple lines
>like this.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline-2-paragraphs.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline-2-paragraphs.md
================================================
>A blockquote
>on multiple lines
>like this.
>
>But it has
>two paragraphs.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-multiline.md
================================================
>A blockquote
>on multiple lines
>like this
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested-multiplereturn-level1.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested-multiplereturn-level1.md
================================================
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested-multiplereturn.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested-multiplereturn.md
================================================
> This is the first level of quoting.
>
> > This is nested blockquote.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested-return-level1.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested-return-level1.md
================================================
> This is the first level of quoting.
> > This is nested blockquote.
> Back to the first level.
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/blockquote-nested.md
================================================
> This is the first level of quoting.
> > This is nested blockquote.
================================================
FILE: test/functional/makehtml/cases/karlcow/code-1-tab.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/code-1-tab.md
================================================
10 PRINT HELLO INFINITE
20 GOTO 10
================================================
FILE: test/functional/makehtml/cases/karlcow/code-4-spaces-escaping.html
================================================
10 PRINT HELLO INFINITE
20 GOTO 10
================================================
FILE: test/functional/makehtml/cases/karlcow/code-4-spaces-escaping.md
================================================
10 PRINT < > &
20 GOTO 10
================================================
FILE: test/functional/makehtml/cases/karlcow/code-4-spaces.html
================================================
10 PRINT < > &
20 GOTO 10
================================================
FILE: test/functional/makehtml/cases/karlcow/code-4-spaces.md
================================================
10 PRINT HELLO INFINITE
20 GOTO 10
================================================
FILE: test/functional/makehtml/cases/karlcow/em-middle-word.html
================================================
10 PRINT HELLO INFINITE
20 GOTO 10
This is an H1
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level1-equal-underlined.md
================================================
This is an H1
=============
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level1-hash-sign-closed.html
================================================
This is an H1
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level1-hash-sign-closed.md
================================================
# This is an H1 #
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level1-hash-sign-trailing-1-space.html
================================================
this is an h1 with two trailing spaces
This is an H1
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level1-hash-sign.md
================================================
# This is an H1
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level2-dash-underlined.html
================================================
This is an H2
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level2-dash-underlined.md
================================================
This is an H2
-------------
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level2-hash-sign-closed.html
================================================
This is an H2
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level2-hash-sign-closed.md
================================================
## This is an H2 ##
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level2-hash-sign.html
================================================
This is an H2
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level2-hash-sign.md
================================================
## This is an H2
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level3-hash-sign-closed.html
================================================
This is an H3
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level3-hash-sign-closed.md
================================================
### This is an H3 ###
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level3-hash-sign.html
================================================
This is an H3
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level3-hash-sign.md
================================================
### This is an H3
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level4-hash-sign-closed.html
================================================
This is an H4
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level4-hash-sign-closed.md
================================================
#### This is an H4 ####
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level4-hash-sign.html
================================================
This is an H4
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level4-hash-sign.md
================================================
#### This is an H4
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level5-hash-sign-closed.html
================================================
This is an H5
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level5-hash-sign-closed.md
================================================
##### This is an H5 #####
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level5-hash-sign.html
================================================
This is an H5
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level5-hash-sign.md
================================================
##### This is an H5
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level6-hash-sign-closed.html
================================================
This is an H6
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level6-hash-sign-closed.md
================================================
###### This is an H6 ######
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level6-hash-sign.html
================================================
This is an H6
================================================
FILE: test/functional/makehtml/cases/karlcow/header-level6-hash-sign.md
================================================
###### This is an H6
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-dashes-spaces.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-dashes-spaces.md
================================================
- - -
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-dashes.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-dashes.md
================================================
---
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-stars.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-stars.md
================================================
***
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-underscores.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-3-underscores.md
================================================
___
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-7-dashes.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/horizontal-rule-7-dashes.md
================================================
-------
================================================
FILE: test/functional/makehtml/cases/karlcow/img-idref-title.html
================================================
![]()
![]()
![]()
![]()
<code> and & for everything and &` for everything
================================================
FILE: test/functional/makehtml/cases/karlcow/inline-code-with-visible-backtick.html
================================================
We love `code` for everythingWe love `code` for everything
and a line break.
and a line break.
================================================
FILE: test/functional/makehtml/cases/karlcow/list-blockquote.md
================================================
* a list containing a blockquote
> this the blockquote in the list
================================================
FILE: test/functional/makehtml/cases/karlcow/list-code.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/list-code.md
================================================
* a list containing a block of code
10 PRINT HELLO INFINITE
20 GOTO 10
================================================
FILE: test/functional/makehtml/cases/karlcow/list-multiparagraphs-tab.html
================================================
10 PRINT HELLO INFINITE
20 GOTO 10
================================================
FILE: test/functional/makehtml/cases/karlcow/list-multiparagraphs-tab.md
================================================
* This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
* Suspendisse id sem consectetuer libero luctus adipiscing.
================================================
FILE: test/functional/makehtml/cases/karlcow/list-multiparagraphs.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/list-multiparagraphs.md
================================================
* This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
* Suspendisse id sem consectetuer libero luctus adipiscing.
================================================
FILE: test/functional/makehtml/cases/karlcow/ordered-list-escaped.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/ordered-list-inner-par-list.md
================================================
1. 1
- inner par list
2. 2
================================================
FILE: test/functional/makehtml/cases/karlcow/ordered-list-items-random-number.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/ordered-list-items-random-number.md
================================================
1. list item 1
8. list item 2
1. list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/ordered-list-items.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/ordered-list-items.md
================================================
1. list item 1
2. list item 2
3. list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/paragraph-hard-return.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-asterisk.md
================================================
* list item 1
* list item 2
* list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-dashsign.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-dashsign.md
================================================
- list item 1
- list item 2
- list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-leading-1space.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-leading-1space.md
================================================
* list item 1
* list item 2
* list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-leading-2spaces.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-leading-2spaces.md
================================================
* list item 1
* list item 2
* list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-leading-3spaces.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-leading-3spaces.md
================================================
* list item 1
* list item 2
* list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-plussign.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-items-plussign.md
================================================
+ list item 1
+ list item 2
+ list item 3
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-paragraphs.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-paragraphs.md
================================================
* list item in paragraph
* another list item in paragraph
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-unindented-content.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-unindented-content.md
================================================
* This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list.
* and yet another long long long long long long long long long long long long long long long long long long long long long long line.
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-with-indented-content.html
================================================
================================================
FILE: test/functional/makehtml/cases/karlcow/unordered-list-with-indented-content.md
================================================
* This is a list item
with the content on
multiline and indented.
* And this another list item
with the same principle.
================================================
FILE: test/functional/makehtml/cases/standard/anchors-allow-fragments.html
================================================
================================================
FILE: test/functional/makehtml/cases/standard/anchors-allow-fragments.md
================================================
[Declare options](#Declare)
[Declare options](#Declare%20current%20operation%20options)
[Declare options](<#Declare current operation options>)
[Common Mark Example](https://spec.commonmark.org/0.30/#example-500)
[Common Mark Example](spec.commonmark.org/0.30/#example-500)
================================================
FILE: test/functional/makehtml/cases/standard/anchors-allow-javacript-identifiers.html
================================================
================================================
FILE: test/functional/makehtml/cases/standard/blockquote-followed-by-code.md
================================================
> a blockquote
with a 4 space indented line (not code)
sep
> a blockquote
with some code after
================================================
FILE: test/functional/makehtml/cases/standard/blockquote-inside-code.html
================================================
with some code after
> this is a pseudo blockquote
> inside a code block
================================================
FILE: test/functional/makehtml/cases/standard/blockquote-inside-code.md
================================================
> this is a pseudo blockquote
> inside a code block
foo
> this is another bq
inside code
================================================
FILE: test/functional/makehtml/cases/standard/blockquote-nested-markdown.html
================================================
> this is another bq
inside code
================================================
FILE: test/functional/makehtml/cases/standard/blockquote-nested-markdown.md
================================================
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
================================================
FILE: test/functional/makehtml/cases/standard/blockquote.html
================================================
This is a header.
return shell_exec("echo $input | $markdown_script");
================================================
FILE: test/functional/makehtml/cases/standard/blockquote.md
================================================
> This is a multi line blockquote test
>
> With more than one line.
================================================
FILE: test/functional/makehtml/cases/standard/code-block-html-escape.html
================================================
================================================
FILE: test/functional/makehtml/cases/standard/code-block-html-escape.md
================================================
This is some HTML:
<h1>Heading</h1>
Heading
================================================
FILE: test/functional/makehtml/cases/standard/code-block-with-special-chars.html
================================================
================================================
FILE: test/functional/makehtml/cases/standard/code-block-with-special-chars.md
================================================
//**this** code _has_ special chars
var arr = ['foo', 'bar', 'baz'];
function () {
return 'foo';
}
\n
================================================
FILE: test/functional/makehtml/cases/standard/code-block.html
================================================
//**this** code _has_ special chars
var arr = ['foo', 'bar', 'baz'];
function () {
return 'foo';
}
\n
================================================
FILE: test/functional/makehtml/cases/standard/code-block.md
================================================
This is a normal paragraph:
This is a code block.
================================================
FILE: test/functional/makehtml/cases/standard/double-emphasis.html
================================================
This is a code block.
================================================
FILE: test/functional/makehtml/cases/standard/doubline-list.md
================================================
* Bird
* Magic
================================================
FILE: test/functional/makehtml/cases/standard/ellipsis.html
================================================
ellipsis in code...
ellipsis in code...
ellipsis in header…
**foo**some <span>text</span> yeah!
================================================
FILE: test/functional/makehtml/cases/standard/encodeHTMLCodeTags.md
================================================
this is code
<div>foo</div>
some text yeah!
================================================
FILE: test/functional/makehtml/cases/standard/escaped-number-period.html
================================================
function MyFunc(a) {
// ...
}
================================================
FILE: test/functional/makehtml/cases/standard/github-style-codeblock-inside-quote.md
================================================
> Define a function in javascript:
>
> ```
> function MyFunc(a) {
> var s = '`';
> }
> ```
>
>> And some nested quote
>>
>> ```html
>> function MyFunc(a) {
var s = '`';
}
<div>HTML!</div>
function MyFunc(a) {
var s = '`';
}
<div>HTML!</div>
body {
font-size: 1.5em;
}
some code
================================================
FILE: test/functional/makehtml/cases/standard/github-style-codeblock.md
================================================
Define a function in javascript:
```
function MyFunc(a) {
var s = '`';
}
```
And some HTML
```html
another piece of code
================================================
FILE: test/functional/makehtml/cases/standard/github-style-linebreaks.md
================================================
```
code can go here
this is rendered on a second line
```
================================================
FILE: test/functional/makehtml/cases/standard/h1-with-double-hash.html
================================================
code can go here
this is rendered on a second line
This is an H1
================================================
FILE: test/functional/makehtml/cases/standard/h1-with-double-hash.md
================================================
# This is an H1 #
================================================
FILE: test/functional/makehtml/cases/standard/h1-with-equals.html
================================================
This is an H1
================================================
FILE: test/functional/makehtml/cases/standard/h1-with-equals.md
================================================
This is an H1
=============
================================================
FILE: test/functional/makehtml/cases/standard/h1-with-single-hash.html
================================================
This is an H1
================================================
FILE: test/functional/makehtml/cases/standard/h1-with-single-hash.md
================================================
# This is an H1
================================================
FILE: test/functional/makehtml/cases/standard/h2-with-dashes.html
================================================
This is an H2
================================================
FILE: test/functional/makehtml/cases/standard/h2-with-dashes.md
================================================
This is an H2
-------------
================================================
FILE: test/functional/makehtml/cases/standard/h2-with-double-hash.html
================================================
This is an H2
================================================
FILE: test/functional/makehtml/cases/standard/h2-with-double-hash.md
================================================
## This is an H2 ##
================================================
FILE: test/functional/makehtml/cases/standard/h2-with-single-hash.html
================================================
This is an H2
================================================
FILE: test/functional/makehtml/cases/standard/h2-with-single-hash.md
================================================
## This is an H2
================================================
FILE: test/functional/makehtml/cases/standard/h3-with-double-hash.html
================================================
This is an H3
================================================
FILE: test/functional/makehtml/cases/standard/h3-with-double-hash.md
================================================
### This is an H3 ###
================================================
FILE: test/functional/makehtml/cases/standard/h3-with-single-hash.html
================================================
This is an H3
================================================
FILE: test/functional/makehtml/cases/standard/h3-with-single-hash.md
================================================
### This is an H3
================================================
FILE: test/functional/makehtml/cases/standard/h4-with-single-hash.html
================================================
This is an H4
================================================
FILE: test/functional/makehtml/cases/standard/h4-with-single-hash.md
================================================
#### This is an H4
================================================
FILE: test/functional/makehtml/cases/standard/h5-with-single-hash.html
================================================
This is an H5
================================================
FILE: test/functional/makehtml/cases/standard/h5-with-single-hash.md
================================================
##### This is an H5
================================================
FILE: test/functional/makehtml/cases/standard/h6-with-single-hash.html
================================================
This is an H6
================================================
FILE: test/functional/makehtml/cases/standard/h6-with-single-hash.md
================================================
###### This is an H6
================================================
FILE: test/functional/makehtml/cases/standard/horizontal-rules.html
================================================
================================================
FILE: test/functional/makehtml/cases/standard/horizontal-rules.md
================================================
* * *
***
*****
- - -
---------------------------------------
================================================
FILE: test/functional/makehtml/cases/standard/html-comments.html
================================================
<!-- comment -->
================================================
FILE: test/functional/makehtml/cases/standard/html-inside-listed-code.md
================================================
- list item 1
```html
google
<a href="www.google.com">google</a>
<div>
<div>some div</div>
</div>
Foo
Bar
My street
Foo
Bar
Bar
Main title
Secondary title
Summarise me
Foo
Bar
My street
Foo
Bar
Bar
Main title
Secondary title
Summarise me
(some text between brackets)
(some text between brackets)



function.SELECT `column` FROM whatever.``foo`<blink> tags.— is the decimal-encoded equivalent of —.inline **code** has ___magic___ chars