![]() |
possible to display snippets without losing line breaks?
I'm using phpdig to search some code. The search snippets lose all the line breaks
which are there on the original html version of the code. Can I display the snippets as they were originally? I think the original has the code I'm searching within a <PRE/> block. but just putting <pre></pre> around the output doesn't work. Any pointers welcome Rachel |
The phpdigCleanHtmlfunction in robot_functions.php might be a good spot to edit to allow tags. By default PhpDig strips tags from indexed content to get just the text parts of the page. However, if you allow tags, you're going to run into problems like (a) when someone searches on pre and breaks a tag, (b) when the snippet cuts a tag in half and you see HTML source in the results, (c) when a begin/end tag is in the snippet but its match is not, etcetera. Instead you might consider using phpdigExclude/Include as described in this thread to avoid indexing code blocks.
|
All times are GMT -8. The time now is 03:05 AM. |
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.