1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-09-28 20:19:12 +01:00
HackMyResume/src/utils/md2chalk.coffee
hacksalot 0f65e4c9f3 Finish HackMyCore reshaping.
Reintroduce HackMyCore, dropping the interim submodule, and reorganize
and improve tests.
2016-01-29 15:23:57 -05:00

16 lines
395 B
CoffeeScript

###*
Inline Markdown-to-Chalk conversion routines.
@license MIT. See LICENSE.md for details.
@module utils/md2chalk
###
MD = require 'marked'
CHALK = require 'chalk'
LO = require 'lodash'
module.exports = ( v, style, boldStyle ) ->
boldStyle = boldStyle || 'bold'
temp = v.replace(/\*\*(.*?)\*\*/g, LO.get( CHALK, boldStyle )('$1'))
if style then LO.get( CHALK, style )(temp) else temp