Skip to content
This repository has been archived by the owner on Jul 3, 2022. It is now read-only.

Commit

Permalink
Remove custom syntax for text formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
coderkun committed Apr 13, 2019
1 parent 0a33e29 commit 1bd4541
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions app/TextFormatter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
// Add link targets
$string = $this->tLinks($string);

// Handle custom formatting
$string = $this->tCustom($string);

// Handle Seminarymedia
$string = $this->tSeminarymedia($string);

Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 1bd4541

Please sign in to comment.