Remove custom syntax for text formatting

This commit is contained in:
coderkun 2019-04-13 19:18:32 +02:00
parent 0a33e29e4f
commit 1bd4541faa

View file

@ -65,9 +65,6 @@
// Add link targets // Add link targets
$string = $this->tLinks($string); $string = $this->tLinks($string);
// Handle custom formatting
$string = $this->tCustom($string);
// Handle Seminarymedia // Handle Seminarymedia
$string = $this->tSeminarymedia($string); $string = $this->tSeminarymedia($string);
@ -135,39 +132,6 @@
} }
/**
* Handle custom formatting syntax.
*
* @Deprecated
* @param string $string String to format
* @return string Formatted string
*/
private function tCustom($string)
{
// Important text
$string = str_replace('[strong]', '<strong>', $string);
$string = str_replace('[/strong]', '</strong>', $string);
// Create tables
$string = preg_replace('/(\[table\])\s+/u', '$1', $string);
$string = preg_replace('/\s*(\[tr\])\s*/u', '$1', $string);
$string = preg_replace('%\s+(\[/table\])%u', '$1', $string);
$string = preg_replace('%\s*(\[/tr\])\s*%u', '$1', $string);
$string = str_replace('[table]', '</p><table>', $string);
$string = str_replace('[/table]', '</table><p>', $string);
$string = str_replace('[tr]', '<tr>', $string);
$string = str_replace('[/tr]', '</tr>', $string);
$string = str_replace('[th]', '<th>', $string);
$string = str_replace('[/th]', '</th>', $string);
$string = str_replace('[td]', '<td>', $string);
$string = str_replace('[/td]', '</td>', $string);
// Return new string
return $string;
}
/** /**
* Handle including Seminarymedia. * Handle including Seminarymedia.
* *