Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

showdown

showdownjs2.1mMIT2.1.0TypeScript support: definitely-typed

A Markdown to HTML converter written in Javascript

markdown, converter

readme

Showdown

Build Status: Linux npm version Bower version Join the chat at https://gitter.im/showdownjs/showdown Greenkeeper badge Donate


Showdown is a Javascript Markdown to HTML converter, based on the original works by John Gruber. Showdown can be used client side (in the browser) or server side (with NodeJs).

Live DEMO

Check a live Demo here http://demo.showdownjs.com/

Funding

As you know, ShowdownJS is a free library and it will remain free forever. However, maintaining and improving the library costs time and money.

If you like our work and find our library useful, please donate through paypal!! Your contribution will be greatly appreciated and help us continue to develop this awesome library.

License

ShowdownJS v 2.0 is release under the MIT version. Previous versions are release under BSD.

Who uses Showdown (or a fork)

Installation

Download tarball

You can download the latest release tarball directly from releases

Bower

bower install showdown

npm (server-side)

npm install showdown

NuGet package

PM> Install-Package showdownjs

The NuGet Packages can be found here.

CDN

You can also use one of several CDNs available:

  • jsDelivr

      https://cdn.jsdelivr.net/npm/showdown@<version tag>/dist/showdown.min.js
  • cdnjs

      https://cdnjs.cloudflare.com/ajax/libs/showdown/<version tag>/showdown.min.js
  • unpkg

      https://unpkg.com/showdown/dist/showdown.min.js

Note: replace <version tag> with an actual full length version you're interested in e.g. 1.9.0

Browser Compatibility

Showdown has been tested successfully with:

  • 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

In theory, Showdown will work in any browser that supports ECMA 262 3rd Edition (JavaScript 1.5). The converter itself might even work in things that aren't web browsers, like Acrobat. No promises.

Node compatibility

Showdown supports node versions in the "Current", "Active" and "Maintenance" phases. Currently this includes Node 12.x, 14.x, 16.x and 17.x. See the [node release roadmap for more details](12.x, 14.x, 16.x, 17.x).

Other versions of node may likely work, but they are not tested regularly.

Pervious versions

If you're looking for showdown v<1.0.0, you can find it in the legacy branch.

If you are looking for showdown 1.* you can find it in the [version_1.x][version_1.x] branch.

Changelog

You can check the full changelog

Extended documentation

Check our wiki pages for examples and a more in-depth documentation.

Quick Example

Node

Markdown to HTML

var showdown  = require('showdown'),
    converter = new showdown.Converter(),
    text      = '# hello, markdown!',
    html      = converter.makeHtml(text);

HTML to Markdown

var showdown  = require('showdown'),
    converter = new showdown.Converter(),
    html      = '<a href="https://patreon.com/showdownjs">Please Support us!</a>',
    md        = converter.makeMarkdown(text);

Browser

var converter = new showdown.Converter(),
    html      = converter.makeHtml('# hello, markdown!'),
    md        = converter.makeMd('<a href="https://patreon.com/showdownjs">Please Support us!</a>');

Output

Both examples should output...

    <h1 id="hellomarkdown">hello, markdown!</h1>
