Commit Graph

263 Commits (master)

Author SHA1 Message Date
Estevao Soares dos Santos f0d25b7bd5 fix(listeners): fix listeners typo
Closes #290
2016-12-01 15:48:30 +00:00
Estevao Soares dos Santos d2fc2a0c5c feature(excludeTrailingPunctuationFromURLs): excludes trailing punctuation from auto linked URLs
Closes #266, #308
2016-12-01 15:25:46 +00:00
Estevao Soares dos Santos 0942b5e87d feature(simpleLineBreaks): parse linebreaks as <br />
This option enables linebreaks to always be treated as `<br />` tags
without needing to add spaces in front of the line, the same way GitHub does.

Closes #206
2016-11-30 18:04:17 +00:00
Estevao Soares dos Santos 5d57d71ef7 Update README.md 2016-11-25 19:51:36 +00:00
Estevao Soares dos Santos 0be39bccae feat(disableForced4SpacesIndentedSublists): option that disables the requirement of indenting nested sublists by 4 spaces 2016-11-11 08:15:24 +00:00
Estevao Soares dos Santos 1a232e8717 chore: fix small typo in options description 2016-11-11 07:57:56 +00:00
Estevao Soares dos Santos d51be6e0b4 fix(lists): enforce 4 space indentation in sublists
Acording to the spec, multi paragraph (or block) list item requires subblocks
to be indented 4 spaces (or 1 tab). Although, this is mentioned in the documentation,
Showdown didn't enforce this rule in sublists because other implementations,
such as GFM also didn't. However, in some edge cases, this led to inconsistent behavior,
as shown in issue #299. This commit makes 4 space indentation in sublists
mandatory.

BREAKING CHANGE: syntax for sublists is more restrictive. Before, sublists SHOULD be
indented by 4 spaces, but indenting 2 spaces would work. Now, sublists MUST be
indented 4 spaces or they won't work.

With this input:
```md
* one
  * two
    * three
```

Before (ouput):
```html
<ul>
  <li>one
    <ul>
      <li>two
        <ul><li>three</li></ul>
      <li>
    </ul>
  </li>
<ul>
```

After (output):
```html
<ul>
  <li>one</li>
  <li>two
    <ul><li>three</li></ul>
  </li>
</ul>
```

To migrate either fix source md files or activate the option `disableForced4SpacesIndentedSublists` (coming in v1.5.0):

```md
showdown.setOption('disableForced4SpacesIndentedSublists', true);
```
2016-11-11 07:56:29 +00:00
Estevao Soares dos Santos 9cfe8b1412 fix(lists): fix sublists inconsistent behavior
Nested ul and ol lists behave inconsistently in the requirement
of having 3 spaces to be considered a nested list.
This fix changes the requirement to only one space in
both cases.

Closes #299
2016-11-09 02:54:18 +00:00
Estevao Soares dos Santos b7a69e2dd6 release 1.4.4 2016-11-02 21:16:46 +00:00
Estevao Soares dos Santos 2b813cd3fb fix(lists linebreaks): fix lists linebreaks in html output
Closes #291
2016-09-29 01:12:27 +01:00
Estevao Soares dos Santos f97e072bc4 fix(double linebreaks): fix double linebreaks in html output
Closes #291
2016-09-29 00:50:58 +01:00
Estevao Soares dos Santos 8cd79e1344 chore(travis): update node versions 2016-09-29 00:20:30 +01:00
Estevao Soares dos Santos b7e7560f87 fix: make some regexes a bit faster and make tab char equivalent to 4 spaces 2016-08-30 06:24:19 +01:00
Estevao Soares dos Santos 799abea767 fix(parser): fix issue with comments inside nested code blocks
Code blocks containing comments are now converted correctly when nested in list items.

Closes #288
2016-08-30 06:07:57 +01:00
Estevao Soares dos Santos 0cc55b07ee fix(simplifiedAutoLink): fix simplified autolink to match GFM behavior
Using the simplifiedAutoLink option does not return the expected GFM behaviour when parsing links without a http prefix.
Previously, `www.google.com` would be parsed into `<a href="www.google.com">www.google.com</a>`.
With this fix, showdown behaves like GFM, and the result is `<a href="http://www.google.com">www.google.com</a>`

