This article is a comprehensive guide to Showdown's Markdown syntax, a JavaScript implementation of GitHub Flavored Markdown (GFM), designed to help you create web content compatible with github. Showdown aims to follow the original Markdown spec while supporting additional features found in GFM.
Showdown provides a powerful tool for converting Markdown to HTML, making it easy to create clean, readable content for your web projects.
Headings are an essential part of organizing your content. Showdown supports two popular heading styles: Atx Style and Setext Style.
Showdown offers several ways to format code blocks, ensuring that your code snippets are displayed correctly and legibly.
Showdown supports both unordered (bulleted) and ordered (numbered) lists, making it easy to create structured content.
Showdown provides multiple ways to create links within your Markdown text, allowing you to seamlessly link your content to other websites or resources.
simplifiedAutoLink
option is enabled. This simplifies the process of creating links. [ ]
) and the URL in parentheses (( )
). This is the most common way to create links in github.Showdown supports inline and reference styles for embedding images into your markdown. This allows you to create visually appealing content by incorporating images seamlessly.
While tables are not part of the core Markdown spec, they are widely supported in GFM, and Showdown includes them when the tables
option is enabled.
Tables can be used to create visually appealing presentations of data, enhancing the organization and readability of your markdown content.
Showdown generally leaves HTML tags untouched in the output, allowing you to embed custom HTML elements for advanced styling or functionality. However, tags like <code>
and <pre><code>
are always escaped to ensure proper code formatting.
For situations where you want to enable Markdown parsing within specific HTML tags, you can use the markdown
attribute or data-markdown
attribute on the HTML tag. This allows you to combine Markdown syntax and HTML for more complex content.
Showdown provides the ability to turn github mentions into clickable links to users' profiles on github. This feature can be enabled using the ghMentions
option.
This feature is useful for creating dynamic content where you want to link to specific github users within your Markdown text.
You can even customize the generated link using the ghMentionsLink
option. This allows you to control how mentions are linked based on your specific project requirements.
Showdown allows you to use backslashes (\
) to escape characters that have special meaning in Markdown syntax. This ensures that these characters are displayed literally rather than being interpreted by the Markdown parser.
This feature is essential for maintaining control over how certain characters are rendered in your Markdown content, especially when you need to display characters that might otherwise be treated as Markdown elements.
Showdown generally aims to be consistent with the original Markdown spec, but there are a few known differences. It's helpful to be aware of these differences to avoid any potential unexpected results.
markdown="1"
attribute was ignored. This means that Markdown within a <div>
tag with the markdown
attribute would not be parsed.Ask anything...