Commit Graph

287 Commits

Author SHA1 Message Date
Estevão Soares dos Santos
914129f5dc test(cli)!: Add test for multiple config options
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
2022-04-21 01:18:39 +01:00
Estevao Soares dos Santos
8b488825ac fix(cli): cli displays the corrent version number 2022-03-08 17:59:04 +00:00
Estevao Soares dos Santos
f8c4bd26fc fix(cli): fix cli to work with yargs
Related to #893
2022-03-07 19:24:08 +00:00
Estevao Soares dos Santos
3871765ac1 fix(cli): cli now works properly
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
2022-03-03 12:15:50 +00:00
Dennis Shtatnov
366ef28a7a fix(extension-registering) removeExtension implementation 2022-02-01 21:03:38 -07:00
Vladimir Vuksanovic
62636d085d feature(ellipsis): Add option to disable ellipsis
Add ability to disable ellipsis parser.
This is needed for some use cases. See #634
Defaults to true to keep backwards compatibility.
2022-01-31 22:06:16 -07:00
David Chester
b432da1eee fix reference link impostors 2022-01-31 21:34:33 -07:00
David Chester
525b65f6d6 preserve spaces between inline elements 2022-01-31 21:30:56 -07:00
Estevao Soares dos Santos
25c44207be fix: allow escaping of colons
Previously, you couldn't escape colons (as they were semi-magic markdown characters).
Colons (:) can now be backslash escaped.
2022-01-31 18:25:42 -07:00
SyntaxRules
434eaff71e chore(deps): update all dependecies to the latest; make eslint work 2022-01-31 17:07:27 -07:00
Estevao Soares dos Santos
483e51f7a6 release 1.9.1 2019-11-02 23:04:21 +00:00
Jammerware
1cd281f064 fix(openLinksInNewWindow): add rel="noopener noreferrer" to links
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
2019-11-02 22:43:50 +00:00
Estevao Soares dos Santos
e4b0e69724 feat(converter.makeMarkdown): add an HTML to MD converter
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
2018-11-10 02:39:38 +00:00
Vladimir Vuksanovic
5c0d67e04a fix(italicsAndBold): Make italicsAndBold lazy (#608)
fix italicsAndBold if literalMidwordUnderscores option is enabled
it should end at the nearest closing underscores, not the furthest

Closes #544
2018-11-10 00:09:19 +00:00
Vladimir Vuksanovic
69b816e431 docs(completeHTMLDocument): Change completeHTMLDocument comment (#610)
Fix completeHTMLDocument comment to reflect its actual behavior
2018-11-10 00:03:38 +00:00
Vladimir Vuksanovic
dc70e68983 docs(emoji): Change emoji comment (#611)
Fix emoji comment to reflect its actual behavior
2018-11-09 23:56:19 +00:00
Vladimir Vuksanovic
0c6f345c4c fix(italicsAndBold): Make italicsAndBold lazy (#608)
fix italicsAndBold if literalMidwordUnderscores option is enabled
it should end at the nearest closing underscores, not the furthest

Closes #544
2018-11-09 23:55:02 +00:00
Estevao Soares dos Santos
828c32f503 fix(gfm-codeblocks): leading space no longer breaks gfm codeblocks
Now GFM Code Blocks can have up to 3 spaces before the backticks

Closes #523
2018-10-16 23:27:08 +01:00
Estevao Soares dos Santos
dfeb1e26f3 fix(mentions): allow for usernames with dot, underscore and dash
Closes #574
2018-10-16 23:25:05 +01:00
Estevao Soares dos Santos
980e7028e5 fix(images): fix js error when using image references
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
2018-10-16 23:07:21 +01:00
Lee Moody
24bf7b132d fix(gfm-codeblock): add support for spaces before language declaration
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
2018-10-16 23:00:36 +01:00
GenaBitu
8bc1f42bef fix(nbsp): fix replacing of nbsp with regular spaces 2018-10-16 22:57:08 +01:00
Estevao Soares dos Santos
47e8419da1 test: fix emoji tests 2018-10-16 22:52:38 +01:00
Estevão Soares dos Santos
4aca41ca38
fix(emojis): fix emoji excessive size 2018-01-28 03:20:56 +00:00
Estevao Soares dos Santos
fe70e4530b fix(literalMidWordAsterisks): now parses single characters enclosed by * correctly
Closes #478
2017-12-22 18:14:56 +00:00
Estevao Soares dos Santos
da328f2527 feat(splitAdjacentBlockquotes): add option to split adjacent blockquote blocks
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
2017-12-22 09:54:23 +00:00
Estevao Soares dos Santos
63d949f731 feat(metadata): add support for embedded metadata
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
2017-12-10 07:15:09 +00:00
Estevao Soares dos Santos
a8427c9423 feat(completeHTMLOutput): add option to output a complete HTML document 2017-12-10 04:49:24 +00:00
Estevao Soares dos Santos
4ef4c5e674 fix(tables): raw html inside code tags in tables no longer breaks tables
Under certains conditions, raw html inside code tags in tables would break
table parsing. This commit fixes that.

Closes #471
2017-12-05 01:13:11 +00:00
Estevao Soares dos Santos
0c933a01f9 fix(tables): pipe character in code spans no longer breaks table
A code span with a pipe character no longer incorrectly breaks the cell table.

Closes #465
2017-11-23 05:39:53 +00:00
Estevao Soares dos Santos
f4f63c5c39 fix(spanGamut): code spans are hashed after parsing
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
2017-11-23 05:18:20 +00:00
Estevao Soares dos Santos
21194c8a03 fix(literalMidWordAsterisks): no longer treats colon as alphanumeric char
Closes #461
2017-11-17 15:23:23 +00:00
Estevao Soares dos Santos
11936ecb77 fix(openLinksInNewWindow): hash links are not affected by the option
Closes #457
2017-11-11 13:19:19 +00:00
Estevao Soares dos Santos
c956ede4e7 fix(fenced codeblocks): add tilde as fenced code block delimiter
Closes #456
2017-11-11 12:29:36 +00:00
Estevao Soares dos Santos
25f1978666 feat(ellipsis): add auto-ellipsis support
Three dots `...` are now converted automatically into an ellipsis
2017-10-24 17:06:08 +01:00
Estevao Soares dos Santos
084b819b14 feat(underline): add EXPERIMENTAL support for underline
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
2017-10-24 16:46:40 +01:00
Estevao Soares dos Santos
9cdc35e705 feat(ol start num): add support for defining the first num of ol
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.
2017-10-24 15:15:56 +01:00
Estevao Soares dos Santos
5b8f1d312f feat(emoji): add emoji support
Add unicode emoji support to showdown. To enable this feature,
use `emoji: true` option. A list of supported emojis is
available here: https://github.com/showdownjs/showdown/wiki/Emojis

Closes #448
2017-10-24 13:44:49 +01:00
Estevao Soares dos Santos
61929bb262 fix(autolinks): prevent _ and * to be parsed in links
Closes #444
2017-10-24 10:22:13 +01:00
Estevao Soares dos Santos
32800a14a8 refactor: escaped characters within tag attributes 2017-10-24 09:27:08 +01:00
Estevao Soares dos Santos
e862e242f7 refactor: add colon to escaped chars in images and anchors 2017-10-24 09:25:44 +01:00
Estevao Soares dos Santos
66bdd21312 fix(tables): trailing spaces no longer prevent table parsing
If there were a trailing space following the closing | of a single column
table, the table does not get rendered. This fixes the issue.

Closes #442
2017-10-06 12:52:20 +01:00
Estevao Soares dos Santos
d88b095f05 fix(tables): tables are properly rendered when followed by a single linebreak and a list
Closes #443
2017-10-06 12:38:01 +01:00
Estevao Soares dos Santos
3efcd101a2 fix(html-comments): changed regex to precent malformed long comment to freeze showdown
Closes #439
2017-10-02 05:18:10 +01:00
Estevao Soares dos Santos
8c593a4f11 feat(base64-wrapping): support for wrapping base64 strings
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
2017-09-08 20:46:01 +01:00
Jason Mitchell
ff24bdba9f fix(loader): allow AMD loader to be used within Node env
Because of the ordering of the loader, it's not possible use AMD within a Node environment.
2017-08-27 19:20:48 +01:00
Jason Mitchell
466a2eba94 fix(helper.isArray): replace a.constructor === Array with Array.isArray
a.constructor === Array is always falsey when you run showdown within Node's VM API.

Related to https://github.com/nodejs/node/issues/7351

Closes #425
2017-08-26 03:46:38 +01:00
Estevao Soares dos Santos
ff26c08904 feat(rawPrefixHeaderId): add option to prevent showdown from modifying the prefix
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
2017-08-06 18:19:46 +01:00
Estevao Soares dos Santos
5284439edc fix(github flavor): add backslashEscapesHTMLTags to GFM flavor 2017-08-06 17:53:06 +01:00
Estevao Soares dos Santos
1791cf0ebf feat(rawHeaderId): Remove only spaces, ' and " from generated header ids
This option removes only spaces, ' and " from generated Header IDs,
replacing them with dashes. This might generate malformed IDs.

Closes #409
2017-08-06 17:45:04 +01:00