Files
Batflat/inc/jscripts/editor/sets/markdown/set.min.js
2018-03-12 13:23:44 +01:00

1 line
1009 B
JavaScript

var markItUp_markdown={nameSpace:"markItUpSet-markdown",onShiftEnter:{keepDefault:!1,openWith:"\n\n"},onTab:{keepDefault:!1,replaceWith:" "},markupSet:[{key:"1",placeHolder:"H1",closeWith:function(a){return miu.markdownTitle(a,"=")}},{key:"2",placeHolder:"H2",closeWith:function(a){return miu.markdownTitle(a,"-")}},{openWith:"### ",placeHolder:"H3"},{separator:"---------------"},{key:"B",openWith:"**",closeWith:"**"},{key:"I",openWith:"_",closeWith:"_"},{separator:"---------------"},{openWith:"- "},{openWith:function(a){return a.line+". "}},{separator:"---------------"},{key:"P",replaceWith:"![[![Alternative text]!]]([![Url:!:http://]!])"},{key:"L",openWith:"[[![Name]!]",closeWith:"]([![Url:!:http://]!])"},{separator:"---------------"},{openWith:"> "},{openWith:"(!(\t|!|`)!)",closeWith:"(!(`)!)"}],afterInsert:function(a){$(a.textarea).trigger("input")}},miu={markdownTitle:function(a,b){for(heading="",n=$.trim(a.selection||a.placeHolder).length,i=0;i<n;i++)heading+=b;return"\n"+heading+"\n"}};