diff --git a/lib/blink.js b/lib/blink.js index c391a9f..0d3e91e 100644 --- a/lib/blink.js +++ b/lib/blink.js @@ -1,7 +1,17 @@ -var marked = require('marked') +var MARK_MAP = { + '@@': 'blink', + '__': 'strong', + '\\*\\*': 'strong', + '\\*': 'em' +} module.exports = function (str) { - var md = marked(str) - // TODO - return null + let aaaa = `

${str}

` + for (let key in MARK_MAP) { + aaaa = aaaa.replace(new RegExp(`${key}(.+?)${key}`, 'g'), function (match, p1) { + return `<${MARK_MAP[key]}>${p1}` + }) + } + + return aaaa } \ No newline at end of file diff --git a/lib/capture.js b/lib/capture.js index a08ee57..d0d4336 100644 --- a/lib/capture.js +++ b/lib/capture.js @@ -1,3 +1,4 @@ module.exports = function (str) { - // TODO + let res = /x=(\d+)/.exec(str) + return res ? res[1] : null } \ No newline at end of file diff --git a/lib/capture_breakword.js b/lib/capture_breakword.js index a08ee57..2443c5e 100644 --- a/lib/capture_breakword.js +++ b/lib/capture_breakword.js @@ -1,3 +1,4 @@ module.exports = function (str) { - // TODO + let res = /\bx=(\d+)\b/.exec(str) + return res ? res[1] : null } \ No newline at end of file diff --git a/lib/quantified_group.js b/lib/quantified_group.js index a08ee57..a64c852 100644 --- a/lib/quantified_group.js +++ b/lib/quantified_group.js @@ -1,3 +1,3 @@ module.exports = function (str) { - // TODO + return (str.match(/0x[0-9a-f]{2}/ig) || []).length === 8 } \ No newline at end of file diff --git a/lib/quotes.js b/lib/quotes.js index a08ee57..e724604 100644 --- a/lib/quotes.js +++ b/lib/quotes.js @@ -1,3 +1,3 @@ module.exports = function (str) { - // TODO + return str.match(/"[^"]*"/g) } \ No newline at end of file