Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1132)

Unified Diff: Source/devtools/front_end/SourceFrame.js

Issue 18341003: DevTools: [CodeMirror] Add syntax highlighting for some other languages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/SourceFrame.js
diff --git a/Source/devtools/front_end/SourceFrame.js b/Source/devtools/front_end/SourceFrame.js
index 659825c0ac42bc1c2bf765fa32f5e56e0ed3f011..873121baad6a5029b5852b21c638afb7589a2773 100644
--- a/Source/devtools/front_end/SourceFrame.js
+++ b/Source/devtools/front_end/SourceFrame.js
@@ -343,7 +343,13 @@ WebInspector.SourceFrame.prototype = {
} else
this._textEditor.editRange(this._textEditor.range(), content || "");
- this._textEditor.mimeType = this._simplifyMimeType(mimeType);
+ mimeType = this._simplifyMimeType(mimeType);
+
+ // A hack around the fact that files with "php" extension might be either standalone or html embedded php scripts.
+ if (mimeType === "text/x-php" && content.match(/\<\?.*\?\>/gi))
apavlov 2013/07/01 12:46:48 The "i" flag is not necessary, since you are not c
+ mimeType = "application/x-httpd-php";
+
+ this._textEditor.mimeType = mimeType;
this._textEditor.beginUpdates();

Powered by Google App Engine
This is Rietveld 408576698