mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-23 00:40:10 +00:00
29 lines
531 B
JavaScript
29 lines
531 B
JavaScript
|
|
||
|
/**
|
||
|
Inline Markdown-to-Chalk conversion routines.
|
||
|
@license MIT. See LICENSE.md for details.
|
||
|
@module utils/md2chalk
|
||
|
*/
|
||
|
|
||
|
(function() {
|
||
|
var CHALK, LO, MD;
|
||
|
|
||
|
MD = require('marked');
|
||
|
|
||
|
CHALK = require('chalk');
|
||
|
|
||
|
LO = require('lodash');
|
||
|
|
||
|
module.exports = function(v, style, boldStyle) {
|
||
|
var temp;
|
||
|
boldStyle = boldStyle || 'bold';
|
||
|
temp = v.replace(/\*\*(.*?)\*\*/g, LO.get(CHALK, boldStyle)('$1'));
|
||
|
if (style) {
|
||
|
return LO.get(CHALK, style)(temp);
|
||
|
} else {
|
||
|
return temp;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
}).call(this);
|