2017 © Pedro Peláez
 

library php-marked

A PHP markdown parser, ported from marked. Built for speed.

image

breeswish/php-marked

A PHP markdown parser, ported from marked. Built for speed.

  • Thursday, February 19, 2015
  • by breeswish
  • Repository
  • 2 Watchers
  • 13 Stars
  • 7,069 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 10 % Grown

The README.md

php-marked - Yet Another PHP Markdown Parser

A full-featured PHP markdown parser., (*1)

  • Ported from chjj/marked, consistent with previewing by JavaScript, (*2)

  • Support Github Flavoured Markdown, (*3)

    • Multiple underscores in words, (*4)

    • URL autolinking, (*5)

    • Strikethrough, (*6)

    • Fenced code blocks, (*7)

    • Tables, (*8)

  • High performance, (*9)

Requirements

  • PHP 5.3+, (*10)

  • Composer, (*11)

Installation

composer require "breeswish/php-marked"

Usage

Minimal usage:, (*12)

echo \Breezewish\Marked\Marked::render('I am using __markdown__.');
// => <p>I am using <strong>markdown</strong>.</p>

Example setting options with default values:, (*13)

\Breezewish\Marked\Marked::setOptions(array(
    'gfm'          => true,
    'tables'       => true,
    'breaks'       => false,
    'pedantic'     => false,
    'sanitize'     => false,
    'smartLists'   => false,
    'smartypants'  => false,
    'langPrefix'   => 'lang-',
    'xhtml'        => false,
    'headerPrefix' => '',
    'highlight'    => null,
    'renderer'     => new \Breezewish\Marked\Renderer()
));

echo \Breezewish\Marked\Marked::render('I am using __markdown__.');

Marked::render(markdownString [,options])

markdownString

Type: string, (*14)

String of markdown source to be compiled., (*15)

options

Type: array, (*16)

Hash of options. Can also be set using the Marked::setOptions method as seen above., (*17)

Basic Options

gfm

Type: boolean Default: true, (*18)

Enable GitHub flavored markdown., (*19)

tables

Type: boolean Default: true, (*20)

Enable GFM tables. This option requires the gfm option to be true., (*21)

breaks

Type: boolean Default: false, (*22)

Enable GFM line breaks. This option requires the gfm option to be true., (*23)

pedantic

Type: boolean Default: false, (*24)

Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior., (*25)

sanitize

Type: boolean Default: false, (*26)

Sanitize the output. Ignore any HTML that has been input., (*27)

smartLists

Type: boolean Default: true, (*28)

Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic., (*29)

smartypants

Type: boolean Default: false, (*30)

Use "smart" typograhic punctuation for things like quotes and dashes., (*31)

langPrefix

Type: string Default: "lang-", (*32)

The prefix to be append in the className of <code>., (*33)

xhtml

Type: boolean Default: false, (*34)

Render XHTML., (*35)

headerPrefix

Type: string Default: "", (*36)

The prefix to be append in the id attribute of headers., (*37)

Testing

run phpunit., (*38)

License

The MIT License., (*39)

The Versions

19/02 2015

dev-master

9999999-dev

A PHP markdown parser, ported from marked. Built for speed.

  Sources   Download

MIT

The Requires

  • php >5.3.0

 

by Breezewish

parser markdown marked

19/02 2015

v0.3.3

0.3.3.0

A PHP markdown parser, ported from marked. Built for speed.

  Sources   Download

MIT

The Requires

  • php >5.3.0

 

by Breezewish

parser markdown marked