Skip to content
GemorrojPublic
forked from xBBCoder/xBBCode

About

PHP scripts for BBCode

Topics

Resources

Stars

16 stars

Watchers

4 watching

Forks

 
 

Repository files navigation

Parser BBcode

Continuous Integration

Example:

<?php
use Xbbcode\Xbbcode;

$text = 'Это [b]пример[/b] работы парсера [url=https://github.com/Gemorroj/xBBCode]xBBCode[/url].';
$xbbcode = new Xbbcode();
$xbbcode->parse($text);

echo $xbbcode->getHtml();

Requirements:

  • PHP >= 8.2

Security Note:

  • Geshi has security problem GeSHi/geshi-1.0#159
  • This doesn't seem relevant for XbbCode.
  • To avoid composer blocking, use --no-security-blocking option.

Installation:

composer require gemorroj/xbbcode --no-security-blocking

Notes:

  • Optional styling: resources/style.css; override colors with --xbbcode-* variables.
  • Code tags use GeSHi by default; call $xbbcode->setCodeHighlighting(false) to emit <pre><code class="language-*"> for a client-side highlighter (num → data-start, tab → data-tab-width, extra → data-highlight-lines, links → data-keyword-links).
  • [spoiler]/[hide] render native <details>; the legacy Spoiler handler is deprecated.

License:

  • GNU GPL v 2

About

PHP scripts for BBCode

Topics

Resources

Stars

16 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages