Let them use Markdown!

The description for activities supports Markdown. Note—as is pointed out in Facebook's own documentation on the deliberately named dangerouslySetInnerHTML—that we are implicitly trusting Showdown (which provided our converter) to be secure. There also exist tools intended to tag clean and sanitize HTML in a fashion appropriate for XSS-secure display of HTML here.

We strip off open and close P tags, so that the descriptions will appear on the same line as any time or other information given by the day's ordered list:

 if (activity.all_day) { rendered_activities.push(<li dangerouslySetInnerHTML={{__html: converter.makeHtml(activity.description) .replace('<p>', '').replace('</p>', '')}} />); } else if (activity.minutes) { rendered_activities.push(<li ...

Get React: Building Modern Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.