TLDR: We use markdown. So does lots of the web.

While we have a long history of using [BBCODE] syntax for styling posts and indicating quoted text and code snippets, DaniWeb currently uses the Markdown markup language. Markdown is a very lightweight syntax, meaning that it appears meaningful in plaintext and doesn't look like it's been marked up. Many other sites use the Markdown language, and there are a plethora of tutorials around the web. Additionally, downloadable standalone WYSIWYG Markdown editors are available. While, for the most part, we keep in line with standard Markdown, there are a couple of important points which are unique to us.

Paragraphs and Line Breaks

A paragraph is one or more consecutive lines of text, separated by one or more blank lines. According to the rules of standard Markdown, a hard line break is not formatted as a new line. Instead, the end of a line must be followed by two spaces in order to generate a line break in the formatted output. I find this very unintuitive, and therefore this is not the case with DaniWeb. DaniWeb differs from standard Markdown in that a hard line break is treated as a <br>. It should be noted that a single line break is still considered part of the same paragraph, while a double line break (which results in a blank line) indicates a new paragraph.

These three lines
are all part of
the same paragraph.

This is a new paragraph.

Emphasis

Surrounding a word or phrase with either one asterisk (preferred) or one underscore will give it emphasis (aka italicize it). Surrounding a word or phrase with either two asterisks or two underscores will give it strong emphasis (aka embolden it). Standard Markdown also allows emphasis within a word. As such, my_super_word would turn into mysuperword. This makes no sense on a programming site, where such syntax is often used to reference a variable name, and no emphasis on super is intended. Therefore, DaniWeb-flavored Markdown only allows emphasis over entire words.

This is **bold** text and I am *italicizing* this word.

Code Blocks

To produce a code block, indent every line by at least 4 spaces, or one tab stop. The Markdown editor used on DaniWeb allows for you to effectively use the Tab key without the editor losing focus. You can also use Shift+Tab to go back a tab stop. Code blocks must begin and end with a blank line. When copying and pasting code from an IDE into the DaniWeb editor, it will not automatically be formatted as code. To format it correctly, after pasting it, select all the code and hit the Tab key on your keyboard to indent everything selected.

This is normal text

function foo() {
echo "Hello World!";
}

This is normal text

Inline Code

Inline code can be used to designate short spans of code within a normal paragraph. Inline code can be designated by surrounding it with backticks. It should be noted that whitespace is not preserved.

Let me talk about my code `echo "Hello World!"` in this sentence.

To create a link, wrap a URL in parentheses, and put a pair of square brackets immediately before it indicating the anchor text for the link. You can also optionally specify the link's title attribute in quotes, within the parentheses, which will appear as a tooltip when the link is hovered over. Standard Markdown requires encacing a naked URL in < and > to force it to be a hyperlink. Instead, DaniWeb-flavored Markdown automatically linkifies all naked URLs.

[Click here](https://www.daniweb.com/ "Tooltip to appear when the link is hovered over")

Quotes

Markdown uses email-style > characters to indicate blockquotes. You can prefix each individual line of a quote with a >, or you can be lazy and only place it once at the start of each paragraph. However, because of this, blockquotes must be followed up with a blank line in order to indicate the end of the paragraph (aka quote), before you can place normal text. Otherwise, it will all all appear as part of the quote.

> This is quoted text
This is also quoted text because it is still part of the same paragraph

I need to leave a blank line in order to return to normal text

Headings

There are two ways to indicate headings in Markdown. The preferred way is to put a hash mark at the beginning of the line to be styled. The number of hash marks indicates the heading level. There can be an optional closing hash.

# This is a heading #
## This is a sub-heading ##

The alternative way to indicate headings is to underline the heading with an equal sign or a dash. Any number of equal signs or dashes will work.

This is a heading
=================
This is a sub-heading
---------------------

Lists

Unordered lists interchangeably use asterisks (recommended), pluses and hyphens as list markers, followed by a space. Ordered lists use numbers followed by a period and then a space. Optionally, if you'd like to be lazy, as long as you start your list with 1. , Markdown will keep track of the line number for you, so you can prefix every line with 1. , for example.

* Item One
* Item Two
* Item Three
1. Item One
1. Item Two
1. Item Three

Images

The Markdown syntax for images is exactly the same as for links, only they have an exclamation point in front of them. DaniWeb does not allow any images hosted outside of the DaniWeb.com domain.

Horizontal Rule

In standard Markdown, a horizontal rule tag (<hr>) can be created by placing three or more asterisks, hyphens, or underscores on a line by themselves. I do not see how a horizontal rule can contribute anything to a forum post, and therefore horizontal rules are currently not generated by our Markdown parser.

HTML

Standard Markdown supports a limited subset of HTML tags which can be mixed with Markdown syntax. I don't feel like any markup other than what can be generated through Markdown is necessary within the context of a forum system. Additionally, as a development-oriented community, I want to allow the freedom to allow what is typed to always be rendered exactly as-is, without the concern that markup typed outside of a code block will be parsed. Therefore, DaniWeb-flavored Markdown currently does not allow any HTML. Both HTML tags and entities will not be parsed.

Post Editor Tester