Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlight specific line in markdown

I'm pretty new in markdown, and I wonder if it's possible to highlight a specific line of a block of source code, like explained in this page

http://en.support.wordpress.com/code/posting-source-code/

Thanks in advance for your answers,

Edit : To be clearer, with the wordpress plugin, you can write something like this :

[code highlight="2,3"]
This line won't be highlighted.
This line will be highlighted.
This line will be highlighted.
This line won't be highlighted.
[/code]

But obviously, this isn't a markdown syntax.

like image 340
Kai23 Avatar asked Apr 07 '13 11:04

Kai23


People also ask

How do you highlight something in Markdown?

You can also create a Markdown hyperlink by highlighting the text and using the keyboard shortcut Command + V . If you'd like to replace the text with the link, use the keyboard shortcut Command + Shift + V .

Does Markdown support highlighting?

Many Markdown processors support syntax highlighting for fenced code blocks. This feature allows you to add color highlighting for whatever language your code was written in. To add syntax highlighting, specify a language next to the backticks before the fenced code block.


1 Answers

On SO, langauge highlighting is possible as explained in Advanced Help but not formatting within code blocks.

This is a code block
Markdown is **not** processed

You might mimic what you want by using quote:

This line won't be highlighted.
This line will be highlighted.
This line will be highlighted.
This line won't be highlighted.

You might also mimic what you want by using two spaces at end of each line:

This line won't be highlighted.
This line will be highlighted.
This line won't be highlighted.

But of course, these are not then rendered in monospaced font nor do you get syntax highlighting.

like image 178
daedalus Avatar answered Nov 03 '22 23:11

daedalus