开发者

Markdown chokes on <figure> elements. Anyone know of a fix?

I've just recently begun to use markdown and have noticed that any markdown within the html 'figure' element simply prints out. So images merely print out the path rather than actually load.

Has anyone else encountered this?

Trying:

<figure>
  ![The Noun Project](https://s3.amazonaws.com/benjamincharity.com/16022011-the-noun-project.jpg)
  <figcaption>The Noun Project</figcaption>
</figure>

But it merely prints out the code. Like markdown won't render within Markdown.

Edit: (more info)

My apologies concerning the lack of info. Very new to Ruby and Markdown. I am using 'Rdiscount'. I noticed today in the docs here that printing out the html might be a setting? Also it looks like markdown is printing inside of any HTML element; not only figure as I first thought.

My error:

This:

## So we went to work:

<div class开发者_如何学运维="image">
  <figure>
    ![The u-oh.me home page](https://s3.amazonaws.com/benjamincharity.com/u-oh.me-1.jpg)
    <figcaption>The u-oh.me home page</figcaption>
  </figure>
</div>

Simply prints like this:

So we went to work:

![The u-oh.me home page](https://s3.amazonaws.com/benjamincharity.com/u-oh.me-1.jpg) The u-oh.me home page


The Markdown specification dictates that anything between block-level tags gets rendered verbatim rather than parsed as Markdown

Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style emphasis inside an HTML block.

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


Andrew is correct that Markdown is not processed inside block-level HTML elements. However you might consider using Markdown Extra which does support this. This is an example from PHP Markdown Extra of using Markdown syntax inside a block-level HTML element:

<div markdown="1"> This is *true* markdown text. </div>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