• This repository has been archived on 06/Aug/2020
  • Stars
    star
    113
  • Rank 300,119 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 13 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An fork of the PHP Markdown (Extra) project, extended with extra syntax, especially focused on adding support for more HTML attributes to outputted HTML, and for outputting HTML5.

PHP Markdown Extra Extended

An fork of the PHP Markdown (Extra) project (PME), extended with extra syntax, especially focused on adding support for more HTML attributes to outputted HTML, and for outputting HTML5.

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:

Line break generates a <br />

In PME, when you want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return. This turned out to be more annoying than helpful in my projects, so now you just have to type return. This is also how Markdown works with GFM.

Two returns does not insert a <br />, but instead creates a new paragraph as usual.

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]

Usage

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

require_once('markdown_extended.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.

More Repositories

1

Htmxor

Supercharges Blazor static server side rendering (SSR) by seamlessly integrating the Htmx.org frontend library.
C#
51
star
2

TimeProviderExtensions

Extensions for System.TimeProvider API. It includes an advanced test/fake version of the TimeProvider type and a backported version of PeriodicTimer to .NET 6 that support TimeProvider.
C#
27
star
3

Benchmark.Blazor

A sample benchmark.net test app that can be used to measure Blazor components.
C#
19
star
4

genzor

Genzor is an experimental library ideally suited for generating files spanning multiple folders, using Blazor component model to generating the output.
C#
16
star
5

jquery.odata

A odata (www.odata.org) plugin for jQuery
C#
15
star
6

pomodoro-timer

A HTML/JavaScript based Pomodoro Timer
JavaScript
14
star
7

SourceFileFinder

A small helper library, that allows you to find the source file of a type at runtime, based on the debug information included in the types assembly through the related portable PDB.
C#
11
star
8

BlazorTestingAZ

HTML
11
star
9

TypeScript-RequireJs-Jasmine

A demo project that illustrates how to setup and get TypeScript, RequireJs, and Jasmine playing nice together.
JavaScript
9
star
10

bootstrap.net

Bootstrap.NET is a strongly typed version of Bootstrap implemented in Razor Components, with a nice Bootstrap-like syntax for specifying options on components. On top of that, you get compile-time errors if you try to assign invalid options to components.
C#
7
star
11

Inversion-of-Block-Tridiagonal-Matrices

Bachelor project: We aim to understand the algorithm for block tridiagonal matrix inversion, and evaluate the theoretic performance gain by parallelizing the calculation, as presented in (Skelboe, S. (2009). The Scheduling of a Parallel Tiled Matrix Inversion Algorithm), by implementing a prototype of the algorithm.
4
star
12

.net-conf-2021-bunit-whats-new

HTML
3
star
13

XML-Driven-Logon-Script

XML Driven Logon Script is an VBScript based logon script which behaviour (like mapping network drives, installing printers) is controlled from an xml file. This makes it easy for the none-programmer to build and manage logon scripts within his or hers organisation, since no knowledge of VBScript is needed.
3
star
14

best-practise-tdd-with-bunit

HTML
3
star
15

ODataJS

An JavaScript script for working with the OData protocol.
JavaScript
2
star
16

BlazeWright

This library extends PlayWright, WebApplicationFactory, Nunit, and xUnit, to make Playwright and Blazor web apps play nicely together.
C#
2
star
17

AngleSharp.Wrappers

A library of wrappers for AngleSharp. Allows you to replace a real AngleSharp DOM tree but still keep the queried/returned node references. Built for and used by https://github.com/bUnit-dev/bUnit.
C#
2
star
18

Info-at-ITU

Java
1
star
19

VSDocJSDocConverter

A small Windows program that takes VsDoc as input and renders out the corresponding JsDoc.
C#
1
star
20

DEX1

Java
1
star
21

FileLoggerKata

My solution to the File Logger (mocking kata)
C#
1
star
22

palmscom

Java
1
star
23

PasswordExpireNotification

A small command line tool that will send a β€œYour password is about to expire” email to all members of a domain group if their password will expire within a specified number of days.
C#
1
star
24

Blazor8IndividualAuthWithPolicy

HTML
1
star
25

ApiTestingAZ

C#
1
star
26

BlazorSendDataToJs

C#
1
star