- Timestamp:
- Jan 9, 2006, 9:30:21 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_5/include/functions_html.inc.php
r975 r1002 402 402 { 403 403 $content = nl2br($content); 404 405 $pattern = '/(http?:\/\/\S*)/'; 406 $replacement = '<a href="$1">$1</a>'; 407 $content = preg_replace($pattern, $replacement, $content); 404 408 405 409 // replace _word_ by an underlined word 406 $pattern = '/ _([^\s]*)_/';407 $replacement = '<span style="text-decoration:underline;"> \1</span>';410 $pattern = '/\b_(\S*)_\b/'; 411 $replacement = '<span style="text-decoration:underline;">$1</span>'; 408 412 $content = preg_replace($pattern, $replacement, $content); 409 413 410 414 // replace *word* by a bolded word 411 $pattern = '/\ *([^\s]*)\*/';412 $replacement = '<span style="font-weight:bold;"> \1</span>';415 $pattern = '/\b\*(\S*)\*\b/'; 416 $replacement = '<span style="font-weight:bold;">$1</span>'; 413 417 $content = preg_replace($pattern, $replacement, $content); 414 418 415 419 // replace /word/ by an italic word 416 $pattern = '/\/([^\s]*)\//';417 $replacement = '<span style="font-style:italic;">\1</span>';418 $content = preg_replace($pattern, $replacement, $content);420 $pattern = "/\/(\S*)\/(\s)/"; 421 $replacement = '<span style="font-style:italic;">$1$2</span>'; 422 $content = preg_replace($pattern, $replacement, $content); 419 423 420 424 return $content;
Note: See TracChangeset
for help on using the changeset viewer.