June 2016
Intermediate to advanced
910 pages
18h 59m
English
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 ...Read now
Unlock full access