                                                                                                                                                


<?php
//-->-->-->-->-->-->-->-->
//--Description:
//--   The purpose of this function is to transform a string of text
//--   from HTML. The string of text is considered to be a 'code listing'
//--   or some kind of 'blockquote' or basically any kind of text which is
//--   designed to give the impression as having come from a different
//--   source from the current document. 
//--
//--   In practical terms, this is a section of text which is supposed to
//--   be enclosed in HTML <pre> tags. In other words, no further markup
//--   should be applied to the designated block of text. This may appear
//--   to be a very simple function to write; simply do not apply any markup.
//--
//--   However, in the context of regular expression transformations, and 
//--   particularly in the context of multi-line transformations, it is 
//--   slightly difficult to not apply certain transformation within given
//--   delimiters. The problem is more easily solved in a program such as 'sed'
//--   because 'sed' is line-oriented program and supports the very useful
//--   /delimiter/,/delimiter/ syntax to restrict the application of 
//--   regular expressions. However, the php regular expressions are multi-line
//--   oriented, which in many circumstances is particularly good, but in this
//--   circumstance is not as good. 
//--   
//--   I intend to make use of the 'callback' feature of the php regular
//--   expressions in order to achieve a similar effect to the sed line
//--   delimiter functionality. The trick I will use is to transform the
//--   text into something determinately unmatchable by all other regular
//--   expressions, and then at the end of all regular expressions, 
//--   untransform that same text, leaving it in its original state.
//--

//--
//--
//--See Also:
//--   http://wagga-cwc.org.au/refurb/product-data/lib/journal-to-html.sed
//--     This is an example of using the 'sed' program to do a similar task
//--
//--Author:
//--  matth3wbishop@yahoo.com
//--  http://www.geocities.com/matth3wbishop/
//--
//--History:
//--
//--


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

  //-- On 
  $sReturn = preg_replace("#\&nbsp;#im", " ", $sReturn);

  return $sReturn;
} //-- function fnCodeBlockFromHtml 
     
//--<--<--<--<--<--<--<--<
?>
                                                                                                                                                