I was working on a Wordpress blog redesign recently and came across an issue which reconfirmed my belief that all CMS editors should use markdown.
The content in each post on the blog I was working contained inconsistencies such as:
- Images inserted differently; some left-aligned, others to the right, some had captions, some did not
- Headings wrapped in
<b>
tags - Quotes were italicised instead of being applied as block quotes
- Random paragraph spacing caused by
<br>
tags - Some posts contained that ugly and unnecessary HTML produced by copy and pasting from a word processor
Why use markdown?
The advantage of markdown is it strips away the HTML layer and focusses solely on the content. By using simple prefixes, we can easily define the type of content we want displaying.
A simple markdown example
# This is a h1 heading
The advantage of [markdown](https://google.com) is it **strips away the HTML layer** and focusses solely on the **content**. By using simple prefixes, we can easily define the type of content we want displaying.
And, the equivalent in html
<h1>This is a heading</h1>
<p>The advantage of <a href="https://google.com">markdown</a> is it <strong>strips away the HTML layer</strong> and focusses solely on the <strong>content</strong>. By using simple prefixes, we can easily define the type of content we want displaying.</p>
Portability
Aside from its simplicity, another major benefit of markdown is its portability.
Content can be moved easily without the inclusion of any style definitions. Markdown also prevents those nested HTML tags that I see so often in CMS editors, for example,<h1><b>heading</b></h1>
or <p><span><font>This</font></span><font><span> is some text</span></font>
.
If you haven’t tried markdown yet, now’s the time to and once you do, I promise, there’s no going back.
An excellent markdown cheat sheet is available at the link below and there are plenty of WordPress plugins available.
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet.