PHP Classes

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

Recommend this page to a friend!
  Info   View files Example   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 405 This week: 1All time: 6,514 This week: 560Up
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  
Name: Pierre-Henry Soria <contact>
Classes: 46 packages by
Country: United Kingdom
Age: 33
All time rank: 37916 in United Kingdom
Week rank: 24 Up1 in United Kingdom Up
Innovation award
Innovation award
Nominee: 17x

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  
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

  Files folder image Files  /  Example  
File Role Description
Files folder imageimg (1 file)
Files folder imagetext (2 files)
  Accessible without login Plain text file bbcode.php Example Example script
  Accessible without login Plain text file markdown.php Example Example script
  Accessible without login Plain text file _autoload.php Example Example script

  Files folder image Files  /  Example  /  img  
File Role Description
  Accessible without login Image file town.jpg Icon Icon image

  Files folder image Files  /  Example  /  text  
File Role Description
  Accessible without login Plain text file bbcode.bbc Data Auxiliary data
  Accessible without login Plain text file markdown.md Data Auxiliary data

  Files folder image Files  /  Parse  
File Role Description
Files folder imageText (3 files)

  Files folder image Files  /  Parse  /  Text  
File Role Description
  Plain text file BbCode.class.php Class Class source
  Plain text file Code.class.php Class Class source
  Plain text file Markdown.class.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:405
This week:1
All time:6,514
This week:560Up