Closes #284, closes #285
2016-08-19 19:12:25 +01:00
Estevao Soares dos Santos 984942e239 fix(ie8 compatibility): Improve ie8 compatibility
Several fixes to improve compatibility with Internet Explorer 8

Closes #275, Closes #271
2016-07-20 22:26:15 +01:00
Estevao Soares dos Santos 740f580f11 Merge branch 'master' of https://github.com/showdownjs/showdown
# Conflicts:
#	dist/showdown.js
#	dist/showdown.js.map
#	dist/showdown.min.js
#	dist/showdown.min.js.map
2016-07-20 22:07:49 +01:00
Estevao Soares dos Santos 238726ca91 fix(comments): Fix html comment parser
When an html comment was followed by a a long line of dashes, it would
freeze the parser as the lookahead in the html comment parser regex was
very slow. The regex was modified and simplified, so no lookahead is
needed anymore.

Closes #276
2016-07-20 22:01:10 +01:00
Butch Marshall cc4cdf7306 Ran build 2016-06-27 15:58:35 +00:00
Estevao Soares dos Santos 3de3a0bc3a chore: force gir binary mode on dist files 2016-06-21 02:03:51 +01:00
Estevao Soares dos Santos 413511c731 chore: fix line endings, enforcing lf in js files 2016-06-21 02:01:22 +01:00
Estevao Soares dos Santos 8591ec8196 Merge branch 'develop' into feature/source_indentation_auto_removal 2016-06-21 01:42:50 +01:00
Estevão Soares dos Santos 73206b07fb fix(image-parser): fix ref style imgs after inline style imgs not parsing correctly
When reference style and inline style are mixed together, in the same line, it produces weird parsing bugs. This commit fixes this

Closes #261
2016-06-08 17:16:49 +01:00
Estevão Soares dos Santos 261f127f7e feat(smart-indent-fix): fix for es6 identation problems
Closes #259
2016-06-07 01:23:52 +01:00
Estevão Soares dos Santos ddaacfc41a fix(tables): fix table heading separators requiring 3 dashes instead of 2
Closes #256
2016-05-17 21:27:40 +01:00
Estevão Soares dos Santos e586201025 release 1.4.0 2016-05-13 16:28:47 +01:00
Estevão Soares dos Santos e0726a6e42 feature(evt_listeners): make globals var accessible to listeners 2016-03-20 17:08:44 +00:00
Estevão Soares dos Santos 6e5073d977 chore: remove html beautify from tests 2016-02-02 00:29:06 +00:00
Estevão Soares dos Santos ac89fb918b buiuld 2016-02-01 03:49:56 +00:00
Estevão Soares dos Santos f58f014bc3 fix(tables): fix tables to match github's md spec
Now Leading and trailing pipes (|) are optional in tables

Closes #230
2016-01-25 05:24:54 +00:00
Estevão Soares dos Santos 71a5873902 fix(HTMLParser): fix code tags parsing
Closes #231
2016-01-25 03:01:54 +00:00
Estevão Soares dos Santos 4c68452999 chore: remove stray console.log 2016-01-25 01:16:51 +00:00
Estevão Soares dos Santos 7d0436d210 fix(HTMLParser): fix ghCodeBlocks being parsed inside code tags
When using html pre/code tags to wrap github's fenced code block syntax,
showdown would parsed them instead of treating them like plain code.

Closes #229
2016-01-25 01:04:06 +00:00
Estevão Soares dos Santos e8852a83bb refactor: clean regex helper functions 2016-01-02 01:16:40 +00:00
Estevão Soares dos Santos c97f1dc6b1 feat(markdown="1"): enable parsing markdown inside HTML blocks
Enable parsing markdown inside HTML blocks if those blocks have an attribute called markdown="1".
This feature is EXPERIMENTAL! As such, the behavior might change on future releases.

