はてなブログでMarkdown Extra をやってみるテスト

PHP Markdown Extraに沿って、はてなブログでの表示をテストしてみます。

Inner HTML

・こう書くと、

    <div>行頭にスペースを3つ入れています。</div>

・こうなる。

行頭にスペースを3つ入れています。

・こう書くと、

    <div>行頭にスペースを4つ入れています。</div>

・こうなる。

<div>行頭にスペースを4つ入れています。</div>

コードブロックになります。

結果:○

Markdown Inside HTML Blocks

・こう書くと、

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

・こうなる。

This is *true* markdown text.

・こう書くと、

<table>
<tr>
<td markdown="1">This is *true* markdown text.</td>
</tr>
</table>

・こうなる。

This is *true* markdown text.

結果:☓。markdown=“1"を入れてもHTML内でMarkdownは有効になりません。

Special Attributes

・こう書くと、

Header 1            {#header1}
========

## Header 2 ##      {#header2}

[Link back to header 1](#header1)

・こうなる。

Header 1 {#header1}

Header 2 ## {#header2}

Link back to header 1

結果:☓

ちなみに、次のように書けば可能です。

[Header 1][]
========
[Header 1]: id:header1

Fenced Code Blocks

・こう書くと、

This is a paragraph introducing:

~~~~~~~~~~~~~~~~~~~~~
a one-line code block
~~~~~~~~~~~~~~~~~~~~~

``````````````````
another code block
``````````````````

・こうなる。

This is a paragraph introducing:

~~~~~~~~~~~~~~~~~~~~~ a one-line code block ~~~~~~~~~~~~~~~~~~~~~

another code block

・こう書くと、

1.  List item

    Not an indented code block, but a second paragraph
    in the list item

    ```
    This is a code block, fenced-style
    ```
1.  List item

・こうなる。

  1. List item

    Not an indented code block, but a second paragraph in the list item

    This is a code block, fenced-style

  2. List item

結果:○(ただし、~は使えない)

Tables

・こう書くと、

| First Header  | Second Header |
| ------------- | ------------- |
| Content Cell  | Content Cell  |
| Content Cell  | Content Cell  |

・こうなる。

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

・こう書くと、

| Item      | Value |
| --------- | -----:|
| Computer  | $1600 |
| Phone     |   $12 |
| Pipe      |    $1 |

・こうなる。

Item Value
Computer $1600
Phone $12
Pipe $1

・こう書くと、

| Function name | Description                    |
| ------------- | ------------------------------ |
| `help()`      | Display the help window.       |
| `destroy()`   | **Destroy your computer!**     |

・こうなる。

Function name Description
help() Display the help window.
destroy() Destroy your computer!

結果:○

Definition Lists

・こう書くと、

Apple
:   Pomaceous fruit of plants of the genus Malus in 
the family Rosaceae.

Orange
:   The fruit of an evergreen tree of the genus Citrus.

・こうなる。

Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae.

Orange : The fruit of an evergreen tree of the genus Citrus.

定義リストになっていません。

結果:☓

ちなみに、次のように書けば可能です。

=Apple=
    Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.

Footnotes

・こう書くと、

That's some text with a footnote.[^1]

[^1]: And that's the footnote.

    That's the second paragraph.

・こうなる。

That’s some text with a footnote.1

That’s the second paragraph.

“That’s the second paragraph."が脚注に表示されません。

結果:△。とりあえず使えますが、脚注内はMarkdown記法が効かないようです。

ちなみに、はてな記法の脚注は

・こう書くと、

はてな記法による脚注付きの本文です。((はてな記法の脚注です。))

・こうなる。

はてな記法による脚注付きの本文です。*1

Abbreviations

・こう書くと、

*[HTML]: Hyper Text Markup Language
*[W3C]:  World Wide Web Consortium

The HTML specification
is maintained by the W3C.

・こうなる。
[HTML]: Hyper Text Markup Language [W3C]: World Wide Web Consortium

The HTML specification is maintained by the W3C.

結果:☓

ちなみに、次のように書けば可能です。

The [HTML][] specification
is maintained by the [W3C][].

[HTML]: abbr:Hyper&nbsp;Text&nbsp;Markup&nbsp;Language
[W3C]:  abbr:World&nbsp;Wide&nbsp;Web&nbsp;Consortium

Ordered Lists

・こう書くと、

2. This is an ordered list starts with a number different than 1.

・こうなる。

  1. This is an ordered list starts with a number different than 1.

1が振り直されています。

結果:(Extraとしては)☓

Emphasis

・こう書くと、

Please open the folder "secret_magic_box".

・こうなる。

Please open the folder “secret_magic_box”.

・こう書くと、

I like it when you say _you love me_.

・こうなる。

I like it when you say you love me.

結果:○

Backslash Escapes

・こう書くと、

\: \|

・こうなる。

: |

結果:○

Discountのテストに続きます。>>


  1. And that’s the footnote.

*1:はてな記法の脚注です。