Skip to content

Special Characters and Escaping

prasanna edited this page Jan 21, 2025 · 1 revision

Markdown Special Characters and Escaping

Markdown files are plain text, but certain characters have special meaning within the Markdown syntax. To avoid workflow failures or page deployment errors, it's crucial to handle these characters appropriately. Due to the presence of special characters in the committed Markdown (.md) files, the workflow is failing, leading to deployment errors during the page deployment process. To resolve this, it is essential to handle these special characters properly within the Markdown documents.

This document provides an overview of special characters in Markdown files, explaining how to escape them using a backslash and how to handle them to ensure smooth workflow execution and successful deployment. In Markdown, certain characters have special meanings and need to be escaped with a backslash (\) to be treated as regular text. This document outlines the characters that require escaping and provides examples.

Characters That Need to Be Escaped

In Markdown, certain characters are reserved for specific formatting purposes and have special meanings. These characters are used to create headers, lists, links, emphasis, and other elements of the Markdown syntax. If you want to display these characters as part of the content (rather than triggering their formatting function), you must escape them by preceding them with a backslash (\). This tells the Markdown parser to treat these characters as regular text, rather than interpreting them as formatting instructions.

  • \\ (backslash itself)
  • ` (backtick)
  • * (asterisk)
  • _ (underscore)
  • { } (curly braces)
  • [ ] (square brackets)
  • ( ) (parentheses)
  • # (hash mark)
  • + (plus sign)
  • - (minus sign or hyphen)
  • . (dot)
  • ! (exclamation mark)

Examples

  1. Backslash (\\)
    To display a backslash:
    Input: \\
    Output: \\

  2. Underscore (_)
    To prevent Markdown from formatting text as italic (using underscores):
    Input: \_italic\_
    Output: _italic_

  3. Hash Mark (#)
    To prevent a hash mark from being interpreted as a heading:
    Input: \# This is not a heading
    Output: # This is not a heading

  4. Multiple Spaces
    By default, multiple spaces are collapsed into a single space in Markdown. To display multiple spaces, escape each space:
    Input: keep the social \ \ \ distance
    Output: keep the social distance (three spaces between "social" and "distance")

Reference

For further information on escaping characters in Markdown, you can refer to the guide at: Markdown Guide: Escaping Characters

Clone this wiki locally