Closes #178
2016-01-02 01:08:17 +00:00
Estevão Soares dos Santos 2746949d7d fix(hashHTMLBlock): fix issue with html breaking markdown parsing
Closes #220
2016-01-01 23:33:33 +00:00
Adam Carr 74470ededa removing define module name as it breaks aliasing the module name 2015-12-22 20:24:53 -08:00
Estevão Soares dos Santos 5669317fe4 fix(strikethrough): Fix strikethrough issue with escaped chars
Closes #214
2015-10-30 01:00:30 +00:00
Estevão Soares dos Santos f81789f0fb release: release 1.3.0 2015-10-19 03:27:54 +01:00
Estevão Soares dos Santos f4cb29e05a Merge branch 'develop' into feature/event_mediator
Conflicts:
	dist/showdown.js
	dist/showdown.js.map
	dist/showdown.min.js
	dist/showdown.min.js.map
	src/converter.js
	src/subParsers/blockGamut.js
	src/subParsers/codeSpans.js
2015-10-19 03:20:20 +01:00
Estevão Soares dos Santos e86aea8183 fix(literalMidWordUnderscores): fix different behavior with asterisks
Closes #198
2015-10-19 03:09:50 +01:00
Estevão Soares dos Santos 3097bd45c2 feat(hashHTMLSpans): Add support for hashing span elements
This feature enables hashing span elements that should not be touched by
showdown. For instance, `<code>` tags in markdown source should not be
parsed by showdown, so the text inside them remains unchanged.
This is made possible by a new exciting internal feature,
matchRecursiveRegExp.

Closes #196, Closes #175, Partially reverts 5f043ca
2015-10-19 01:55:35 +01:00
Estevão Soares dos Santos e928622664 chore: add grunt task to add newline to end of built files
Closes #202
2015-10-14 21:44:19 +01:00
Estevão Soares dos Santos 8ebb25e486 fix(simpleautolink): fix mail simpleAutoLink to ignore urls with @ symbol
Urls with @ symbol will not be incorrectly converted to mail addressed

Closes #204
2015-10-07 04:46:28 +01:00
Estevão Soares dos Santos cf2a70c966 Merge branch 'develop' 2015-08-27 05:23:41 +01:00
Estevão Soares dos Santos 50256233eb fix(tables): fix md tables being parsed inside indented code blocks.
Closes #193
2015-08-27 03:41:59 +01:00
Estevão Soares dos Santos ed2cf595b0 fix(blockQuote): fix 'github style codeblocks' not being parsed inside 'blockquote'
Closes #192
2015-08-25 21:10:49 +01:00
Estevão Soares dos Santos b81c416a31 docs(README.md): add libraries that use showdown 2015-08-23 03:31:55 +01:00
Estevão Soares dos Santos e754668814 Merge branch 'hotfix/#191' into develop 2015-08-23 03:12:43 +01:00
Estevão Soares dos Santos 3df706248f fix(blockGamut): fix for headings inside blockquotes
The spec states that you can be lazy and only put the `>` before the first line of a hard-wrapped paragraph.
It also states that blocquotes can contain any other md element inside.
This means headings and horizontal rules should be included in the blockquote but, right now, are treated as
independent entities

Closes #191
2015-08-23 03:11:11 +01:00
Estevão Soares dos Santos b6c8b497db docs(lists.js): fix missing jsdoc parameter 2015-08-23 02:46:04 +01:00
Estevão Soares dos Santos 636fd5959d docs(converter.js): fix return type of Converter function 2015-08-23 02:21:00 +01:00
Estevão Soares dos Santos 7dc3fb1d25 fix(simpleAutoLinks): fix emails being treated as simple urls
Closes #187
2015-08-11 05:58:54 +01:00
Estevão Soares dos Santos 2734326e19 feat(eventDispatcher): add an event dispatcher to converter 2015-08-03 03:47:49 +01:00
Estevão Soares dos Santos ea6031a25f release 1.2.2 2015-08-02 16:09:04 +01:00
Estevão Soares dos Santos 7720c88bfc fix(lists): fix github code blocks not being parsed inside lists
Fix ghCodeBlocks not being correctly parsed inside lists. Also, as a side
effect, fixes issues with consecutive lists and extra paragraphs being
added into lists.

