mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Update copyright for HTML5 file should not insert comment before DOCTYPE because of IE thinking it is quirked file then
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<orderEntry type="module" module-name="openapi" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="commons-collections" level="project" />
|
||||
<orderEntry type="module" module-name="xml" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
+9
-1
@@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.xml.util.HtmlUtil;
|
||||
import com.maddyhome.idea.copyright.CopyrightProfile;
|
||||
import com.maddyhome.idea.copyright.options.LanguageOptions;
|
||||
import com.maddyhome.idea.copyright.options.XmlOptions;
|
||||
@@ -94,7 +95,7 @@ public class UpdateXmlCopyrightsProvider extends UpdateCopyrightsProvider {
|
||||
}
|
||||
|
||||
int location = getLanguageOptions().getFileLocation();
|
||||
if (doctype != null)
|
||||
if (doctype != null && !isHtml5DoctypeIEFix(doc))
|
||||
{
|
||||
checkComments(first, doctype, location == XmlOptions.LOCATION_BEFORE_DOCTYPE);
|
||||
first = doctype;
|
||||
@@ -115,6 +116,13 @@ public class UpdateXmlCopyrightsProvider extends UpdateCopyrightsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isHtml5DoctypeIEFix(XmlDocument doc) {
|
||||
if (HtmlUtil.isHtml5Document(doc)) {
|
||||
return true; // IE goes quirks mode if comment before doc type so pardon the setting we will not handle you then
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected PsiElement getPreviousSibling(PsiElement element)
|
||||
{
|
||||
if (element == null) return null;
|
||||
|
||||
Reference in New Issue
Block a user