tags:

views:

160

answers:

1

If it's <script src="/script/jquery.autocomplete.js" type="text/javascript"> ,should call htmlspecialchars.

If it's <pre><code><script src="/script/jquery.autocomplete.js" type="text/javascript"></code></pre>,should leave it as is.

How to do this kind of task?

EDIT

Think you are using wmd editor like SO,and you included some code but didn't format it,in this case it should be processed by htmlspecialchars,but if you formatted it as "Code Sample",there is no need to process

A: 

I would make two scripts: jquery.autocomplete.js, and jquery.autocomplete.pre.js. In the latter, don't call htmlspecialchars.

Martin v. Löwis
How to make it programmatical?I don't know which case it is in code.
Mask