Created
December 15, 2017 04:53
-
-
Save diewland/bc85e3a3b1ae64afefa2f55e38d5feb1 to your computer and use it in GitHub Desktop.
Automatic add tag to specific words
This file contains hidden or 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
| 'hello my name is diewland'.replace(/(diewland|name)/g, "<span class='hl'>$&</span>") | |
| // "hello my <span class='hl'>name</span> is <span class='hl'>diewland</span>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment