Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to indent a few lines in Markdown markup?

I want to write a few lines of text. They should be formatted normally except each line should start at the 6th column. I.e. I don't want the code block formatting rule to make this chunk of text look like code as I'll use other formatting like bold face, etc. How to do that in Markdown?

like image 804
Meng Lu Avatar asked May 18 '11 14:05

Meng Lu


People also ask

How do you indent a paragraph in Markdown?

To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example, given this input: This is a normal paragraph: This is a code block.

How do you insert a line break in Markdown?

To create a line break or new line ( <br> ), end a line with two or more spaces, and then type return. This is the first line.

What is the indent command?

The indent command fits as many words (separated by blanks, tabs, or new-lines) on a line as possible. Blank lines break paragraphs. A block comment is a comment that is not to the right of the code, and extends for more than one line.


1 Answers

There's no way to do that in markdown's native features. However markdown allows inline HTML, so writing

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This will appear with six space characters in front of it 

will produce:

      This will appear with six space characters in front of it

If you have control over CSS on the page, you could also use a tag and style it, either inline or with CSS rules.

Either way, markdown is not meant as a tool for layout, it is meant to simplify the process of writing for the web, so if you find yourself stretching its feature set to do what you need, you might look at whether or not you're using the right tool here. Check out Gruber's docs:

http://daringfireball.net/projects/markdown/syntax#html

like image 56
alegscogs Avatar answered Oct 16 '22 08:10

alegscogs