コード例 #1
0
ファイル: Utils.php プロジェクト: birdofpray70/Shaarli
/**
 * Format Shaarli's description
 * TODO: Move me to ApplicationUtils when it's ready.
 *
 * @param string $description shaare's description.
 * @param string $redirector  if a redirector is set, use it to gerenate links.
 *
 * @return string formatted description.
 */
function format_description($description, $redirector)
{
    return nl2br(space2nbsp(text2clickable($description, $redirector)));
}
コード例 #2
0
ファイル: UtilsTest.php プロジェクト: ErwanLeroux/Shaarli
 /**
  * Test testSpace2nbsp.
  */
 public function testSpace2nbsp()
 {
     $text = '  Are you   thrilled  by flags   ?' . PHP_EOL . ' Really?';
     $expectedText = '  Are you   thrilled  by flags   ?' . PHP_EOL . ' Really?';
     $processedText = space2nbsp($text);
     $this->assertEquals($expectedText, $processedText);
 }