Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329649

Summary: With .html extension, HTML closing tag not recognised when PHP tags placed in attributes
Product: z_Archived Reporter: Barry Coughlan <barry>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact: Ilina Stefanova <ilina.s>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Barry Coughlan CLA 2010-11-07 23:40:07 EST
Build ID: 20100617-1415

Problem: If the file extension is ".html", then when "<?php .... ?>" is placed within a HTML tag, Eclipse PDT shows an error in the code about not being able to find the closing tag.

Sample code:
<img src="<?php echo DOKU_TPL ?>images/button-chimeric-de.png" border="0" />

Steps to reproduce:
1. Create a .html file in an Eclipse PDT project
2. Paste the sample code in.

Notes: It could be argued that since it is a .html file it should not parse PHP, however many FOSS packages contain code with .html extensions that have PHP code in them. Perhaps a feature request to allow selecting which extensions should be parsed as PHP would be more appropriate?
Comment 1 Zhongwei Zhao CLA 2010-11-08 02:03:09 EST
add *.html to php content type through Preferences->General->Content Types
expand Text tree in the right half window,then find PHP Content Type,then add *.html to php content type.then close the html files that contain php,then reopen them(it is better to wait for several minutes or restart pdt).
Comment 2 Ilina Stefanova CLA 2011-07-27 03:19:01 EDT
Verified.