Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

text highlight in markdown

Within a Markdown editor I want to support text highlight, not in the sense of code highlighting, but the type of highlighting people do on books.

In code oriented sites people can use backquotes for a grey background, normally inline code within a paragraph. However on books there is the marker pen for normal text within a paragraph. That is the classical black text on yellow background.

Is there any syntax within Markdown (or its variants) to specify that the user want that type of highlight? I want to preserve the backquotes syntax for code related marking, but also want a way to enable highlighted user text

My first thought is just using double backquotes, since triple backquotes are reserved for code blocks. I am just wondering if other implementations have already decided a syntax for it... I would also appreciate if someone could justify if this is a very bad idea.

like image 428
SystematicFrank Avatar asked Aug 03 '14 12:08

SystematicFrank


People also ask

Can I highlight text in Markdown?

Text highlight is used to highlight the text in the document. It is similar to the highlight command in the Microsoft word and other text formatting documents. We can use the highlight command for single word, multiple words, sentence, paragraphs etc.

How do you mark highlight in Markdown?

You can also insert code in Markdown by placing triple backticks ( ``` ) before and after a code block.

How do I add color to text in Markdown?

Markdown doesn't support color but you can inline HTML inside Markdown, e.g.: <span style="color:blue">some *blue* text</span>. As the original/official syntax rules state (emphasis added): Markdown's syntax is intended for one purpose: to be used as a format for writing for the web.


2 Answers

As the markdown documentation states, it is fine to use HTML if you need a feature that is not part of Markdown.

HTML5 supports

<mark>Marked text</mark>

Else you can use span as suggested by Rad Lexus

<span style="background-color: #FFFF00">Marked text</span>
like image 144
Matthias Avatar answered Oct 05 '22 19:10

Matthias


I'm late to the party but it seems like a couple of markdown platforms (Quilt & iA Writer) are using a double equal to show highlighting.

==highlight== 
like image 22
Andrew Shell Avatar answered Oct 05 '22 19:10

Andrew Shell