Created
April 10, 2019 00:57
-
-
Save alexalannunes/e240026be8da971fde83f814619a3fe3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function boldText(text){ | |
var bold = /\*\*(\S(.*?\S)?)\*\*/gm; | |
var html = text.replace(bold, '<b>$1</b>'); | |
return html; | |
} | |
var result = boldText('te**st**ing'); | |
alert(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment