Skip to content

Instantly share code, notes, and snippets.

@ShNURoK42
ShNURoK42 / MyParsedown
Last active February 6, 2023 20:18
Mention for Parsedown
<?php
class MyParsedown extends \Parsedown
{
function __construct()
{
$this->InlineTypes['@'][]= 'UserMention';
$this->inlineMarkerList .= '@';
}
@ShNURoK42
ShNURoK42 / converter.php
Last active April 15, 2016 17:15
Converter bbCode to markdown
protected function bbcode($bbcode)
{
$bbcode = str_replace("\n", " \n", $bbcode);
$bbcode = str_replace("[b]", "**", $bbcode);
$bbcode = str_replace("[/b]", "**", $bbcode);
$bbcode = str_replace("[i]", "*", $bbcode);
$bbcode = str_replace("[/i]", "*", $bbcode);