* startrefactoring the event system
* refactor: blockquotes, code blocks and links refactored
* refactor codeblock to new event system
* refactor subparser until ghcode to new events
* finish adating ghcodeblock to new event
* add headings to new events
* add image to event system
* add emphasisAndStrong to event system
* fix wrong event name in emphasisAndStrong onEnd event
* spanGamut and build
* showdown.helper.event refactored to showdown.Event
* partial
* add links
* add metadata
* add strikethrough and table
* build
* add underline
* add unescapeSpecialChars
* small refactoring
* remove old tables parser
* add lists
* add simple event trigger tests
* build
* fix browserstack
* fix browserstack
* remove testing for ie11 and bumped firefox min version to 45
* fixes and closes#920
* build
* feat(helpers): determined results for email address obfuscation
email address is used as the seed, so it should always provide the same result for a given mail.
utilizes a random number generator shown here: https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript/47593316#47593316
* feat(helpers): added Math.imul() support for older browsers
Co-authored-by: Estevão Soares dos Santos <estevao.santos@gmail.com>
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.
Merged branch 'cli_refactor' into develop
Closes#893, #894
Currently, only adds the class `task-list-item-complete` to completed tasks items in GFM tasklists.
But in the future, each time a css class is deemed to be necessary, should be added under this umbrella
option.
Closes#540
The line with the opening code fence may optionally contain some text following the code fence (the info string); this is trimmed of leading and trailing whitespace and can contain multiple words (but not newlines).
Closes#856
This is a major refactor of the links subparser, previously known as anchors subparser.
Closes#355, #534
BREAKING CHANGE: `excludeTrailingPunctuationFromURLs` option was removed. This is now the default behavior
In text, headings only require a single linebreak to be treated as such.
However, in lists, they would require a double linebreak.
Now, the behavior in lists and text is consistent, requiring only a single
linebreak.
Closes#495
This feature was seen as a bit "duh!" since midword asterisks are not really a thing and, for these situations, you can simply escape the asterisk character.
Closes#499
BREAKING CHANGE: literalMidWordAsterisks option was removed and so asterisks will always retain their markdown magic meaning in a source text.
If you're using this feature, and you wish to retain this option, you can find a shim here: <https://gist.github.com/tivie/7f8a88c89ffb00d2afe6c59a25528386>
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
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