[Please Support us!](https://patreon.com/showdownjs)

Options

You can change some of showdown's default behavior through options.

Setting options

Options can be set:

Globally

Setting a "global" option affects all instances of showdown

showdown.setOption('optionKey', 'value');

Locally

Setting a "local" option only affects the specified Converter object. Local options can be set:

  • through the constructor

     var converter = new showdown.Converter({optionKey: 'value'});
  • through the setOption() method

     var converter = new showdown.Converter();
     converter.setOption('optionKey', 'value');

Getting an option

Showdown provides 2 methods (both local and global) to retrieve previous set options.

getOption()

// Global
var myOption = showdown.getOption('optionKey');

//Local
var myOption = converter.getOption('optionKey');

getOptions()

// Global
var showdownGlobalOptions = showdown.getOptions();

//Local
var thisConverterSpecificOptions = converter.getOptions();

Retrieve the default options

You can get showdown's default options with:

var defaultOptions = showdown.getDefaultOptions();

Valid Options

  • omitExtraWLInCodeBlocks: (boolean) [default false] Omit the trailing newline in a code block. Ex:

    This:

     <code><pre>var foo = 'bar';
     </pre></code>

    Becomes this:

     <code><pre>var foo = 'bar';</pre></code>
  • 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)

  • parseImgDimensions: (boolean) [default false] Enable support for setting image dimensions from within markdown syntax. Examples:

    ![foo](foo.jpg =100x80)     simple, assumes units are in px
    ![bar](bar.jpg =100x*)      sets the height to "auto"
    ![baz](baz.jpg =80%x5em)  Image with width of 80% and height of 5em
  • headerLevelStart: (integer) [default 1] Set the header starting level. For instance, setting this to 3 means that

     # foo

    will be parsed as

     <h3>foo</h3>
  • simplifiedAutoLink: (boolean) [default false] Turning this option on will enable automatic linking to urls. This means that:

    some text www.google.com

    will be parsed as

    <p>some text <a href="www.google.com">www.google.com</a>
  • excludeTrailingPunctuationFromURLs: (boolean) [default false] This option excludes trailing punctuation from autolinking urls. Punctuation excluded: . ! ? ( ). Only applies if simplifiedAutoLink option is set to true.

    check this link www.google.com!

    will be parsed as

    <p>check this link <a href="www.google.com">www.google.com</a>!</p>
  • literalMidWordUnderscores: (boolean) [default false] Turning this on will stop showdown from interpreting underscores in the middle of words as <em> and <strong> and instead treat them as literal underscores.

    Example:

    some text with__underscores__in middle

    will be parsed as

    <p>some text with__underscores__in middle</p>
  • literalMidWordAsterisks: (boolean) [default false] Turning this on will stop showdown from interpreting asterisks in the middle of words as <em> and <strong> and instead treat them as literal asterisks.

    Example:

    some text with**underscores**in middle

    will be parsed as

    <p>some text with**underscores**in middle</p>
  • strikethrough: (boolean) [default false] Enable support for strikethrough syntax. ~~strikethrough~~ as <del>strikethrough</del>

  • tables: (boolean) [default false] Enable support for tables syntax. Example:

    | 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:

     - [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 <br>, like GitHub does, without needing 2 spaces at the end of the line (since v1.5.1)

    a line  
    wrapped in two

    turns into:

    <p>a line<br>
    wrapped in two</p>
  • requireSpaceBeforeHeadingText: (boolean) [default false] Makes adding a space between # and the header text mandatory (since v1.5.3)

  • ghMentions: (boolean) [default false] Enables github @mentions, which link to the username mentioned (since v1.6.0)

  • ghMentionsLink: (string) [default https://github.com/{u}] Changes the link generated by @mentions. Showdown will replace {u} with the username. Only applies if ghMentions option is enabled. Example: @tivie with ghMentionsOption set to //mysite.com/{u}/profile will result in <a href="//mysite.com/tivie/profile">@tivie</a>

  • encodeEmails: (boolean) [default true] Enable e-mail addresses encoding through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities. (since v1.6.1)

    NOTE: Prior to version 1.6.1, emails would always be obfuscated through dec and hex encoding.

  • openLinksInNewWindow: (boolean) [default false] Open all links in new windows (by adding the attribute target="_blank" to <a> tags) (since v1.7.0)

  • backslashEscapesHTMLTags: (boolean) [default false] Support for HTML Tag escaping. ex: \<div>foo\</div> (since v1.7.2)

  • emoji: (boolean) [default false] Enable emoji support. Ex: this is a :smile: emoji For more info on available emojis, see https://github.com/showdownjs/showdown/wiki/Emojis (since v.1.8.0)

  • underline: (boolean) [default false] EXPERIMENTAL FEATURE Enable support for underline. Syntax is double or triple underscores ex: __underlined word__. With this option enabled, underscores are no longer parses into <em> and <strong>.

  • ellipsis: (boolean) [default true] Replaces three dots with the ellipsis unicode character.

  • completeHTMLDocument: (boolean) [default false] Outputs a complete html document, including <html>, <head> and <body> tags' instead of an HTML fragment. (since v.1.8.5)

  • metadata: (boolean) [default false] Enable support for document metadata (defined at the top of the document between ««« and »»» or between --- and ---). (since v.1.8.5)

    var conv = new showdown.Converter({metadata: true});
    var html = conv.makeHtml(someMd);
    var metadata = conv.getMetadata(); // returns an object with the document metadata
  • splitAdjacentBlockquotes: (boolean) [default false] Split adjacent blockquote blocks.(since v.1.8.6)

NOTE: Please note that until version 1.6.0, all of these options are DISABLED by default in the cli tool.

Flavors

You can also use flavors or presets to set the correct options automatically, so that showdown behaves like popular markdown flavors.

Currently, the following flavors are available:

  • original - original markdown flavor as in John Gruber's spec
  • vanilla - showdown base flavor (as from v1.3.1)
  • github - GFM (GitHub Flavored Markdown)

Global

showdown.setFlavor('github');

Instance

converter.setFlavor('github');

CLI Tool

Showdown also comes bundled with a Command Line Interface tool. You can check the CLI wiki page for more info

Integration with AngularJS

ShowdownJS project also provides seamlessly integration with AngularJS via a "plugin". Please visit https://github.com/showdownjs/ngShowdown for more information.

Integration with TypeScript

If you're using TypeScript you maybe want to use the types from DefinitelyTyped

Integration with SystemJS/JSPM

Integration with SystemJS can be obtained via the third party "system-md" plugin.

Integration with VueJS

To use ShowdownJS as a Vue component quickly, you can check vue-showdown.

XSS vulnerability

Showdown doesn't sanitize the input. This is by design since markdown relies on it to allow certain features to be correctly parsed into HTML. This, however, means XSS injection is quite possible.

Please refer to the wiki article Markdown's XSS Vulnerability (and how to mitigate it) for more information.

Extensions

Showdown allows additional functionality to be loaded via extensions. (you can find a list of known showdown extensions here) You can also find a boilerplate, to create your own extensions in this repository

Client-side Extension Usage

<script src="showdown.js"></script>
<script src="twitter-extension.js"></script>
<script>
var converter = new showdown.Converter({ extensions: ['twitter'] });
</script>

Server-side Extension Usage

var showdown    = require('showdown'),
    myExtension = require('myExtension'),
    converter = new showdown.Converter({ extensions: ['myExtension'] });

Tests

A suite of tests is available which require node.js. Once node is installed, run the following command from the project root to install the dependencies:

npm install

Once installed the tests can be run from the project root using:

npm test

New test cases can easily be added. Create a markdown file (ending in .md) which contains the markdown to test. Create a .html file of the exact same name. It will automatically be tested when the tests are executed with mocha.

Contributing

If you wish to contribute please read the following quick guide.

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 master:

    git checkout -b my-fix-branch master
  • Documentation (i.e: README.md) changes can be made directly against master.

  • Run the full test suite before submitting and make sure all tests pass (obviously =P).
  • Try to follow our coding style rules. 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.
  • 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.
  • 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):

      git rebase master -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 to express interest or comment on this note.

Credits

Full credit list at https://github.com/showdownjs/showdown/blob/master/CREDITS.md

Showdown is powered by:
webstorm

changelog

2.1.0 (2022-04-21)

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.4 (2022-04-21)

  • test(cli): Add test for multiple config options (914129f), closes #916

Bug Fixes

  • cli: cli displays the correct version number (8b48882)

2.0.3 (2022-03-08)

Bug Fixes

  • cli: fix cli to work with yargs (f8c4bd2), closes #893

2.0.2 (2022-03-03)

Bug Fixes

2.0.1 (2022-03-01)

Bug Fixes

  • Fix cli not working due to missing cli directory in npm package (32a1aaa), closes #893

2.0.0 (2022-02-15)

Breaking Changes

  • Supported Node Versions were set to match the node release schedule 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

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 (2019-11-02)

Bug Fixes

  • openLinksInNewWindow: add rel="noopener noreferrer" to links (1cd281f), closes #670

1.9.0 (2018-11-10)

Bug Fixes

  • italicsAndBold: fix issue with consecutive spans (#608) (5c0d67e), closes #544
  • underline: fix issue with consecutive spans (81edc70)

Features

  • converter.makeMarkdown: [EXPERIMENTAL] add an HTML to MD converter (e4b0e69), closes #388 #233

1.8.7 (2018-10-16)

Bug Fixes

  • emojis: fix emoji excessive size (4aca41c)
  • gfm-codeblocks:
    • add support for spaces before language declaration (24bf7b1), closes #569
    • leading space no longer breaks gfm codeblocks (828c32f), closes #523
  • images: fix js error when using image references (980e702), closes #585
  • literalMidWordAsterisks: now parses single characters enclosed by * correctly (fe70e45), closes #478
  • mentions: allow for usernames with dot, underscore and dash (dfeb1e2), closes #574
  • nbsp: fix replacing of nbsp with regular spaces (8bc1f42)

1.8.6 (2017-12-22)

Features

  • splitAdjacentBlockquotes: add option to split adjacent blockquote blocks (da328f2), closes #477

1.8.5 (2017-12-10)

Features

  • completeHTMLDocument: add option to output a complete HTML document (a8427c9)
  • metadata: add support for embedded metadata (63d949f), closes #260

1.8.4 (2017-12-05)

Bug Fixes

  • tables: raw html inside code tags in tables no longer breaks tables (4ef4c5e), closes #471

1.8.3 (2017-11-28)

Bug Fixes

  • literalMidWordAsterisks: no longer treats colon as alphanumeric char (21194c8), closes #461
  • spanGamut: code spans are hashed after parsing (f4f63c5), closes #464
  • tables: pipe character in code spans no longer breaks table (0c933a0), closes #465

1.8.2 (2017-11-11)

Bug Fixes

  • fenced codeblocks: add tilde as fenced code block delimiter (c956ede), closes #456
  • openLinksInNewWindow: hash links are not affected by the option (11936ec), closes #457

1.8.1 (2017-11-01)

Dependencies update

  • package: update yargs to version 10.0.3 (#447) (906b26d)

Bug Fixes

  • CDNjs: bump version to fix version missmatch with CDNjs (#452)

1.8.0 (2017-10-24)

NOTICE

Don't use the CDNjs version of this release. See issue #452 for more details.

Bug Fixes

  • autolinks: prevent _ and * to be parsed in links (61929bb), closes #444

Features

  • ellipsis: add auto-ellipsis support (25f1978)

    • Example:

      input

        this is an ellipsis...

      output

        <p>this is an ellipsis…</p>
  • emoji: add emoji support through option emoji(5b8f1d3), closes #448

    • Usage:

        var conv = new showdown.Converter({emoji: true});
    • Example:

      input

        this is a smile :smile: emoji

      output

        <p>this is a smile 😄 emoji</p>
  • start ordered lists at an arbitrary number: add support for defining the first item number of ordered lists (9cdc35e), closes #377

    • Example:

      input

         3. foo
         4. bar
         5. baz

      output

        <ol start="3">
          <li>foo</li>
          <li>bar</li>
          <li>baz</li>
        </ol>
  • underline: add EXPERIMENTAL support for underline (084b819), closes #450

    • Usage:

        var conv = new showdown.Converter({underline: true});
    • Example:

      input

        this is __underlined__ and this is ___also underlined___

      output

        <p>this is <u>underlined</u> and this is <u>also underlined</u></p>
    • Note: With this option enabled, underscore no longer parses as <em> or <strong>

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 (2017-10-06)

Bug Fixes

  • tables: tables are properly rendered when followed by a single linebreak and a list (d88b095), closes #443
  • tables: trailing spaces no longer prevent table parsing (66bdd21), closes #442

1.7.5 (2017-10-02)

Bug Fixes

  • html-comments: changed regex to precent malformed long comment to freeze showdown (3efcd10), closes #439

1.7.4 (2017-09-08)

Bug Fixes

  • helper.isArray: replace a.constructor === Array with Array.isArray (466a2eb), closes #425
  • loader: allow AMD loader to be used within Node env (ff24bdb)

Features

  • base64-wrapping: support for wrapping base64 strings (8c593a4), closes #429

1.7.3 (2017-08-23)

Bug Fixes

  • github flavor: add backslashEscapesHTMLTags to GFM flavor (5284439)
  • literalMidWordAsterisks: option no longer treats punctuation as word character (8f05be7), closes #398
  • tables: allow for one column table (fef110c), closes #406

Features

  • rawHeaderId: Remove only spaces, ' and " from generated header ids (1791cf0), closes #409
  • rawPrefixHeaderId: add option to prevent showdown from modifying the prefix (ff26c08), closes #409

1.7.2 (2017-08-05)

Bug Fixes

  • githubMentions: githubMentions now works with openLinksInNewWindow options (1194d88), closes #403
  • lists: fix multi paragraph lists with sublists (a2259c0), closes #397
  • tablesHeaderId: fix missmatch of option name (51e4693), closes #412

Features

  • backslashEscapesHTMLTags: backslash escapes HTML tags (5a5aff6), closes #374

1.7.1 (2017-06-02)

Important HOTFIX

Bug Fixes

  • HTML Parser: fix nasty bug where malformed HTML would hang showdown (6566c72), closes #393

1.7.0 (2017-06-01)

(DEPRECATED)

Bug Fixes

  • anchors: fix issue with brackets in link URL (7ba18dd), closes #390
  • excludeTrailingPunctuationFromURL: add comma to punctuation list (fa35fd5), closes #354
  • excludeTrailingPunctuationFromURLs: fix weird character when this option with simplifiedAutoLinks (71acff5), closes #378
  • HTML parsing: fix HTML parsing issues with nested tags (6fbc072), closes #357 #387
  • openLinksInNewWindow: encode _ to prevent clash with em (813f832), closes #379
  • package: update yargs to version 7.0.1 (#349) (9308d7b)
  • package: update yargs to version 8.0.1 (#385) (5fd847b)
  • simpleAutoLinks: URLs with emphasis/strikethrough are parsed (5c50675), closes #347
  • tables: pipe char can now be escaped (1ebc195), closes #345
  • url parsing: fix url edge case parsing in images and links (30aa18c)

Features

  • customizeHeaderId: add option for customizing header ids (94c570a), closes #383
  • images: add support for image's implicit reference syntax (0c6c07b), closes #366
  • literalMidWordAsterisks: add option for mid word asterisks (5bec8f9)
  • openLinksInNewWindow: add option to open all links in a new window (50235d6), closes #362 #337 #249 #247 #222

1.6.4 (2017-02-06)

Bug Fixes

  • encodeAmpsAndAngles: fix > and < encoding (7f43b79), closes #236
  • encodeEmail: now produces valid emails (605d8b7), closes #340
  • flavor: github: new version of github does not use prefix 'user-content' in headers (368f0b6)
  • hashCodeTags: escape code tags (41cb3f6), closes #339
  • italicsAndBold: fix double emphasis edge case (1832b7f)
  • paragraph: workaround QML bug (f7a429e), closes #246 #338
  • prefixHeaderId: make prefixHeaderId string be parsed along the generated id (f641a7d)

Features

  • flavor: ghost: add Ghost flavor (6374b5b)
  • flavor: original: add John Gruber's markdown flavor (6374b5b)

1.6.3 (2017-01-30)

Bug Fixes

  • codeSpans: add - and = to escaped chars inside code spans (4243a31)
  • italicsAndBold: fix inconsistency in italicsAndBold parsing (a4f05d4), closes #332
  • literalMidWordUnderscores: fix inconsistent behavior of emphasis and strong with literalMidWordUndescores (0292ae0), closes #333
  • paragraphs: fix empty lines generating empty paragraphs (54bf744), closes #334
  • strikethrough: fix striketrough being wrongly parsed inside codeSpans (169cbe8)

Features

  • events: add events to all subparsers (7d63a3e)

1.6.2 (2017-01-29)

Bug Fixes

  • escapeSpecialCharsWithinTagAttributes: add ~ and = to escaped chars (bfcc0e4)
  • strikethrough: allow escapinging tilde char (24d47d7), closes #331

Features

  • ghMentionsLink: add ability to define the generated url in @mentions (a4c24c9)

1.6.1 (2017-01-28)

Bug Fixes

  • simplifiedAutoLink: fix missing spaces before and after email addresses (5190b6a), closes #330

Features

  • encodeEmail: add option to enable/disable mail obfuscation (90c52b8)

Notes

This release also improves performance a bit (around 8%)

1.6.0 (2017-01-09)

Bug Fixes

  • ghCompatibleHeaderId: improve the number of removed chars (d499feb)
  • IE8: fix for IE8 error on using isUndefined function (561dc5f), closes #280
  • options: fix ghCompatibleHeaderId that was set as string instead of boolean (de7c37e)
  • simpleLineBreaks: fix simpleLineBreaks option not working with non-ASCII chars and markdown delimiters (b1c458a), closes #318 #323

Features

  • CLI: add -q (quiet) and -m (mute) mode to CLI (f3b86f0)
  • CLI:flavor: add flavor option to CLI (2d6cd1e)
  • getFlavor: add getFlavor method to showdown and Converter (0eaf105)
  • ghMentions: add support for github's @mentions (f2671c0), closes #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 (2016-12-30)

Features

  • ghCompatibleHeaderId: generate header ids compatible with github (db97a90), closes #320 #321

1.5.4 (2016-12-21)

Bug Fixes

  • horizontal rule: revert backwards incompatibility change (113f5f6), closes #317
  • simpleLineBreaks: fix simpleLineBreak option breaking lists html (ed4c33f), closes #316

1.5.3 (2016-12-19)

Bug Fixes

  • parser slowness with certain inputs (da8fb53), closes #315

Features

  • requireSpaceBeforeHeadingText: option to make space between # and header text mandatory (5d19877), closes #277

1.5.2 (2016-12-17)

Bug Fixes

  • listeners: fix listeners typo (f0d25b7), closes #290
  • lists: lines with mutiple dashes being parsed as multilists (10b3410), closes #312
  • nbsp: nbsp are replaced with simple spaces (6e90f7c)

1.5.1 (2016-12-01)

Features

  • simpleLineBreaks: option that parses linebreaks as
    . This option enables linebreaks to always be treated as <br /> tags without needing to add spaces in front of the line, the same way GitHub does. (0942b5e), closes #206
  • excludeTrailingPunctuationFromURLs: option that excludes trailing punctuation from auto linked URLs. (d2fc2a0), closes #266 #308

1.5.0 (2016-11-11)

Bug Fixes

  • lists: enforce 4 space indentation in sublists (d51be6e)
  • lists: fix sublists inconsistent behavior (9cfe8b1), closes #299

Features

  • disableForced4SpacesIndentedSublists: option that disables the requirement of indenting nested sublists by 4 spaces. The option is disabled by default (0be39bc)

BREAKING CHANGES

  • syntax for sublists is now more restrictive. Before, sublists SHOULD be indented by 4 spaces, but indenting at least 2 spaces would work. Now, sublists MUST be indented 4 spaces or they won't work.

    With this input:

      * one
        * two
          * three

    Before (ouput):

      <ul>
        <li>one
          <ul>
            <li>two
              <ul><li>three</li></ul>
            <li>
          </ul>
        </li>
      <ul>

    After (output):

      <ul>
        <li>one</li>
        <li>two
          <ul><li>three</li></ul>
        </li>
      </ul>

    To migrate either fix source md files or activate the option disableForced4SpacesIndentedSublists:

      showdown.setOption('disableForced4SpacesIndentedSublists', true);

1.4.4 (2016-11-02)

Bug Fixes

  • make some regexes a bit faster and make tab char equivalent to 4 spaces (b7e7560)
  • double linebreaks: fix double linebreaks in html output (f97e072), closes #291
  • lists linebreaks: fix lists linebreaks in html output (2b813cd), closes #291
  • parser: fix issue with comments inside nested code blocks (799abea), closes #288

1.4.3 (2016-08-19)

Bug Fixes

  • bower: fix sourceMappingURL errors in bower by including source (9b5a233), closes #200
  • comments: Fix html comment parser (238726c), closes #276
  • ie8 compatibility: Improve ie8 compatibility (984942e), closes #275 #271
  • simplifiedAutoLink: fix simplified autolink to match GFM behavior (0cc55b0), closes #284 #285

1.4.2 (2016-06-21)

Bug Fixes

  • image-parser: fix ref style imgs after inline style imgs not parsing correctly (73206b0), closes #261
  • tables: add check for undefined on text due to failing to parse tables (6e30a48), author stewartmckee, closes #257

Features

  • smart-indent-fix: fix for es6 indentation problems (261f127), closes #259

1.4.1 (2016-05-17)

Bug Fixes

  • tables: fix table heading separators requiring 3 dashes instead of 2 (ddaacfc), closes #256

1.4.0 (2016-05-13)

Bug Fixes

  • hashHTMLBlock: fix issue with html breaking markdown parsing (2746949), closes #220
  • HTMLParser: fix code tags parsing (71a5873), closes #231
  • HTMLParser: fix ghCodeBlocks being parsed inside code tags (7d0436d), closes #229
  • strikethrough: Fix strikethrough issue with escaped chars (5669317), closes #214
  • tables: fix tables to match github's md spec (f58f014), closes #230

Features

  • markdown="1": enable parsing markdown inside HTML blocks (c97f1dc), closes #178

1.3.0 (2015-10-19)

Bug Fixes

  • literalMidWordUnderscores: fix different behavior with asterisks (e86aea8), closes #198
  • simpleautolink: fix mail simpleAutoLink to ignore urls with @ symbol (8ebb25e), closes #204

Features

  • eventDispatcher: add an event dispatcher to converter (2734326)
  • hashHTMLSpans: add support for hashing span elements (3097bd4), closes #196 #175

<a name"1.2.3">

1.2.3 (2015-08-27)

Bug Fixes

  • blockGamut: fix for headings inside blockquotes (3df70624, closes #191)
  • blockQuote: fix 'github style codeblocks' not being parsed inside 'blockquote' (ed2cf595, closes #192)
  • simpleAutoLinks: fix emails being treated as simple urls (7dc3fb1d, closes #187)
  • tables: fix md tables being parsed inside indented code blocks. (50256233, closes #193)

<a name"1.2.2">

1.2.2 (2015-08-02)

Bug Fixes

<a name"1.2.1">

1.2.1 (2015-07-22)

Features

  • smoothLivePreview: fix weird effects due to parsing incomplete input (62ba3733)
  • subParsers/githubCodeBlock: add extra language class to conform to html5 spec (b7f5e32)

Bug Fixes

  • tables:

    • fix undefined error in malformed tables (6176977)
    • add support for md span elements in table headers (789dc18), closes #179
  • italicsAndBold:

    • fix broken em/strong tags when used with literalMidWordUnderscores (7ee2017), closes #179
    • fix underscores not being correctly parsed when used in conjunction with literalMidWordsUnderscores option (c9e85f1)
  • codeSpans: Fix issue with code html tags not being correctly escaped (5f043ca)

  • images: fix alt attribute not being escaped correctly (542194e)

<a name"1.2.0">

1.2.0 (2015-07-13)

This release moves some of the most popular extensions (such as table-extension and github-extension) to core. Also introduces a simple cli tool that you can use to quickly convert markdown files into html.

Bug Fixes

  • headerLevelStart: fix for NaN error when specifying a non number as headerLevelStart param (be72b487)

Features

  • CLI: simple cli tool (ALPHA) (f6a33e40)
  • flavours: add markdown presets/flavors (7e55bceb, closes #164)
  • ghCodeBlocks: add option to disable GH codeblocks (c33f9888)
  • literalMidWordUnderscores: add support for GFM literal midword underscores (0c0cd7db)
  • simplifiedAutoLink: add support for GFM autolinks (cff02372)
  • strikethrough: add support for GFM strikethrough (43e9448d)
  • tables: add support for GFM tables (3a924e3c)
  • tasklists: add support for GFM tasklists (dc72403a)

<a name"1.1.0">

1.1.0 (2015-06-18)

Bug Fixes

  • converter.js: add error if the passed constructor argument is not an object (d86ed450)
  • output modifiers: fix for output modifiers running twice (dcbdc61e)

Features

  • headerLevelStart: add support for setting the header starting level (b84ac67d, closes #69)
  • image dimensions: add support for setting image dimensions within markdown syntax (af82c2b6, closes #143)
  • noHeaderId: add option to suppress automatic generation of ids in headers (7ac893e9)
  • showdown.getDefaultOptions: add method to retrieve default global options keypairs (2de53a7d)

Breaking Changes

  • Deprecates showdown.extensions property. To migrate, extensions should use the new method showdown.extension(<ext name>, <extension>) to register. For more information on the new extension loading mechanism, please check the wiki pages. (4ebd0caa)

<a name"1.0.2">

1.0.2 (2015-05-28)

Bug Fixes

  • Gruntfile.js add missing comma in footer. This bug prevented concatenating other js scripts and libraries with showdown(5315508. Credits to Alexandre Courtiol.

<a name"1.0.1">

1.0.1 (2015-05-27)

Bug Fixes

  • bower.json: update bower.json main attribute to point to dist directory (bc3a092f)

<a name"1.0.0">

1.0.0 (2015-05-27)

Release Information

This is a major code refactor with some big changes such as:

  • showdown.js file was split in several files, called sub-parsers. This should improve code maintainability.
  • angular integration was removed from core and move to its own repository, similar to what was done with extensions
  • A new extension registering system is on the "cooks" that should reduce errors when using extensions. The old mechanism is kept so old extensions should be compatible.

Bug Fixes

  • extensions: support for old extension loading mechanism (95ed7c68)
  • helpers: fix wrong function call 'escapeCharacters' due to old strayed code (18ba4e75)
  • showdown.js:
  • options.omitExtraWLInCodeBlocks: fix for options.omitExtraWLInCodeBlocks only applying in gitHub flavoured code b (e6f40e19)
  • showdown: fix for options merging into globalOptions (ddd6011d, closes #153)

Features

  • registerExtension(): new extension loading mechanism. Now extensions can be registered using this function. The system, however, is not final and will probably be changed until the final version([0fd10cb] (http://github.com/showdownjs/showdown/commit/0fd10cb))
  • allowBlockIndents: indented inline block elements can now be parsed as markdown (f6326b84)
  • omitExtraWLInCodeBlocks: add option to omit extra newline at the end of codeblocks (141e3f5)
  • prefixHeaderId: add options to prefix header ids to prevent id clash (141e3f5)
  • Converter.options: add getOption(), setOption() and getOptions() to Converter object (db6f79b0)

Breaking Changes

  • NAMESPACE: showdown's namespace changed.

    To migrate your code you should update all references to Showdown with showdown.

  • Converter: converter reference changed from converter to Converter.

    To migrate you should update all references to Showdown.converter with showdown.Converter

  • angular: angular integration was removed from core and now lives in it's own repository.

    If you're using angular integration, you should install ng-showdown. Ex: bower install ng-showdown

  • extensions: showdown extensions were removed from core package and now live in their own repository. See the project's github page for available extensions