-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
100 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.DS_Store | ||
*.log | ||
.nyc_output/ | ||
coverage/ | ||
node_modules/ | ||
.DS_Store | ||
*.log | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
coverage/ | ||
*.html | ||
*.json | ||
*.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,57 @@ | ||
exports.fromMarkdown = require('./from-markdown.js') | ||
exports.toMarkdown = require('./to-markdown.js') | ||
import gfmAutolinkLiteralFromMarkdown from 'mdast-util-gfm-autolink-literal/from-markdown.js' | ||
import gfmAutolinkLiteralToMarkdown from 'mdast-util-gfm-autolink-literal/to-markdown.js' | ||
import gfmStrikethroughFromMarkdown from 'mdast-util-gfm-strikethrough/from-markdown.js' | ||
import gfmStrikethroughToMarkdown from 'mdast-util-gfm-strikethrough/to-markdown.js' | ||
import gfmTableFromMarkdown from 'mdast-util-gfm-table/from-markdown.js' | ||
import gfmTableToMarkdown from 'mdast-util-gfm-table/to-markdown.js' | ||
import gfmTaskListItemFromMarkdown from 'mdast-util-gfm-task-list-item/from-markdown.js' | ||
import gfmTaskListItemToMarkdown from 'mdast-util-gfm-task-list-item/to-markdown.js' | ||
|
||
var own = {}.hasOwnProperty | ||
|
||
export const gfmFromMarkdown = configure([ | ||
gfmAutolinkLiteralFromMarkdown, | ||
gfmStrikethroughFromMarkdown, | ||
gfmTableFromMarkdown, | ||
gfmTaskListItemFromMarkdown | ||
]) | ||
|
||
export function gfmToMarkdown(options) { | ||
return { | ||
extensions: [ | ||
gfmAutolinkLiteralToMarkdown, | ||
gfmStrikethroughToMarkdown, | ||
gfmTableToMarkdown(options), | ||
gfmTaskListItemToMarkdown | ||
] | ||
} | ||
} | ||
|
||
function configure(extensions) { | ||
var config = {transforms: [], canContainEols: []} | ||
var length = extensions.length | ||
var index = -1 | ||
|
||
while (++index < length) { | ||
extension(config, extensions[index]) | ||
} | ||
|
||
return config | ||
} | ||
|
||
function extension(config, extension) { | ||
var key | ||
var left | ||
var right | ||
|
||
for (key in extension) { | ||
left = own.call(config, key) ? config[key] : (config[key] = {}) | ||
right = extension[key] | ||
|
||
if (key === 'canContainEols' || key === 'transforms') { | ||
config[key] = [].concat(left, right) | ||
} else { | ||
Object.assign(left, right) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.