简体   繁体   中英

Tell Markdown to ignore everything in <code> block?

Markdown already ignores everything within a <div> element, and various other block-level elements. However, I need to tell Markdown to ignore everything within <code> blocks as well. Is there a way to tell Markdown to do this?

As an FYI, I am using BlueCloth .

The Markdown spec does not specify how <code> blocks should be processed. What exact type of markup are you trying to get the Markdown processors to ignore?

Here is the Markdown Syntax page.

I'm not exactly sure what you want to achieve.

You have something like the following right?

#Heading

<code>
    $my = 'php code here';
</code>

Other text

Do you want your output to be like the one below?

<h1>Heading</h1>

<code>
    $my = 'php code here';
</code>

<p>Other text</p>

For code in markdown you have to indent the code by four spaces so what you should do is the following in your markdown source file.

#Heading

    $my = 'php code here';

Other text

The code is indented four spaces and markdown will surround it with and tags automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM