'bold and italic text for javascript, using unicode symbols
To make text strikethrough using unicode, I have been using this:
function strikeThrough(text) {
return text
.split('')
.map(char => char + '\u0336')
.join('')
}
Reference:
How to do strike through string for javascript
My question is: is there a similar way to do this for Bold and Italic as well, by adding a unicode character in the same manner? I'm trying to avoid an html-based solution. For example:
function boldText(text) {
return text
.split('')
.map(char => char + '????')
.join('')
}
function italicText(text) {
return text
.split('')
.map(char => char + '????')
.join('')
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
