Commit Graph

23 Commits

Author SHA1 Message Date
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
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
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
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
Estevão Soares dos Santos
77007181d8 Merge branch 'master' into develop 2016-04-26 19:19:00 +01:00
Sam Bottoni
656aa98305 Support for case-insensitive checkboxes for render. [x] == [X] 2016-04-26 09:08:50 -05: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
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
b6c8b497db docs(lists.js): fix missing jsdoc parameter 2015-08-23 02:46:04 +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
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
1d149c8806 chore: fix jshint 2015-06-17 01:26:50 +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
Estevão Soares dos Santos
0da9626408 chore(): code fix to pass jscs linter 2015-01-19 14:57:43 +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
8b000b134a chore(all): code style change 2015-01-19 11:37:21 +00:00
Estevão Soares dos Santos
eae5f0e01f Major code refactoring 2015-01-15 21:21:33 +00:00