Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/language/LanguageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,12 @@ define(function (require, exports, module) {
"scriptTypes": [{"matches": /\/x-handlebars|\/x-mustache|^text\/html$/i,
"mode": null}]
});


// Define SVG MIME type so an SVG language can be defined for SVG-specific code hints.
// Currently, SVG uses XML mode so it has generic XML syntax highlighting. This can
// be removed when SVG gets its own CodeMirror mode with SVG syntax highlighting.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might consider adding a link to your original CodeMirror PR for reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@le717 This code does basically the same thing, but in Brackets instead of CodeMirror. Anyway, original CodeMirror PR (that was not merged) is: codemirror/codemirror5#2933

CodeMirror.defineMIME("image/svg+xml", "xml");

// Load the default languages
_defaultLanguagesJSON = JSON.parse(_defaultLanguagesJSON);
_ready = Async.doInParallel(Object.keys(_defaultLanguagesJSON), function (key) {
Expand Down
9 changes: 8 additions & 1 deletion src/language/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@
"xml": {
"name": "XML",
"mode": "xml",
"fileExtensions": ["xml", "svg", "wxs", "wxl", "wsdl", "rss", "atom", "rdf", "xslt", "xsl", "xul", "xbl", "mathml", "config", "plist", "xaml"],
"fileExtensions": ["xml", "wxs", "wxl", "wsdl", "rss", "atom", "rdf", "xslt", "xsl", "xul", "xbl", "mathml", "config", "plist", "xaml"],
"blockComment": ["<!--", "-->"]
},

"svg": {
"name": "SVG",
"mode": ["xml", "image/svg+xml"],
"fileExtensions": ["svg"],
"blockComment": ["<!--", "-->"]
},

Expand Down