All Projects → breeswish → php-marked

breeswish / php-marked

Licence: MIT License
Yet another PHP markdown parser.

Programming Languages

HTML
75241 projects
PHP
23972 projects - #3 most used programming language
XML
50 projects

Projects that are alternatives of or similar to php-marked

Editor.md
The open source embeddable online markdown editor (component).
Stars: ✭ 11,741 (+83764.29%)
Mutual labels:  gfm
Vditor
♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
Stars: ✭ 3,773 (+26850%)
Mutual labels:  gfm
Hyde
📝 An Electron powered markdown editor for Jekyll users
Stars: ✭ 44 (+214.29%)
Mutual labels:  gfm
Hads
📚 Markdown superpowered documentation for Node.js
Stars: ✭ 147 (+950%)
Mutual labels:  gfm
Tui.editor
🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
Stars: ✭ 14,016 (+100014.29%)
Mutual labels:  gfm
Markdig
A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
Stars: ✭ 2,730 (+19400%)
Mutual labels:  gfm
Markd
Yet another markdown parser, Compliant to CommonMark specification, written in Crystal.
Stars: ✭ 73 (+421.43%)
Mutual labels:  gfm
gfm-code-blocks
Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.
Stars: ✭ 20 (+42.86%)
Mutual labels:  gfm
Abricotine
Markdown editor with inline preview
Stars: ✭ 2,308 (+16385.71%)
Mutual labels:  gfm
htmlup
light and fast markdown parser
Stars: ✭ 48 (+242.86%)
Mutual labels:  php-markdown-parser
Commonmark
Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
Stars: ✭ 2,128 (+15100%)
Mutual labels:  gfm
Python Markdown Editor
Standalone editor for your markdown files
Stars: ✭ 164 (+1071.43%)
Mutual labels:  gfm
Lute
🎼 一款对中文语境优化的 Markdown 引擎,支持 Go 和 JavaScript。A structured Markdown engine that supports Go and JavaScript.
Stars: ✭ 222 (+1485.71%)
Mutual labels:  gfm
Vditor
♏ 一款浏览器端的 Markdown 编辑器。
Stars: ✭ 1,742 (+12342.86%)
Mutual labels:  gfm
commonmark
High Performance CommonMark and Github Markdown Rendering in R
Stars: ✭ 78 (+457.14%)
Mutual labels:  gfm
Remark Github
plugin to autolink references to commits, issues, pull-requests, and users, like on GitHub
Stars: ✭ 83 (+492.86%)
Mutual labels:  gfm
Lute
🎼 一款结构化的 Markdown 引擎,支持 Go 和 JavaScript。
Stars: ✭ 211 (+1407.14%)
Mutual labels:  gfm
pretty-remarkable
Plugin for prettifying markdown with https://github.com/jonschlinkert/remarkable using custom renderer rules.
Stars: ✭ 22 (+57.14%)
Mutual labels:  gfm
thegreatmarkdown
《了不起的 Markdown》
Stars: ✭ 44 (+214.29%)
Mutual labels:  gfm
celldown.js
Small javascript library for manipulating markdown tables
Stars: ✭ 17 (+21.43%)
Mutual labels:  gfm

php-marked - Yet Another PHP Markdown Parser

A full-featured PHP markdown parser.

  • Ported from chjj/marked, consistent with previewing by JavaScript

  • Support Github Flavoured Markdown

    • Multiple underscores in words

    • URL autolinking

    • Strikethrough

    • Fenced code blocks

    • Tables

  • High performance

Requirements

  • PHP 5.3+

  • Composer

Installation

composer require "breeswish/php-marked"

Usage

Minimal usage:

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

Example setting options with default values:

\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

String of markdown source to be compiled.

options

Type: array

Hash of options. Can also be set using the Marked::setOptions method as seen above.

Basic Options

gfm

Type: boolean Default: true

Enable GitHub flavored markdown.

tables

Type: boolean Default: true

Enable GFM tables. This option requires the gfm option to be true.

breaks

Type: boolean Default: false

Enable GFM line breaks. This option requires the gfm option to be true.

pedantic

Type: boolean Default: false

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

sanitize

Type: boolean Default: false

Sanitize the output. Ignore any HTML that has been input.

smartLists

Type: boolean Default: true

Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.

smartypants

Type: boolean Default: false

Use "smart" typograhic punctuation for things like quotes and dashes.

langPrefix

Type: string Default: "lang-"

The prefix to be append in the className of <code>.

xhtml

Type: boolean Default: false

Render XHTML.

headerPrefix

Type: string Default: ""

The prefix to be append in the id attribute of headers.

Testing

run phpunit.

License

The MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].