Re: [PHP] importNode issue

2010-02-16 Thread Michael A. Peters
Michael A. Peters wrote: I'm experiencing a slight problem with importNODE putting unwanted carriage returns in the the output. Here's my function: // syntax highlighting include_once('Text/Highlighter.php'); function syntaxHighlight($dom,$lang,$code) { $hl =& Text_Highlighter::factory($la

Re: [PHP] importNode issue

2010-01-25 Thread Michael A. Peters
Jochem Maas wrote: highlight_string() function might be an easier route? If I only ever wanted to highlight php it might be. I found a workaround, though I don't like it. add $dom->formatOutput = false; to the function and it displays perfectly, though viewing the generated source isn't as

Re: [PHP] importNode issue

2010-01-25 Thread Jochem Maas
highlight_string() function might be an easier route? Op 1/25/10 9:55 AM, Michael A. Peters schreef: > I'm experiencing a slight problem with importNODE putting unwanted > carriage returns in the the output. > > Here's my function: > > // syntax highlighting > include_once('Text/Highlighter.php'

Re: [PHP] importNode issue

2010-01-25 Thread Michael A. Peters
Michael A. Peters wrote: The only (untried) solution I can think of is to replace each carriage return with a and every space with   and then replace the with a or some such hackery before running loadXML() on it. But I would rather not do that. Even that isn't really working but what I

[PHP] importNode issue

2010-01-25 Thread Michael A. Peters
I'm experiencing a slight problem with importNODE putting unwanted carriage returns in the the output. Here's my function: // syntax highlighting include_once('Text/Highlighter.php'); function syntaxHighlight($dom,$lang,$code) { $hl =& Text_Highlighter::factory($lang); $out = $hl->highli