Changeset 63

Show
Ignore:
Timestamp:
03/05/07 21:54:32 (2 years ago)
Author:
renato
Message:

Now it supresses <p> and <br> tags generated by tinymce from the input.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • latex/mod/latex/lib.php

    r62 r63  
    2525    for ($i=0; $i < count($tex_matches[0]); $i++) { 
    2626        $pos = strpos($text, $tex_matches[0][$i]); 
    27         $latex_formula = html_entity_decode($tex_matches[1][$i]); 
    2827 
     28                // get formula and replace blank spaces 
     29                $latex_formula = str_replace('&nbsp;', ' ', $tex_matches[1][$i]); 
     30 
     31                // convert to new-line <p> and <br> 
     32                $latex_formula = preg_replace('#<p\\s*?/??>#i', '', $latex_formula); 
     33                $latex_formula = preg_replace('#</p\\s*?/??>#i', "\n", $latex_formula); 
     34                $latex_formula = preg_replace('#<br\\s*?/??>#i', "\n", $latex_formula); 
     35                 
     36                // decode html entities 
     37                $latex_formula = html_entity_decode($latex_formula); 
     38                 
    2939        $url = $latex->getFormulaURL($latex_formula); 
    3040