Closes #142, Closes #183, Closes #184
2015-08-01 21:05:28 +01:00
Estevão Soares dos Santos 086c41de54 release 1.2.1 2015-07-22 18:47:51 +01:00
Estevão Soares dos Santos 9ab2af0e89 build 2015-07-14 21:17:27 +01:00
Estevão Soares dos Santos 62ba3733cd feat(smoothLivePreview): fix weird effects due to parsing incomplete input 2015-07-14 17:10:52 +01:00
Estevão Soares dos Santos 7ee2017c56 fix(subParsers/italicsAndBold.js): fix broken em/strong tags when used with literalMidWordUnderscores
When literalMidWordUnderscoresis set to true, em and strong tags that start or end a paragraph don't get parsed as such.
This fixes this issue.

Closes #174
2015-07-14 16:51:26 +01:00
Estevão Soares dos Santos b7f5e32e1a feat(subParsers/githubCodeBlock): add extra language class to conform to html5 spec 2015-07-14 00:41:59 +01:00
Estevão Soares dos Santos 6176977558 fix(subParser/tables): fix undefined error in malformed tables
Cannot read property 'trim' of undefined happens when the parser is fed a malformed table.
This happens in live previews (for instance, when using Angularjs).
2015-07-14 00:37:53 +01:00
Estevão Soares dos Santos d079154260 Merge branch 'feature/cli' into develop
Conflicts:
	.gitignore
	src/subParsers/headers.js
2015-07-13 05:16:09 +01:00
Estevão Soares dos Santos f6a33e402c feat(CLI): add a simple cli tool 2015-07-13 05:09:03 +01:00
Estevão Soares dos Santos be72b4879f fix(headerLevelStart): fix for NaN error when specifying a non number as headerLevelStart param 2015-07-13 01:35:36 +01:00
Estevão Soares dos Santos 67df740b1a docs(CREDITS.md): update credits 2015-07-12 02:36:24 +01:00
Estevão Soares dos Santos 7e55bceb0e feat(flavours): add markdown presets/flavors
This feature enables users to select a preset/flavor.
A flavor is just a preset of options, a shortcut so users don't have to set each option one by one.

Closes #164
2015-07-12 02:15:35 +01:00
Estevão Soares dos Santos 20ca099f56 chore: add class to tasklist items 2015-07-11 23:09:47 +01:00
Estevão Soares dos Santos dc72403acc feat(tasklists): add support for GFM tasklists
Github Flavored Markdown supports tasklist by `[x]` or `[ ]` after list item marker.
This commit adds this feature to showdown through an option called "tasklists".

