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    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (9 months ago) RSS 2.0 feedNot enough user ratingsTotal: 405 This week: 1All time: 6,520 This week: 45Up
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: 49 packages by
Country: United Kingdom
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

  Files folder image Files (11)  /  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 (11)  /  Example  /  img  
File Role Description
  Accessible without login Image file town.jpg Icon Icon image

  Files folder image Files (11)  /  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 (11)  /  Parse  
File Role Description
Files folder imageText (3 files)

  Files folder image Files (11)  /  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

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:1
All time:6,520
This week:45Up