-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
111 changed files
with
5,305 additions
and
4,553 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coverage/ | ||
remark.js | ||
remark.min.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
var unherit = require('unherit'); | ||
var xtend = require('xtend'); | ||
var Parser = require('./lib/parser.js'); | ||
var unherit = require('unherit') | ||
var xtend = require('xtend') | ||
var Parser = require('./lib/parser.js') | ||
|
||
module.exports = parse; | ||
parse.Parser = Parser; | ||
module.exports = parse | ||
parse.Parser = Parser | ||
|
||
function parse(options) { | ||
var Local = unherit(Parser); | ||
Local.prototype.options = xtend(Local.prototype.options, this.data('settings'), options); | ||
this.Parser = Local; | ||
var settings = this.data('settings') | ||
var Local = unherit(Parser) | ||
|
||
Local.prototype.options = xtend(Local.prototype.options, settings, options) | ||
|
||
this.Parser = Local | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
var index = value.indexOf('\n', fromIndex); | ||
var index = value.indexOf('\n', fromIndex) | ||
|
||
while (index > fromIndex) { | ||
if (value.charAt(index - 1) !== ' ') { | ||
break; | ||
break | ||
} | ||
|
||
index--; | ||
index-- | ||
} | ||
|
||
return index; | ||
return index | ||
} |
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,7 +1,7 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
return value.indexOf('`', fromIndex); | ||
return value.indexOf('`', fromIndex) | ||
} |
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,7 +1,7 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
return value.indexOf('~~', fromIndex); | ||
return value.indexOf('~~', fromIndex) | ||
} |
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,18 +1,18 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
var asterisk = value.indexOf('*', fromIndex); | ||
var underscore = value.indexOf('_', fromIndex); | ||
var asterisk = value.indexOf('*', fromIndex) | ||
var underscore = value.indexOf('_', fromIndex) | ||
|
||
if (underscore === -1) { | ||
return asterisk; | ||
return asterisk | ||
} | ||
|
||
if (asterisk === -1) { | ||
return underscore; | ||
return underscore | ||
} | ||
|
||
return underscore < asterisk ? underscore : asterisk; | ||
return underscore < asterisk ? underscore : asterisk | ||
} |
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,7 +1,7 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
return value.indexOf('\\', fromIndex); | ||
return value.indexOf('\\', fromIndex) | ||
} |
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,16 +1,16 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
var link = value.indexOf('[', fromIndex); | ||
var image = value.indexOf('![', fromIndex); | ||
var link = value.indexOf('[', fromIndex) | ||
var image = value.indexOf('![', fromIndex) | ||
|
||
if (image === -1) { | ||
return link; | ||
return link | ||
} | ||
|
||
/* Link can never be `-1` if an image is found, so we don’t need | ||
* to check for that :) */ | ||
return link < image ? link : image; | ||
// Link can never be `-1` if an image is found, so we don’t need to check | ||
// for that :) | ||
return link < image ? link : image | ||
} |
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,18 +1,18 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
var asterisk = value.indexOf('**', fromIndex); | ||
var underscore = value.indexOf('__', fromIndex); | ||
var asterisk = value.indexOf('**', fromIndex) | ||
var underscore = value.indexOf('__', fromIndex) | ||
|
||
if (underscore === -1) { | ||
return asterisk; | ||
return asterisk | ||
} | ||
|
||
if (asterisk === -1) { | ||
return underscore; | ||
return underscore | ||
} | ||
|
||
return underscore < asterisk ? underscore : asterisk; | ||
return underscore < asterisk ? underscore : asterisk | ||
} |
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,7 +1,7 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
function locate(value, fromIndex) { | ||
return value.indexOf('<', fromIndex); | ||
return value.indexOf('<', fromIndex) | ||
} |
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,26 +1,26 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locate; | ||
module.exports = locate | ||
|
||
var PROTOCOLS = ['https://', 'http://', 'mailto:']; | ||
var protocols = ['https://', 'http://', 'mailto:'] | ||
|
||
function locate(value, fromIndex) { | ||
var length = PROTOCOLS.length; | ||
var index = -1; | ||
var min = -1; | ||
var position; | ||
var length = protocols.length | ||
var index = -1 | ||
var min = -1 | ||
var position | ||
|
||
if (!this.options.gfm) { | ||
return -1; | ||
return -1 | ||
} | ||
|
||
while (++index < length) { | ||
position = value.indexOf(PROTOCOLS[index], fromIndex); | ||
position = value.indexOf(protocols[index], fromIndex) | ||
|
||
if (position !== -1 && (position < min || min === -1)) { | ||
min = position; | ||
min = position | ||
} | ||
} | ||
|
||
return min; | ||
return min | ||
} |
Oops, something went wrong.