zi, I’ve resolved this issue by using a preg_match_all and then filtering by another preg_match. The // --> remains but likewise will // text -->
One more thing, its omitting the last //--> in the above example.
I changed an expression for better matching, I’ll revert it and test again tonight. Can you give me an example of the indent. Mine outputs the following:
With the beta2, if i choose to strip comments, conditional comments are removed.
If i set StripComments to no, conditional comments are still indented.
<!--[if lt IE 8]>
<style type="text/css">
li a {display:inline-block;} li a {display:block;}
</style>
<![endif]-->
Unfortunately not. Most of my application development is VisualLISP and AutoLISP with a splash of C++ and C# for AutoCAD. Never needed one. Although, I might look into it.
Thanks DT, will definitely give it a try.
By any chance, are you on Github ?
<!doctype html>
<!--[if lt IE 7 ]> <html class="ie6 no-js" lang="fr"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7 no-js" lang="fr"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8 no-js" lang="fr"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9 no-js" lang="fr"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="no-js" lang="fr">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<!--[if IE] >< ![endif]--> </footer>
<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<!-- allowing to choose library/version ? -->
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="/assets/js/mylibs/jquery-1.4.4.min.js"%3E%3C/script%3E'))</script>
<script src="/assets/js/plugins.js?v=1"></script>
<script src="/assets/js/script.js?v=1"></script>-->
<!-- end concatenated and minified scripts-->
<!--[if lt IE 7 ]>
<script src="/assets/js/libs/dd_belatedpng.js?v=1"></script>
<script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
<![endif]-->
<script> </footer>
<!--<script src="
<script>!window.jQuery && document.write(unescape('%3Cscript src="/assets/js/mylibs/jquery-1.4.4.min.js"%3E%3C/script%3E'))</script>
<script src="/assets/js/plugins.js?v=1"></script>
<script src="/assets/js/script.js?v=1"></script>-->
<!--[if lt IE 7 ]>
<script src="/assets/js/libs/dd_belatedpng.js?v=1"></script>
<script> DD_belatedPNG.fix('img, .png_bg');
<![endif]-->
<script>
<script language="javascript" type="text/javascript">
<!--
if(!s.c_r('elqCustomerGUID'))
{
d=new Date; d.setTime(d.getTime()+(365*24*60*60*1000));
s.c_w('elqCustomerGUID',GetElqCustomerGUID(),d);
}
s.pageName='SiteCatalyst';
s.channel='Products';
s.prop6='English';
if(s && s.c_r('tc_demo')==1 && s.c_r('tc_extra_info') != 'milestone=touchclarity')
{
tc_extra_info = 'milestone=sitecatalyst';
s.c_w('tc_extra_info','milestone=sitecatalyst');
}
if(typeof mboxCreate == 'function')
{ var epi_offer_name;
var epi_offer_product;
var epi_offer_centricity;
var epi_offer_type;
if(s.pageName==undefined) s.pageName=window.location;
mboxCreate('global_page_vars','pageinfo_name='+s.pageName,'pageinfo_section='+s.channel,'pageinfo_url='+window.location,'pageinfo_offer_name='+epi_offer_name,'pageinfo_offer_product='+epi_offer_product,'pageinfo_offer_centricity='+epi_offer_centricity,'pageinfo_offer_type='+epi_offer_type);
}
mboxLoadSCPlugin(s); var s_code=s.t();if(s_code)document.write(s_code)
//-->
</script>
</footer>
<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<!-- allowing to choose library/version ? -->
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="/assets/js/mylibs/jquery-1.4.4.min.js"%3E%3C/script%3E'))</script>
<script src="/assets/js/plugins.js?v=1"></script>
<script src="/assets/js/script.js?v=1"></script>-->
<!-- end concatenated and minified scripts-->
<!--[if lt IE 7 ]>
<script src="/assets/js/libs/dd_belatedpng.js?v=1"></script>
<script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
<![endif]-->
<script>
</footer>
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="/assets/js/mylibs/jquery-1.4.4.min.js"%3E%3C/script%3E'))</script>
<script src="/assets/js/plugins.js?v=1"></script>
<script src="/assets/js/script.js?v=1"></script>-->
<!--[if lt IE 7 ]>
<script src="/assets/js/libs/dd_belatedpng.js?v=1"></script>
<script> DD_belatedPNG.fix('img, .png_bg');
<![endif]-->
<script>
<script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script><script> DD_belatedPNG.fix('img, .png_bg'); </script>//fix any <img> or .png_bg background-images$source = preg_replace('%[^-:A-Za-z0-9"]//[^->].*$%m','',$source);//Strip any single line comments // not starting with a character or ending in ->
The only thing that’s different between your conditionals and mine is that yours are on the same line.
Sure, here is<!doctype html> <!--[if lt IE 7 ]> <html class="ie6 no-js" lang="fr"> <![endif]--> <!--[if IE 7 ]> <html class="ie7 no-js" lang="fr"> <![endif]--> <!--[if IE 8 ]> <html class="ie8 no-js" lang="fr"> <![endif]--> <!--[if IE 9 ]> <html class="ie9 no-js" lang="fr"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="fr"> <!--<![endif]--> <head> <meta charset="utf-8" /> <!--[if IE] >< ![endif]-->
$source = preg_replace('/<!--[^\[<>].*?(?<!!)-->/m','',$source); //strip html comments <!-- -->
<ul><li><a href="#">text</a></li><li><a href="#">text</a></li></ul>
<ul> <li><a href="#">text</a></li> <li><a href="#">text</a></li> </ul>
g5604, as far as I’m aware in my page loading times it’s still unnoticeable, maybe .2 of a second??? I couldn’t honestly tell you.
nice idea, thank you![]()
Only problem I see is its not formatting lists very well:
currently its like this
<ul><li><a href="#">text</a></li><li><a href="#">text</a></li></ul>
would be nice if it was:
<ul> <li><a href="#">text</a></li> <li><a href="#">text</a></li> </ul>
also will this plugin add any time to the page load?
The plugin was originally developed under evolution for use across my sites some 6 months or so ago. I still have one site using evolution so I will do a quick test tomorrow, however it should be compatible.
Is there also a package for EVO ?
Cheers
meanwhile you can see it in here:
Quote from: iusemodx at Jan 21, 2011, 01:57 AMThe plugin was originally developed under evolution for use across my sites some 6 months or so ago. I still have one site using evolution so I will do a quick test tomorrow, however it should be compatible.
Is there also a package for EVO ?
Cheers
DT