                    
<?php
//-->-->-->-->-->-->-->-->
//-- Description:
//--   The purpose of this function is to perform some standard
//--   transformations on a plain text string in order to render
//--   the text as meaningful HTML. For example filenames in the
//--   text are recognised and made into a 'teletype' font using
//--   the 'tt' HTML tag. This function complements the function
//--   fnHtmlCommonTransforms which should be called before the 
//--   current function.
//--
//--   Also the function fnHyperlinkPlainText should be called 
//--   before the current function (if at all). This order of calling
//--   the functions represents the importance of the plain text
//--   structures for rendering into HTML. For example, it is
//--   more important that file name type structures which appear
//--   in the context of hyperlinkable text should be hyperlinked
//--   rather than made into teletype type of text. This 
//--   order of calling functions is necessary because the plain
//--   text string allows fairly 'free-form' structures which may
//--   be in a sense ambiguous as to the way in which they should
//--   be rendered into HTML or into another more determinate
//--   format, such as XML
//--  
//-- Notes:
//--
//-- History:
//--
//-- Dependencies:
//-- See Also:
//--   There are a large number of similar types of transformation
//--   functions which may call this function or perform similar
//--   types of jobs. 
//--
//-- Author:
//--   matth3wbishop@yahoo.com
//--   http://www.geocities.com/matth3wbishop/
//--

function fnHtmlCommonTransformsMore($sPlainText)
{
  $sReturn = $sPlainText;

  //-- Make a tab into 2 HTML spaces
  $sReturn = preg_replace("#\t#im", "&nbsp;&nbsp;", $sReturn);

  //-- Try to recognise filename type structures and render them
  //-- in a distinguishable manner
  $sReturn = preg_replace(
   "#\s(/\S+)\s#im", " <tt>$1</tt> ", $sReturn);

  //$sReturn = preg_replace(
  // "#\s(\S+/\S+)\s#im", " <tt>$1</tt> ", $sReturn);

  //-- get rid of the 'meta-tags' which is used to tell the transformation
  //-- system that the current document should be transformed according to the 
  //-- rules for a journal for a particular type of document.

  //-- This </dl> rubbish is a terrible hack. It is assuming that 
  //-- the faq flag occurs right at the end of the document and that
  //-- there is some kind of definition list in the doc. Very ugly.
  $sReturn = preg_replace(
    "#^\s*\[\*(faq|document|journal|cv|resume)\*\]\s*$#im", 
    "</dl>", $sReturn);

  return $sReturn;
} //-- function fnHtmlCommonTransformsMore
     

//--<--<--<--<--<--<--<--<
?>
                                                                                                                                                                                                                                                                                                        