Note: there was a breaking change that we forgot to document. Ww write the breaking change here for it to be picked up in the future 3.0 release,
even though it was introduced in commit 3871765
BREAKING CHANGE: 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
```
Closes#916
The CLI was completely rewrote. Changed dependency from yargs to commanderjs,
which is cleaner, faster and has no dependencies.
Also added a complete testsuite for the cli.
Closes#893, #894
Add rel="noreferrer" to links when openLinksInNewWindow is on. Also add noopener when openLinksInNewWindow is on.
target="_blank" without also adding rel="noopener noreferrer" creates a vulnerability
(since the site you're linking to has access to the window.opener by default.
This adds rel="noopener noreferrer" to links generated by the makeHtml converter when openLinksInNewWindow is true.
Closes#670
Showdown now supports a simple HTML to Markdown converter.
**Usage:**
```
var conv = new showdown.Converter();
var md = conv.makeMarkdown('<a href="/url">a link</a>');
```
Closes#388, #233
In some circumstances, on a reference style image, the last capturing
group is ignored, which causes the fucntion argument to return the number
of matches instead of a string (or undefined).
Checking if the title parameter is a string ensures that the title
parameter is actually something that was caught by the regex and not some
metadata.
Closes#585
One or more spaces before the language declaration of a code block is supported by Github.
E.g.
``` html
<div>HTML!</div>
```
``` html
<div>HTML!</div>
```
```html
<div>HTML!</div>
```
Closes#569
With this option enabled, this:
```md
> some text
> some other text
```
witll result in:
```html
<blockquote>
<p>some text</p>
</blockquote>
<blockquote>
<p>some other text</p>
</blockquote>
```
This is the default behavior of GFM.
Closes#477
A simple metadata parser can be useful in markdown documents.
This commit introduces the feature, with the following syntax:
--- or ««« at tstart of the document,
(optionally) followed by a alphanumeric format identifier
followed by key value pairs separated by a colon and a space
followed by --- or ÂÂÂ
Also, adds methods for retrieving the parsed metadata, namely:
getMetadata() and getMetadataFormat
Closes#260
Code spans are now hashed after parsing which means extensions
that listen to spanGamut events no longer need to worry about
escaping "custom" magic chars inside code spans.
Closes#464
Syntax is:
```
__double underscores__
or
___triple unserscores___
```
Keep in mind that, with this option enabled, underscore no longer
parses as `<em>` or `<strong>`
Closes#450
Implement support for starting ordered lists at an arbitrary number
Closes#377
BREAKING CHANGE: Since showdown now supports starting ordered lists
at an arbitrary number, list output may differ.
Wrapping base64 strings, which are usually extremely long lines of text, is now supported.
Newlines can be added arbitrarily, as long as they appear after the comma (,) character.
Closes#429
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.
Closes#409
In code, the option appeared both as 'tableHeaderId' and 'tablesHeaderId',
although only the first form had effect. In documentation was referenced
as 'tablesHeaderId'.
Option is now fixed in code to reflex the documentation and table parser
accepts both forms, with and without an s.
Closes#412
It’s useful for non-Latin texts, where header might be, for example, in Russian, but user wants id to be in English. This feature allows user to set id for header manually, using curly braces:
## Привет, мир {hello-world}
Closes#383