const render_markdown2 = (input, features) => {
console.debug(input)
if (features.bold) {
input = input.replace(/\*\*\S.*?\S\*\*/g, match => {
return match.replace(/^\*\*/,'<b>').replace(/\*\*$/,'</b>')
})
}
if (features.italic) {
input = input.replace(/\*\S.*?\S\*/g, match => {
return match.replace(/^\*/,'<i>').replace(/\*$/,'</i>')
})
}
if (features.h1) {
input = input.replace(/^\#.+$/gm, match => {
return match.replace(/^#/, '<h1>') + '</h1>'
})
}
return input
}