-
Notifications
You must be signed in to change notification settings - Fork 2
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
13 changed files
with
267 additions
and
249 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,3 +1,5 @@ | ||
'use strict'; | ||
|
||
var express = require('express'); | ||
var app = express(); | ||
var http = require('http').Server(app); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
'use strict'; | ||
|
||
var regex = { | ||
link: new RegExp(/\$\[([\s\S]*?)\]\(([\s\S]*?)\)/) | ||
link: new RegExp(/\$\[([\s\S]*?)\]\(([\s\S]*?)\)/) | ||
}; | ||
|
||
function render(href, text) { | ||
var imsizeReg = /([\s\S]+) =([0-9]*)x([0-9]*)/; | ||
var match = imsizeReg.exec(href); | ||
if(match) href = match[1]; | ||
var out = '<video src="' + href + '"'; | ||
var imsizeReg = /([\s\S]+) =([0-9]*)x([0-9]*)/; | ||
var match = imsizeReg.exec(href); | ||
if(match) href = match[1]; | ||
var out = '<video src="' + href + '"'; | ||
|
||
if(match) { | ||
if(match[2] != '') { | ||
out += ' width="' + match[2] + '"'; | ||
} | ||
if(match[3] != '') { | ||
out += ' height="' + match[3] + '"'; | ||
} | ||
if(match) { | ||
if(match[2] != '') { | ||
out += ' width="' + match[2] + '"'; | ||
} | ||
out += ' controls>'; | ||
if (text) { | ||
out += text; | ||
if(match[3] != '') { | ||
out += ' height="' + match[3] + '"'; | ||
} | ||
out += '</video>'; | ||
return out; | ||
} | ||
out += ' controls>'; | ||
if (text) { | ||
out += text; | ||
} | ||
out += '</video>'; | ||
return out; | ||
} | ||
|
||
exports.marked = function(code) { | ||
var match = null; | ||
while(match = regex.link.exec(code)) { | ||
code = code.replace(regex.link, render(match[2], match[1])); | ||
} | ||
return code; | ||
var match = null; | ||
while(match = regex.link.exec(code)) { | ||
code = code.replace(regex.link, render(match[2], match[1])); | ||
} | ||
return code; | ||
} |
Oops, something went wrong.