For the online learning world


Moodle Markdown editing – hidden treasure Part 12

Part 12 of our using Markdown in Moodle, using HTML and special characters.

Previous posts in this series

If you are already proficient in HTML then there may be occasions when Markdown does not allow you as much control as you are used to. Luckily Markdown is designed for this eventuality and allows you to embed HTML directly within Markdown formatted text.

Note that the HTML markup co-exists with the Markdown code for bullet lists. This frees you from the task of writing complex HTML for basic formatting features such as paragraphs and lists, while still allowing you to access the power of HTML in specific situations.

Displaying HTML or performatted text

If you wish the HTML you enter to be displayed exactly as you typed it, rather than processed as HTML then you can start each line with four space characters.

<p>A paragraph in <b>HTML</b> displayed as code</p>

This also works for displaying computer code:

print "Command-line arguments: (@ARGV)\n";

As this formatting is often used for computer program listings and other text which may plausibly contain the characters that Markdown uses to indicate different types of formatting, Markdown’s formatting is switched off for these lines:

Normally this word would be **bold**.

To include such characters within normal text, see the section below.

Special characters

If you wish to use any of the special characters that trigger Markdown formatting without them being processed simply precede them with a backslash character (\). This is known as ‘escaping’ a character. The backslash is not displayed but the character immediately following it is shown, exactly as entered.

\*asterisks, not emphasis\*


*asterisks, not emphasis*

rather than

*emphasis, not asterisks*

which gives

emphasis, not asterisks

More on Markdown in Moodle next month !

Stuart Mealor
Latest posts by Stuart Mealor (see all)

Stuart Mealor

Stuart is interested in all things e-learning, with specific interests in Moodle, e-learning strategy, and business development. His experience in education over 30 years, MBA in International Business, and knowledge of e-learning systems implementation, together with graphic design background, give him a unique skill set for e-learning projects.

Add a reply or comment...