Commit Graph

90 Commits

Author SHA1 Message Date
Estevao Soares dos Santos
d532dea8f0 Merge branch 'master' into develop 2016-12-19 12:16:22 +00:00
Estevao Soares dos Santos
da8fb535c9 fix: parser slowness with certain inputs
A bad desinged regex was causing the parser to become extremelly slow
when given some inputs.

Closes #315
2016-12-19 12:13:30 +00:00
Estevao Soares dos Santos
5d19877590 feat(requireSpaceBeforeHeadingText): option to make space between # and header text mandatory
Credit: @nikz [Nik Wakelin](https://github.com/nikz)

Closes #277
2016-12-17 06:01:15 +00:00
Estevao Soares dos Santos
6e90f7c5ad fix(nbsp): nbsp are replaced with simple spaces 2016-12-17 05:26:15 +00:00
Estevao Soares dos Santos
10b3410934 fix: lines with mutiple dashes being parsed as multilists
This input: `- - - a` causes trouble for the parser,
since it interprets it as multiple sublists, where it should
only interpert it as a list with a single list item.
This commit fixes this behavior.

Closes #312
2016-12-17 05:20:23 +00:00
Estevao Soares dos Santos
0a856d5394 refactor(hr): speed up hr parsing
speed up horizontal rule parsing by simplifying the regex
2016-12-17 03:29:53 +00:00
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
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
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
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
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
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
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
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
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
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
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
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