Related to #164
2015-07-11 23:02:02 +01:00
Estevão Soares dos Santos c33f98884b feat(ghCodeBlocks): add option to disable GH codeblocks
GFM support fenced codeblocks. Showdown, since very early, adopted this too.
It is now possible to disable GFM codeblocks with the option "ghCodeBlocks" set to false.
It is enabled by default
2015-07-11 20:33:11 +01:00
Estevão Soares dos Santos 5ec75c459b fix(subparsers/tables.js): fix parser order so that tables include all spanGamut elements 2015-07-11 19:50:26 +01:00
Estevão Soares dos Santos 1c8c928d0a feat(subParsers/table): support for table alignment
Credits to [torcellite (Karthik Balakrishnan)](https://github.com/torcellite)
2015-07-11 18:21:43 +01:00
Estevão Soares dos Santos 3a924e3c7e feat(tables): add support for GFM tables
Github Flavored Markdown supports a specific table syntax. Table support was already available as an extension.
With this commit, the feature was moved to core, adding this feature to showdown through an option called "tables".

Related to #164
2015-07-11 16:44:24 +01:00
Estevão Soares dos Santos 43e9448d6e feat(strikethrough): add support for GFM strikethrough
Github Flavored Markdown supports strikethrough (`<del>`) syntax using double tilde `~~` delimiters.
This commit adds this feature to showdown through an option called "strikethrough".

Related to #164
2015-07-11 15:59:06 +01:00
Estevão Soares dos Santos 0c0cd7db99 feat(literalMidWordUnderscores): add support for GFM literal midword underscores
Github Flavored Markdown does not parse underscores in the middle of a word as emphasis/bold.
This commit adds this feature to showdown through an option called "literalMidWordUnderscores".

Related to #164
2015-07-11 15:45:58 +01:00
Estevão Soares dos Santos cff0237299 feat(simplifiedAutoLink): add support for GFM autolinks
Github Flavored Markdown detects urls and mails embeded in the text without any extra markup or delimiter.
This commit adds this feature to showdown through an option called "simplifiedAutoLink".
Related to #164
2015-07-11 02:42:53 +01:00
Estevão Soares dos Santos 91e7b95796 chore: several small build enhancements
+ build
2015-07-10 21:00:21 +01:00
Estevão Soares dos Santos 5a4ae79c54 Release 1.1.0 2015-06-18 01:22:42 +01:00
Estevão Soares dos Santos b84ac67dac feat(headerLevelStart): add support for setting the header starting level
Closes #69
2015-06-17 02:19:44 +01:00
Estevão Soares dos Santos 1d149c8806 chore: fix jshint 2015-06-17 01:26:50 +01:00
Estevão Soares dos Santos af82c2b616 feat(image dimensions): add support for setting image dimensions within markdown syntax
This feature allows users to define the image dimensions using markdown syntax:
```
![my image](img.jpg =100x80 "image title")
```
To enable this feature, use the option `parseImgDimensions`.

Closes #143
2015-06-17 01:22:05 +01:00
Estevão Soares dos Santos 0ac8972da1 build 2015-06-15 14:56:47 +01:00
Estevao Soares dos Santos 0bdd02b2cc fix(subParsers/lists.js): partial fix for odd behavior on multiple consecutive lists
Consecutive lists we're previously being condensed into one unique list, with odd paragraph output.
This fix correctly splits lists, but does not change the weird paragraph output

closes #142
2015-06-13 14:59:14 +01:00
Estevao Soares dos Santos 42240ba82c test: add karlcow's testsuite
Also refactor tests to improve maintainability
2015-06-11 01:29:42 +01:00
Estevao Soares dos Santos 9a2411b05f fix(subParsers/stripLinkDefinitions): fix title attribute in link definitions
According to spec, the title attribute in link definitions can be wrapped in single quotes. Previously, showdown didn't support this.
Now the title attribute can be wrapped in single quotes.
2015-06-08 04:16:58 +01:00
Estevao Soares dos Santos e27e16bdc5 fix(subParsers/images.js): fix empty title attribute in img tags
This big was introduced on purpose to mimic markdown.pl. Since we no longer match our development with that library,
it makes no sense to keep it.
2015-06-08 03:57:18 +01:00
Estevao Soares dos Santos 7ac893e93b feat(noHeaderId): add option to suppress automatic generation of ids in headers
Passing the option `noHeaderId; true` to showdown or showdown converter removes the automatic generation of header ids
2015-06-08 03:41:14 +01:00
Estevao Soares dos Santos dcbdc61e9d fix(output modifiers): fix for output modifiers running twice
Output modifiers were being ran twice. This commit fixes that
2015-06-07 19:17:02 +01:00
Estevao Soares dos Santos 4ebd0caa27 feature(extensionLoading): add support to legacy extensions in the new extension mechanism
Old extensions that register themselves in `showdown.extensions` can be loaded and validated using the new extension loading mechanism.
However, a warn is issued, alerting users and developers that the extension should be updated to use the new mechanism

BREAKING CHANGE: Deprecates `showdown.extensions` property. To migrate, you should use the new method `showdown.extension(<ext name>, <extension>)` to register the extension.
2015-06-07 19:02:45 +01:00
Stefano Brilli db46922e19 New build 2015-06-07 13:16:47 +02:00
Estevão Soares dos Santos 33f64f60c9 feature(extensionLoading): refactor extension loading mechanism 2015-05-31 20:56:28 +01:00
Estevão Soares dos Santos e3a4541ab3 Revert "fix(suparsbers/lists.js): fix odd behavior for multiple consecutive lists"
This reverts commit 11f32e04a6.
2015-05-30 00:10:21 +01:00
Estevão Soares dos Santos 11f32e04a6 fix(suparsbers/lists.js): fix odd behavior for multiple consecutive lists 2015-05-30 00:09:30 +01:00
Estevão Soares dos Santos a3b412c502 bump version, Changelog and Credits 2015-05-28 22:35:56 +01:00
Alexandre Courtiol 53155088cb fix(build): add missing comma in footer 2015-05-28 13:50:57 +02:00
Estevão Soares dos Santos 2baf7bf709 RELEASE 1.0.0 2015-05-27 16:36:53 +01:00
Estevão Soares dos Santos db6f79b08d feat(Converter.options): add getOption(), setOption() and getOptions() to Converter object
Provides a way to get and set options directly in a Converter object
2015-05-27 01:37:01 +01:00
Estevão Soares dos Santos ddd6011df2 fix(showdown): fix for options merging into globalOptions
Passing an option to a specific converter affects other instances of the converter since options are merged into showdown's global options.
This commit fixes that.

Closes #153
2015-05-26 19:46:07 +01:00
Estevão Soares dos Santos 871cde21a5 chore(build): update build 2015-05-15 22:34:34 +01:00
Estevão Soares dos Santos f93c4956af Preparing 1.0.0-alpha1 release 2015-05-14 01:59:33 +01:00
Estevão Soares dos Santos 3ecf9c4f8e chore(): remove angular from core package 2015-05-13 22:36:25 +01:00
Estevão Soares dos Santos fb3e0ba3bc fix(subParsers/hashHTMLBlocks.js): fix rendering problems with html5 block elements.
Some HTML5 block elements were not being properly ignored. This caused problems in rendering markdown as showdown would add additional <br /> to some block elements.
This commit should fix this issue.

Closes #90, closes #140, closes #147
2015-04-23 21:51:32 +01:00
Estevão Soares dos Santos 95ed7c682e fix(extensions): support for old extension loading mechanism 2015-04-23 00:15:54 +01:00
Estevão Soares dos Santos 7deea25a5e chore(): new build 2015-04-22 16:58:53 +01:00
Estevão Soares dos Santos 0fd10cb56a Added new extension registering method 2015-03-01 18:15:32 +00:00
Estevão Soares dos Santos 18ba4e756f fix(helpers): fix wrong function call 'escapeCharacters' due to old strayed code 2015-01-19 15:42:20 +00:00
Estevão Soares dos Santos 79829dbbf1 chore(): code style fix and tests fix due to code style changes 2015-01-19 12:04:22 +00:00
Estevão Soares dos Santos c367a4b9a1 feat(uniqueHeaderId): add unique id prefix and suffix to headers
If two headers have similar texts, the generated id could be equal. In order to prevent id clash:
  - A unique suffix is added if a header id already exists
  - Option to add a prefix to header id
  - Update of correspondent tests
  - (credits to nicovalencia)

Closes #81, closes #82
2015-01-18 02:12:32 +00:00
Estevão Soares dos Santos c9de4b6b1f Revert "feat(allowBlockIndents): Indented inline block elements can be parsed as markdown"
This reverts commit f6326b84e4.
2015-01-17 00:13:12 +00:00
Estevão Soares dos Santos f6326b84e4 feat(allowBlockIndents): Indented inline block elements can be parsed as markdown
When the text is pulled from indented HTML elements, ex:
```
 <body>
    <div>
        ## Content to be converted
    </div>
 </body>
```
it no longer becomes wrapped in code/pre tags. A new option is also available (allowBlockIndents) that when set to false, reverts to the previous behavior
2015-01-16 23:39:20 +00:00
Estevão Soares dos Santos 0a8d2836c7 refactor(grunt): Adds support for minification and minified source map. 2015-01-16 21:50:44 +00:00
Estevão Soares dos Santos bf094ba446 test(): browser and node tests now live in different directories
This enables one to run the appropriate tests according to evironment
2015-01-16 21:48:28 +00:00
Estevão Soares dos Santos eae5f0e01f Major code refactoring 2015-01-15 21:21:33 +00:00