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
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
BREAKING CHANGE: makeHtml subparsers names changed, by prepending 'makehtml.' to them.
Example: 'anchors', subparser is now named 'makehtml.anchors'.
Event names were also changed to reflect this.
Example: 'anchors.before' is now named 'makehtml.anchors.before'.
**To migrate:**
If you have a listener extension, replace the old event name with the new one. Example:
Replace this
```js
showdown.extension('myext', function() {
return [{
type: 'listener',
listeners: {
'anchors.before': function (event, text, converter, options, globals) {
//... some code
return text;
}
}];
});
```
with this
```js
showdown.extension('myext', function() {
return [{
type: 'listener',
listeners: {
'makehtml.anchors.before': function (event, text, converter, options, globals) {
//... some code
return text;
}
}];
});
```
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