geeks-dev/php-markdown-extra-extended-stylish

PHP Markdown Extra Extended Stylish

dev-master 2014-02-19 10:52 UTC

This package is not auto-updated.

Last update: 2024-04-27 13:20:37 UTC


README

See Amazing Demo

Support

An fork of the Markdown Extra Extended .

Remove

  • Line break generates a <br />

It is because the bug has been encapsulated .

Icons

Input :(heart):

Output <span class="glyphicon glyphicon-heart"></span>

Input [(heart)]

Output <i class="fa fa-heart"></i>

Input [(heart,spin,2x)]

Output <i class="fa fa-heart fa-spin fa-2x"></i>

Custom Icons

Input :(custom|heart,spin,4x):

Output <span class="custom custom-heart fa-spin fa-4x"></span>

Input [(custom|heart,spin,4x)]

Output <i class="custom custom-heart fa-spin fa-4x"></i>

Usage

You need both the markdown.php and the markdown_extended_stylish.php files, but only needs to include markdown_extended_stylish.php.

require_once('markdown_extended_stylish.php');

// Convert markdown formatted text in $markdown to HTML
$html = MarkdownExtended($markdown);

License

PHP Markdown Extra Extended is licensed under the MIT License. See the LICENSE file for details.

Other Message

Basic part has not changed . I have done is an extension that matches the modern .

Oh, Sorry .
English is not good at I .

Down from here is Old Text

Changes to syntax from PHP Markdown (Extra)

Unless explicitly specified, existing Markdown markup works exactly as it did before. The orginal syntax is documentated here:

Support for cite attribute on blockquotes

It is now possible to add the optional cite attribute to the blockquote element.

The new, optional, syntax is:

> (cite url) Cited content follows ...

Example:

> (http://www.whatwg.org/) Content inside a blockquote must be quoted 
> from another source, whose address, if it has one, 
> may be cited in the `cite` attribute.

Will result in the following HTML:

<blockquote cite="http://www.whatwg.org/">
<p>Content inside a blockquote must be quoted 
from another source, whose address, if it has one, 
may be cited in the `cite` attribute.</p>
</blockquote>

Breaking changes from PME

The existing rules for and formatting options for blockquotes still apply. There is one small breaking changes with this addition. If your quote starts with "(" you have two have at least two spaces between the initial ">" and the "(". E.g.:

>  (Ut brisket flank salami.) Cow cupidatat ex t-bone sirloin id. 
> Sunt flank pastrami spare ribs sint id, nulla nisi.

Will result in the following HTML:

<blockquote>
  <p>(Ut brisket flank salami.) Cow cupidatat ex t-bone sirloin id.<br>
  Sunt flank pastrami spare ribs sint id, nulla nisi.</p>
</blockquote>

Fenced code block with language support and alternating fence markers (```)

It is now possible to specify the language type of a code block, and use an alternatinge fence markers (```), enabling the same syntax as that of GFM.

This addition follows the suggested way to specify language by W3C.

Example:

~~~html
<p>Ut brisket flank salami.  Cow cupidatat ex t-bone sirloin id.</p>
~~~

Using alternative fence markers:

```html
<p>Ut brisket flank salami.  Cow cupidatat ex t-bone sirloin id.</p>
```

Both will output the following HTML:

<pre><code class="language-html">
<p>Ut brisket flank salami.  Cow cupidatat ex t-bone sirloin id.</p>
</code></pre>

Support for figure and figcaption tags

There is now experimental support for the the HTML5 tags figure and figcaption.

A figure is a block level element and is created by wrapping some other content in three or more equal (=) signs.

A optional figure caption can be added to either the top of the figure or the bottom at the figure, right after the equal signs, wrapped in [ and ] signs.

Examples

This example shows a figure without a caption:

===
![](img/reference.png)
===

This example shows a figure with a caption added before the content:

=== [A **happy face** is good for web developers]
![](img/reference.png)
===

This example shows a figure with a caption added after the content:

===
![](img/reference.png)
=== [A **happy face** is good for web developers]