Skip to content
Permalink
Browse files

Remove custom syntax for text formatting

  • Loading branch information
coderkun committed Apr 13, 2019
1 parent 0a33e29 commit 1bd4541faaf0799d558a30bf329020187473077c
Showing with 0 additions and 36 deletions.
  1. +0 −36 app/TextFormatter.inc
@@ -65,9 +65,6 @@
// Add link targets
$string = $this->tLinks($string);
// Handle custom formatting
$string = $this->tCustom($string);
// Handle Seminarymedia
$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.
*

0 comments on commit 1bd4541

Please sign in to comment.
You can’t perform that action at this time.