PHP Classes

PHP Markdown and BBCode Parser: Parse and replace Markdown and BBCode by HTML

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 405 All time: 6,522 This week: 54Up
Version License PHP version Categories
php-markdown-bbcode 1.10GNU General Publi...5.3PHP 5, Text processing
Description 

Author

This package can parse Markdown and BBCode to replace by HTML tags.

It provides separate classes that can take a text string with either BBCode or Markdown format tags and replace them by equivalent HTML tags.

A base class is also capable of sanitizing the text by removing JavaScript tags.

Picture of Pierre-Henry Soria
  Performance   Level  
Innovation award
Innovation award
Nominee: 18x

Winner: 3x

 

Example

<?php
/**
 * @title Markdown Markup Language
 *
 * @author Pierre-Henry Soria <ph7software@gmail.com>
 * @copyright (c) 2012-2013, Pierre-Henry Soria. All Rights Reserved.
 * @license Lesser General Public License; See LICENSE.txt in the root directory.
 * @link http://github.com/pH-7
 * @package PH7
 * @version 1.0
 */

namespace PH7;
define('PH7', true);

use
PH7\Parse\Text as Txt;

require
'_autoload.php';

$sMarkdownText = file_get_contents('text/markdown.md');

$oMarkdown = new Txt\Markdown($sMarkdownText);
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<title>Markdown Parser example</title>
</head>
<body>
<?php echo $oMarkdown; ?>
</body>
</html>




Details

Parser for BBCode and Markdown Markup Language

Interpretation for two markup languages, BBCode and Markup with support of HTML5. They also complement each other with my parser emoticons.

Note: The language BBCode is customized by me, I added some extra tags (tags and some do not have the same name).

Server Requirements

PHP 5.3.0 or newer.

Author

Pierre-Henry Soria

License

Lesser General Public License 3 or later; See the LICENSE.txt file.


  Files folder image Files (11)  
File Role Description
Files folder imageExample (3 files, 2 directories)
Files folder imageParse (1 directory)
Accessible without login Plain text file LICENSE.txt Lic. License text
Accessible without login Plain text file README.md Data Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:405
This week:0
All time:6,522
This week:54Up