##// END OF EJS Templates
Merge pull request #6416 from Carreau/foobarcode...
Merge pull request #6416 from Carreau/foobarcode Unify Text/CodeCell code.

File last commit:

r17940:1a62abc5
r18276:43b80ca3 merge
Show More
codemirror-ipythongfm.js
44 lines | 1.5 KiB | application/javascript | JavascriptLexer
/ IPython / html / static / notebook / js / codemirror-ipythongfm.js
Jonathan Frederic
Create ipythongfm mode
r16787 // IPython GFM (GitHub Flavored Markdown) mode is just a slightly altered GFM
// Mode with support for latex.
//
// Latex support was supported by Codemirror GFM as of
Matthias Bussonnier
codemirror rempo moved, update links in comments
r17940 // https://github.com/codemirror/CodeMirror/pull/567
Jonathan Frederic
Create ipythongfm mode
r16787 // But was later removed in
Matthias Bussonnier
codemirror rempo moved, update links in comments
r17940 // https://github.com/codemirror/CodeMirror/commit/d9c9f1b1ffe984aee41307f3e927f80d1f23590c
Jonathan Frederic
Create ipythongfm mode
r16787
CodeMirror.requireMode('gfm', function(){
CodeMirror.requireMode('stex', function(){
CodeMirror.defineMode("ipythongfm", function(config, parserConfig) {
var gfm_mode = CodeMirror.getMode(config, "gfm");
var tex_mode = CodeMirror.getMode(config, "stex");
return CodeMirror.multiplexingMode(
gfm_mode,
{
open: "$", close: "$",
mode: tex_mode,
delimStyle: "delimit"
},
{
open: "$$", close: "$$",
mode: tex_mode,
delimStyle: "delimit"
},
{
open: "\\(", close: "\\)",
mode: tex_mode,
delimStyle: "delimit"
},
{
open: "\\[", close: "\\]",
mode: tex_mode,
delimStyle: "delimit"
}
// .. more multiplexed styles can follow here
);
}, 'gfm');
CodeMirror.defineMIME("text/x-ipythongfm", "ipythongfm");
});
});