Commit Graph

107 Commits

Author SHA1 Message Date
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
ba7eb7ebaf Merge branch 'cli' of https://github.com/rheber/showdown into feature/cli 2015-07-12 02:36:33 +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
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
2de53a7d03 feat(showdown.getDefaultOptions): add method to retrieve default global options key->values
Showdown default options are now retrievable through `showdown.getDefaultOptions()` function
2015-06-15 14:49:26 +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
3a71b66d24 fix(subParsers/headers); fix bug introduced with noHeaderId option 2015-06-08 03:51:43 +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
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
Estevao Soares dos Santos
e7cb15f1e9 style(converter.js): fix missing semi colon 2015-06-03 02:50:57 +01:00
Estevao Soares dos Santos
d86ed450a8 fix(converter.js): add error if the passed argument is not an object 2015-06-03 01:29:44 +01: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
678348d060 chore(helpers.js): add console polyfill so we can trigger warnings reliably 2015-05-31 13:08:15 +01:00
Estevão Soares dos Santos
6492e74c5b docs(showdown.options): fix jsdocs for methods setOption, getOption and getOptions 2015-05-27 01:43:08 +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
e6f40e190c fix(options.omitExtraWLInCodeBlocks): fix for options.omitExtraWLInCodeBlocks only applying in gitHub flavoured code blocks 2015-05-26 19:57:36 +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
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
a38c76d236 fix(showdown.js): fix showdown extension loader 2015-04-22 16:58:07 +01:00
Estevão Soares dos Santos
d996b4438d partial(showdown.js): enabled output modifiers 2015-04-22 14:51:57 +01:00
Hannah Wolfe
36daa99339 Add missing block elements
fixes #90
2015-03-16 16:27:16 +00:00
Estevão Soares dos Santos
0fd10cb56a Added new extension registering method 2015-03-01 18:15:32 +00:00
rheber
4c529f83f0 support for stdin 2015-02-01 11:56:32 +11:00
Estevão Soares dos Santos
8ee87ead9f doc(showdown.js): add source documentation for showdown's api 2015-01-19 16:28:14 +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
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
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
rheber
b433d7cd50 very basic cli tool 2015-01-16 14:53:20 +11:00
Estevão Soares dos Santos
eae5f0e01f Major code refactoring 2015-01-15 21:21:33 +00:00
Alessandro Vermeulen
3dbc6ffcfb Added fix to prevent table rendering to be broken by alignment character ":". 2015-01-09 21:32:05 +01:00