1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-04-19 14:20:25 +01:00
HackMyResume/src/utils/md2chalk.js
2016-01-22 04:55:29 -05:00

20 lines
459 B
JavaScript

/**
Inline Markdown-to-Chalk conversion routines.
@license MIT. See LICENSE.md for details.
@module md2chalk.js
*/
(function(){
var MD = require('marked');
var CHALK = require('chalk');
var LO = require('lodash');
module.exports = function( v, style, boldStyle ) {
boldStyle = boldStyle || 'bold';
var temp = v.replace(/\*\*(.*?)\*\*/g, LO.get( CHALK, boldStyle )('$1'));
return style ? LO.get( CHALK, style )(temp) : temp;
};
}());