Closed GoogleCodeExporter closed 9 years ago
This happens because php tags are interpreted as html tags. I am not using any
deep
analysis for HTML (for speed sake), just regular expressions, so when it sees
`<script type="text/javascript" src="<?php echo
$this->arrayFiles['jquery.js']['url']
?>"></script>`
it takes '<' and '>' php symbols as html tag boundaries.
It was not intended to parse anything other than plain html. Sorry, I don't
think I
will be able to do anything with this problem.
Btw a better way of doing html compression for php would be putting your html
into
Smarty templates and then using `{strip}` tags. That's how I deal with php
compression and that's what inspired this project.
Original comment by serg472@gmail.com
on 8 Dec 2009 at 7:17
Actually, this issue is caused by any invalid javascript in a <script> tag. The
YUI Compressor tries to write to its error reporter, but due to line 312 of
HtmlCompressor.java:
JavaScriptCompressor compressor = new JavaScriptCompressor(new
StringReader(source), null);
The error reporter is explicitly "null" so NullPointerException is thrown. I
have attached a patch that allows the user to set the yuiErrorReporter
Original comment by erin....@gmail.com
on 23 Jun 2010 at 1:43
Attachments:
@erin.dru Thanks. Was added in 0.9.2 version.
Also custom preservation rules were added, php blocks can be preserved now.
Original comment by serg472@gmail.com
on 28 Aug 2010 at 2:23
Original issue reported on code.google.com by
muriloel...@gmail.com
on 8 Dec 2009 at 6:32Attachments: