We have two types of emphasis to accentuate segments of our content: Light emphasis or strong emphasis. And we can nest both types.
This page obviously needs to be full of emphasis, but in general we should apply emphasis sparingly. Overemphasizing text is irritating and defeats the purpose. If there is emphasis everywhere, it doesn’t stand out anymore.
Surrounding a word with an asterisk
* or underscore
_ produces light emphasis:
*asterisk*is displayed asterisk.
_underscore_leads to underscore.
Light emphasis is styled with an italic version of the text font. Italics in the body copy don’t attract attention at first glance, but get noticed while reading the lines.
Surrounding a word with two asterisks or underscores produces strong emphasis:
**asterisks**is displayed asterisks.
__underscores__lead to underscores.
Strong emphasis is styled with a bold version of the normal text font. This way the emphasis stands out. A good choice for distinctively structured text like a documentation, because we recognize the heavier weight immediately while scanning a page.
If you prefer the asterisk
* for emphasizing, the underscores come in handy when typing a nested emphasis. Both parts are much easier to distinguish then. To mix both types of emphasis you could type:
_one and **two**_for one and two.
**one and _two_**for one and two.
_one and *two*_for one and two.
The nesting possibilities of the CommonMark specification are endless, but only a few combinations are meaningful in practice.
Which formatting characters are the best choice?
At first sight CommonMark treats the asterisk
* and the underscore
_ as equally appropriate options to mark either light or strong emphasis. But the Markdown concept suggests — at least to me — to use underscores for light emphasis, because they have a smaller footprint in the Markdown. The asterisks are thicker and suit the strong emphasis.
I haven’t checked the specification details for this argument, but the asterisks are the only possible option in CommonMark to strongly emphasize characters inside of words. We sometimes want to emphasize the first letter of some words to mark their abbreviation for example:
**H**yper-**T**ext **M**arkup **L**anguagefor Hyper-Text Markup Language is working fine.
__H__yper-__T__ext __M__arkup __L__anguagethe underscores are ignored by CommonMark (Goldmark) and even left inside the text: __H__yper-__T__ext __M__arkup __L__anguage.
Emphasis with sans-serif fonts
Sans-serif fonts usually don’t have a distinctive italic style, even if their font includes an italic specimen. They look like a slightly tilted version of the regular font — which is not as pretty as a distinct serif style. You should prefer bold emphasis.