Commit Graph

210 Commits

Author SHA1 Message Date
Estevao Soares dos Santos
df76f984a3 chore: add test for repeat helper
Several test cleanups and minor test fixes
2022-03-10 12:56:34 +00:00
Estevao Soares dos Santos
c3411a567d 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.

Merged branch 'cli_refactor' into develop

Closes #893, #894
2022-03-03 12:48:23 +00:00
Estevao Soares dos Santos
bd093ab493 chore: fix jsdoc in converter.js 2022-03-01 15:30:59 +00:00
Estevao Soares dos Santos
8cecdf0382 fix(lists): codeblocks inside lists are now correctly parsed
Closes #494
2022-02-25 01:06:09 +00:00
Estevao Soares dos Santos
5e0ed809db feat(moreStyling): add some useful classes for css styling
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
2022-02-24 01:57:08 +00:00
Estevao Soares dos Santos
67114255ad fix(gfmCodeBlocks): allow the info string in gfmCodeBlocks to contain spaces
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
2022-02-24 01:22:11 +00:00
Estevao Soares dos Santos
9f0b36d95b chore: active CI in develop branch 2022-02-24 00:23:15 +00:00
cjwind
626f661e8e
fix(lists): Fix makeMarkdown tasklist (#846)
Fix makeMarkdown() with tasklist by adding input subparser.

Close #774

Co-authored-by: Estevão Soares dos Santos <estevao.santos@gmail.com>
2022-02-24 00:16:31 +00:00
Vladimir Vuksanovic
ebc730c0a0
fix(metadata): Restore dollar signs and tremas. (#730)
Closes #626

Co-authored-by: Estevão Soares dos Santos <estevao.santos@gmail.com>
2022-02-24 00:03:20 +00:00
Estevao Soares dos Santos
3fd1ea6d7f chore: try to make CI work in master 2022-02-23 23:52:58 +00:00
Estevao Soares dos Santos
e24d06e265 Merge branch 'master' into develop
# Conflicts:
#	Gruntfile.js
#	dist/showdown.js
#	dist/showdown.js.map
#	dist/showdown.min.js
#	dist/showdown.min.js.map
#	package-lock.json
#	package.json
#	src/converter.js
#	src/subParsers/makehtml/tables.js
2022-02-23 19:15:46 +00:00
Estevao Soares dos Santos
6ded499b91 refactor: code cleanup 2022-02-23 05:11:26 +00:00
Estevao Soares dos Santos
d23b028bb3 chore: update dev dependencies and fix code style 2022-02-23 05:04:55 +00:00
SyntaxRules
f9d9705d3c chore(release): update dist/* files for further testing 2021-11-14 13:04:45 -07:00
Vladimir Vuksanovic
5d494c8202 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.
2019-10-04 16:45:27 +02:00
Estevao Soares dos Santos
6ee6d8c9d9 rebuild 2018-10-24 03:27:16 +01:00
Vladimir Vuksanovic
4378abb4fa 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-10-24 03:23:28 +01:00
Vladimir Vuksanovic
81edc70da7 fix(underline): Make underline lazy
fix underline if literalMidwordUnderscores option is enabled
it should end at the nearest closing underscores, not the furthest
2018-10-21 15:20:39 +02:00
Estevao Soares dos Santos
d3ebff7ef0 fix(links): a number of issues with links subparser
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
2018-09-25 04:04:59 +01:00
Estevao Soares dos Santos
798bbe6751 refactor: change anchor subparser name to link 2018-09-23 20:34:54 +01:00
Estevao Soares dos Santos
18c4b6ebac chore: build 2018-09-15 14:59:25 +01:00
Estevao Soares dos Santos
26abc7a795 fix(headings): inconsistent behavior in lists
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
2018-09-15 14:45:48 +01:00
Estevao Soares dos Santos
d9eea64794 remove(literalMidWordAsterisks): remove literalMidWordAsterisks feature
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>
2018-09-14 22:46:03 +01:00
Estevao Soares dos Santos
c7a89eaae4 build 2018-09-14 17:04:38 +01:00
Estevao Soares dos Santos
b0d475fc08 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-09-14 15:49:24 +01:00
Estevao Soares dos Santos
0c6b5bdc4b Merge branch 'develop' of https://github.com/showdownjs/showdown into develop
# Conflicts:
#	dist/showdown.js
#	dist/showdown.js.map
#	dist/showdown.min.js
#	dist/showdown.min.js.map
2018-09-14 14:11:08 +01:00
Estevao Soares dos Santos
05ef5c55dc refactor(event dispatcher): make event dispatcher return an object instead of text 2018-09-14 14:10:15 +01:00
Lee Moody
1f0242c6ea 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-08-08 01:25:32 +01:00
Estevao Soares dos Santos
e80a548c9b build 2018-07-07 19:15:02 +01:00
GenaBitu
f20dc75024 fix: replaces \u00A0 with &nbsp;
Closes #521
2018-05-07 19:14:58 +01:00
Estevao Soares dos Santos
410b453049 fix jsdom polyfill 2017-12-23 14:00:20 +00:00
Estevao Soares dos Santos
17222b3d5a build 2017-12-23 13:29:39 +00:00
Estevao Soares dos Santos
9825fd2bd0 Merge commit 'eec56fb1c015663947f6ed393f133bdc7a3e2a64' 2017-12-16 18:45:40 +00:00
Estevao Soares dos Santos
3db9200d2c refactor(subParsers): change name and directory of subparsers
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;
      }
  }];
});
```
2017-12-16 18:25:44 +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
248254c99a freeze dev dependencies 2017-11-28 03:16:15 +00:00
Estevao Soares dos Santos
e5d7705569 first step for reverse convert 2017-11-27 06:44:25 +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