How to bold first (or n-th) paragraph of text

In the last two projects I’ve been asked a simple task to bold first paragraph of text. This task proved to be very complex or quite trivial depending on my customer’s requirements. Hope someone will find code snippets below helpful.

Lets assume your HTML code looks like that:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet purus in dictum scelerisque.

Vivamus ut consectetur tortor. Phasellus egestas magna nisi, non tempus purus malesuada sed.

You want to bold first paragraph like this (visual representation depends on CSS):

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet purus in dictum scelerisque.

Vivamus ut consectetur tortor. Phasellus egestas magna nisi, non tempus purus malesuada sed.

This can be achieved in at least two ways.
Read more