mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Reverted 482c517
This commit is contained in:
@@ -154,6 +154,13 @@ abstract class BaseHtmlLexer extends DelegateLexer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Language getScriptLanguage() {
|
||||
Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(scriptType != null ? scriptType.trim() : null);
|
||||
return instancesByMimeType.isEmpty() ? null : instancesByMimeType.iterator().next();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected IElementType getCurrentScriptElementType() {
|
||||
HtmlScriptContentProvider scriptContentProvider = findScriptContentProvider(scriptType);
|
||||
@@ -333,7 +340,7 @@ abstract class BaseHtmlLexer extends DelegateLexer {
|
||||
protected boolean isValidAttributeValueTokenType(final IElementType tokenType) {
|
||||
return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN ||
|
||||
tokenType == XmlTokenType.XML_ENTITY_REF_TOKEN ||
|
||||
tokenType == XmlTokenType.XML_CHAR_ENTITY_REF;
|
||||
tokenType == XmlTokenType.XML_CHAR_ENTITY_REF;
|
||||
}
|
||||
|
||||
public void advance() {
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
package com.intellij.lexer;
|
||||
|
||||
import com.intellij.lang.HtmlInlineScriptTokenTypesProvider;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.LanguageHtmlInlineScriptTokenTypesProvider;
|
||||
import com.intellij.lang.LanguageUtil;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.psi.TokenType;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
@@ -74,7 +76,9 @@ public class HtmlLexer extends BaseHtmlLexer {
|
||||
tokenType = ourInlineStyleElementType;
|
||||
}
|
||||
} else if (hasSeenScript()) {
|
||||
if (hasSeenTag() && isStartOfEmbeddmentTagContent(tokenType)) {
|
||||
Language scriptLanguage = getScriptLanguage();
|
||||
boolean canInject = scriptLanguage == null || LanguageUtil.isInjectableLanguage(scriptLanguage);
|
||||
if (hasSeenTag() && isStartOfEmbeddmentTagContent(tokenType) && canInject) {
|
||||
myTokenEnd = skipToTheEndOfTheEmbeddment();
|
||||
IElementType currentScriptElementType = getCurrentScriptElementType();
|
||||
tokenType = currentScriptElementType == null ? XmlTokenType.XML_DATA_CHARACTERS : currentScriptElementType;
|
||||
|
||||
Reference in New Issue
Block a user