{"version":3,"sources":["webpack:///./node_modules/simplemde/src/js/simplemde.js","webpack:///./node_modules/simplemde/dist/simplemde.min.css","webpack:///./node_modules/simplemde/src/js/codemirror/tablist.js"],"names":["CodeMirror","CodeMirrorSpellChecker","marked","isMac","test","navigator","platform","bindings","toggleBold","toggleItalic","drawLink","toggleHeadingSmaller","toggleHeadingBigger","drawImage","toggleBlockquote","toggleOrderedList","toggleUnorderedList","toggleCodeBlock","togglePreview","toggleStrikethrough","toggleHeading1","toggleHeading2","toggleHeading3","cleanBlock","drawTable","drawHorizontalRule","undo","redo","toggleSideBySide","toggleFullScreen","shortcuts","fixShortcut","name","replace","createIcon","options","enableTooltips","el","document","createElement","undefined","title","action","actionName","tooltip","f","key","getBindingName","createTootlip","tabIndex","className","createSep","innerHTML","getState","cm","pos","getCursor","stat","getTokenAt","type","data","text","types","split","ret","i","length","bold","getLine","line","quote","italic","strikethrough","code","link","image","match","saved_overflow","editor","codemirror","setOption","getOption","body","style","overflow","wrap","getWrapperElement","previousSibling","toolbarButton","toolbarElements","fullscreen","sidebyside","nextSibling","_toggleBlock","blockStyles","fenceCharsToInsert","fencing_line","styles","indexOf","token_state","token","state","base","code_type","line_num","firstTok","lastTok","getLineHandle","ch","indentedCode","fencedChars","block_start","block_end","lineCount","cur_start","cur_end","tok","is_code","start","slice","end","replaceRange","setSelection","focus","start_text","start_line","end_text","end_line","fence_chars","operation","search_from","next_line","next_line_last_tok","indentLine","no_sel_and_starting_of_line","sel_multi","start_line_sel","end_line_sel","repl_start","repl_end","_replaceSelection","insertFencingAtSelection","_toggleLine","_toggleHeading","lastChild","startPoint","endPoint","_cleanBlock","url","promptURLs","prompt","promptTexts","insertTexts","table","horizontalRule","wrapper","preview","useSideBySideListener","setTimeout","previewNormal","toolbar","toolbar_div","sideBySideRenderingFunction","previewRender","value","on","off","refresh","appendChild","active","startEnd","getSelection","replaceSelection","direction","size","currHeadingLevel","search","substr","repl","map","start_chars","end_chars","join","_mergeProperties","target","source","property","hasOwnProperty","Array","concat","constructor","Object","extend","arguments","wordCount","m","count","charCodeAt","toolbarBuiltInButtons","default","SimpleMDE","parent","this","autoDownloadFA","autoDownloadFontAwesome","styleSheets","href","rel","getElementsByTagName","element","console","log","push","showIcons","status","plainText","markdown","parsingConfig","highlightFormatting","autosave","unique_id","uniqueId","render","initialValue","foundSavedValue","isLocalStorageAvailable","localStorage","setItem","removeItem","e","prototype","markedOptions","renderingConfig","singleLineBreaks","breaks","codeSyntaxHighlighting","window","hljs","highlight","highlightAuto","setOptions","_rendered","mode","backdrop","self","keyMaps","addEventListener","event","keyCode","spellChecker","gitHubSpice","codeMirrorInstance","fromTextArea","theme","tabSize","indentUnit","indentWithTabs","lineNumbers","autofocus","extraKeys","lineWrapping","allowDropFileTypes","placeholder","getAttribute","styleSelectedText","forceSync","save","gui","createToolbar","statusbar","createStatusbar","enabled","sideBySide","createSideBySide","temp_cm","bind","simplemde","form","loaded","getItem","setValue","getElementById","d","Date","hh","getHours","getMinutes","dd","h","autosaveTimeoutId","delay","clearAutosavedValue","parentNode","insertBefore","cScroll","pScroll","v","height","getScrollInfo","clientHeight","ratio","parseFloat","top","move","scrollHeight","scrollTop","onscroll","scrollTo","items","bar","a","check","toolbarData","toolbarGuideIcon","hideIcons","userAgent","vendor","opera","nonSeparatorIconsFollow","x","item","toolbarTips","onclick","preventDefault","cmWrapper","onUpdate","defaultValue","getValue","setAttribute","val","getDoc","isPreviewActive","isSideBySideActive","isFullscreenActive","toTextArea","removeChild","clearTimeout","module","exports","___CSS_LOADER_API_IMPORT___","commands","tabAndIndentMarkdownList","listSelections","head","getStateAfter","list","execCommand","spaces","shiftTabAndUnindentMarkdownList"],"mappings":"8FAEA,IAAIA,EAAa,EAAQ,QACzB,EAAQ,QACR,EAAQ,QACR,EAAQ,QACR,EAAQ,QACR,EAAQ,QACR,EAAQ,QACR,EAAQ,QACR,EAAQ,QACR,EAAQ,QACR,IAAIC,EAAyB,EAAQ,QACjCC,EAAS,EAAQ,QAIjBC,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nE,KAAKiE,IAAIK,YACXrH,EAAQyI,WAAW2C,YAAYrI,KAAKiE,IAAIK,aAI1C1N,EAAGwR,aAEApI,KAAKuF,oBACP+C,aAAatI,KAAKuF,mBAClBvF,KAAKuF,uBAAoBzP,EACzBkK,KAAKyF,wBAIP8C,EAAOC,QAAU1I,G,oDCz+DjB0I,EADkC,EAAQ,OAChCC,EAA4B,IAE9B/H,KAAK,CAAC6H,EAAOhR,EAAI,gsVAAmsV,KAE5tVgR,EAAOC,QAAUA,G,qBCHjB,IAAIlV,EAAa,EAAQ,QAEzBA,EAAWoV,SAASC,yBAA2B,SAAU/R,GACxD,IACIC,EADSD,EAAGgS,iBACC,GAAGC,KAIpB,IAF+B,IADhBjS,EAAGkS,cAAcjS,EAAIc,MACdoR,KAGrBnS,EAAGoS,YAAY,mBAIhB,GAAIpS,EAAGnB,QAAQ6N,eACd1M,EAAGoS,YAAY,iBAEX,CACJ,IAAIC,EAAS/J,MAAMtI,EAAGnB,QAAQ2N,QAAU,GAAGxE,KAAK,KAChDhI,EAAGsH,iBAAiB+K,KAItB3V,EAAWoV,SAASQ,gCAAkC,SAAUtS,GAC/D,IACIC,EADSD,EAAGgS,iBACC,GAAGC,KAIpB,IAF+B,IADhBjS,EAAGkS,cAAcjS,EAAIc,MACdoR,KAGrBnS,EAAGoS,YAAY,mBAIhB,GAAIpS,EAAGnB,QAAQ6N,eACd1M,EAAGoS,YAAY,iBAEX,CACJ,IAAIC,EAAS/J,MAAMtI,EAAGnB,QAAQ2N,QAAU,GAAGxE,KAAK,KAChDhI,EAAGsH,iBAAiB+K","file":"vendor.simplemde.b2f36f2025ec0c004e32.chunk.js","sourcesContent":["/*global require,module*/\n\"use strict\";\nvar CodeMirror = require(\"codemirror\");\nrequire(\"codemirror/addon/edit/continuelist.js\");\nrequire(\"./codemirror/tablist\");\nrequire(\"codemirror/addon/display/fullscreen.js\");\nrequire(\"codemirror/mode/markdown/markdown.js\");\nrequire(\"codemirror/addon/mode/overlay.js\");\nrequire(\"codemirror/addon/display/placeholder.js\");\nrequire(\"codemirror/addon/selection/mark-selection.js\");\nrequire(\"codemirror/mode/gfm/gfm.js\");\nrequire(\"codemirror/mode/xml/xml.js\");\nvar CodeMirrorSpellChecker = require(\"codemirror-spell-checker\");\nvar marked = require(\"marked\");\n\n\n// Some variables\nvar isMac = /Mac/.test(navigator.platform);\n\n// Mapping of actions that can be bound to keyboard shortcuts or toolbar buttons\nvar bindings = {\n\t\"toggleBold\": toggleBold,\n\t\"toggleItalic\": toggleItalic,\n\t\"drawLink\": drawLink,\n\t\"toggleHeadingSmaller\": toggleHeadingSmaller,\n\t\"toggleHeadingBigger\": toggleHeadingBigger,\n\t\"drawImage\": drawImage,\n\t\"toggleBlockquote\": toggleBlockquote,\n\t\"toggleOrderedList\": toggleOrderedList,\n\t\"toggleUnorderedList\": toggleUnorderedList,\n\t\"toggleCodeBlock\": toggleCodeBlock,\n\t\"togglePreview\": togglePreview,\n\t\"toggleStrikethrough\": toggleStrikethrough,\n\t\"toggleHeading1\": toggleHeading1,\n\t\"toggleHeading2\": toggleHeading2,\n\t\"toggleHeading3\": toggleHeading3,\n\t\"cleanBlock\": cleanBlock,\n\t\"drawTable\": drawTable,\n\t\"drawHorizontalRule\": drawHorizontalRule,\n\t\"undo\": undo,\n\t\"redo\": redo,\n\t\"toggleSideBySide\": toggleSideBySide,\n\t\"toggleFullScreen\": toggleFullScreen\n};\n\nvar shortcuts = {\n\t\"toggleBold\": \"Cmd-B\",\n\t\"toggleItalic\": \"Cmd-I\",\n\t\"drawLink\": \"Cmd-K\",\n\t\"toggleHeadingSmaller\": \"Cmd-H\",\n\t\"toggleHeadingBigger\": \"Shift-Cmd-H\",\n\t\"cleanBlock\": \"Cmd-E\",\n\t\"drawImage\": \"Cmd-Alt-I\",\n\t\"toggleBlockquote\": \"Cmd-'\",\n\t\"toggleOrderedList\": \"Cmd-Alt-L\",\n\t\"toggleUnorderedList\": \"Cmd-L\",\n\t\"toggleCodeBlock\": \"Cmd-Alt-C\",\n\t\"togglePreview\": \"Cmd-P\",\n\t\"toggleSideBySide\": \"F9\",\n\t\"toggleFullScreen\": \"F11\"\n};\n\nvar getBindingName = function(f) {\n\tfor(var key in bindings) {\n\t\tif(bindings[key] === f) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn null;\n};\n\nvar isMobile = function() {\n\tvar check = false;\n\t(function(a) {\n\t\tif(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) check = true;\n\t})(navigator.userAgent || navigator.vendor || window.opera);\n\treturn check;\n};\n\n\n/**\n * Fix shortcut. Mac use Command, others use Ctrl.\n */\nfunction fixShortcut(name) {\n\tif(isMac) {\n\t\tname = name.replace(\"Ctrl\", \"Cmd\");\n\t} else {\n\t\tname = name.replace(\"Cmd\", \"Ctrl\");\n\t}\n\treturn name;\n}\n\n\n/**\n * Create icon element for toolbar.\n */\nfunction createIcon(options, enableTooltips, shortcuts) {\n\toptions = options || {};\n\tvar el = document.createElement(\"a\");\n\tenableTooltips = (enableTooltips == undefined) ? true : enableTooltips;\n\n\tif(options.title && enableTooltips) {\n\t\tel.title = createTootlip(options.title, options.action, shortcuts);\n\n\t\tif(isMac) {\n\t\t\tel.title = el.title.replace(\"Ctrl\", \"⌘\");\n\t\t\tel.title = el.title.replace(\"Alt\", \"⌥\");\n\t\t}\n\t}\n\n\tel.tabIndex = -1;\n\tel.className = options.className;\n\treturn el;\n}\n\nfunction createSep() {\n\tvar el = document.createElement(\"i\");\n\tel.className = \"separator\";\n\tel.innerHTML = \"|\";\n\treturn el;\n}\n\nfunction createTootlip(title, action, shortcuts) {\n\tvar actionName;\n\tvar tooltip = title;\n\n\tif(action) {\n\t\tactionName = getBindingName(action);\n\t\tif(shortcuts[actionName]) {\n\t\t\ttooltip += \" (\" + fixShortcut(shortcuts[actionName]) + \")\";\n\t\t}\n\t}\n\n\treturn tooltip;\n}\n\n/**\n * The state of CodeMirror at the given position.\n */\nfunction getState(cm, pos) {\n\tpos = pos || cm.getCursor(\"start\");\n\tvar stat = cm.getTokenAt(pos);\n\tif(!stat.type) return {};\n\n\tvar types = stat.type.split(\" \");\n\n\tvar ret = {},\n\t\tdata, text;\n\tfor(var i = 0; i < types.length; i++) {\n\t\tdata = types[i];\n\t\tif(data === \"strong\") {\n\t\t\tret.bold = true;\n\t\t} else if(data === \"variable-2\") {\n\t\t\ttext = cm.getLine(pos.line);\n\t\t\tif(/^\\s*\\d+\\.\\s/.test(text)) {\n\t\t\t\tret[\"ordered-list\"] = true;\n\t\t\t} else {\n\t\t\t\tret[\"unordered-list\"] = true;\n\t\t\t}\n\t\t} else if(data === \"atom\") {\n\t\t\tret.quote = true;\n\t\t} else if(data === \"em\") {\n\t\t\tret.italic = true;\n\t\t} else if(data === \"quote\") {\n\t\t\tret.quote = true;\n\t\t} else if(data === \"strikethrough\") {\n\t\t\tret.strikethrough = true;\n\t\t} else if(data === \"comment\") {\n\t\t\tret.code = true;\n\t\t} else if(data === \"link\") {\n\t\t\tret.link = true;\n\t\t} else if(data === \"tag\") {\n\t\t\tret.image = true;\n\t\t} else if(data.match(/^header(\\-[1-6])?$/)) {\n\t\t\tret[data.replace(\"header\", \"heading\")] = true;\n\t\t}\n\t}\n\treturn ret;\n}\n\n\n// Saved overflow setting\nvar saved_overflow = \"\";\n\n/**\n * Toggle full screen of the editor.\n */\nfunction toggleFullScreen(editor) {\n\t// Set fullscreen\n\tvar cm = editor.codemirror;\n\tcm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n\n\n\t// Prevent scrolling on body during fullscreen active\n\tif(cm.getOption(\"fullScreen\")) {\n\t\tsaved_overflow = document.body.style.overflow;\n\t\tdocument.body.style.overflow = \"hidden\";\n\t} else {\n\t\tdocument.body.style.overflow = saved_overflow;\n\t}\n\n\n\t// Update toolbar class\n\tvar wrap = cm.getWrapperElement();\n\n\tif(!/fullscreen/.test(wrap.previousSibling.className)) {\n\t\twrap.previousSibling.className += \" fullscreen\";\n\t} else {\n\t\twrap.previousSibling.className = wrap.previousSibling.className.replace(/\\s*fullscreen\\b/, \"\");\n\t}\n\n\n\t// Update toolbar button\n\tvar toolbarButton = editor.toolbarElements.fullscreen;\n\n\tif(!/active/.test(toolbarButton.className)) {\n\t\ttoolbarButton.className += \" active\";\n\t} else {\n\t\ttoolbarButton.className = toolbarButton.className.replace(/\\s*active\\s*/g, \"\");\n\t}\n\n\n\t// Hide side by side if needed\n\tvar sidebyside = cm.getWrapperElement().nextSibling;\n\tif(/editor-preview-active-side/.test(sidebyside.className))\n\t\ttoggleSideBySide(editor);\n}\n\n\n/**\n * Action for toggling bold.\n */\nfunction toggleBold(editor) {\n\t_toggleBlock(editor, \"bold\", editor.options.blockStyles.bold);\n}\n\n\n/**\n * Action for toggling italic.\n */\nfunction toggleItalic(editor) {\n\t_toggleBlock(editor, \"italic\", editor.options.blockStyles.italic);\n}\n\n\n/**\n * Action for toggling strikethrough.\n */\nfunction toggleStrikethrough(editor) {\n\t_toggleBlock(editor, \"strikethrough\", \"~~\");\n}\n\n/**\n * Action for toggling code block.\n */\nfunction toggleCodeBlock(editor) {\n\tvar fenceCharsToInsert = editor.options.blockStyles.code;\n\n\tfunction fencing_line(line) {\n\t\t/* return true, if this is a ``` or ~~~ line */\n\t\tif(typeof line !== \"object\") {\n\t\t\tthrow \"fencing_line() takes a 'line' object (not a line number, or line text). Got: \" + typeof line + \": \" + line;\n\t\t}\n\t\treturn line.styles && line.styles[2] && line.styles[2].indexOf(\"formatting-code-block\") !== -1;\n\t}\n\n\tfunction token_state(token) {\n\t\t// base goes an extra level deep when mode backdrops are used, e.g. spellchecker on\n\t\treturn token.state.base.base || token.state.base;\n\t}\n\n\tfunction code_type(cm, line_num, line, firstTok, lastTok) {\n\t\t/*\n\t\t * Return \"single\", \"indented\", \"fenced\" or false\n\t\t *\n\t\t * cm and line_num are required. Others are optional for efficiency\n\t\t * To check in the middle of a line, pass in firstTok yourself.\n\t\t */\n\t\tline = line || cm.getLineHandle(line_num);\n\t\tfirstTok = firstTok || cm.getTokenAt({\n\t\t\tline: line_num,\n\t\t\tch: 1\n\t\t});\n\t\tlastTok = lastTok || (!!line.text && cm.getTokenAt({\n\t\t\tline: line_num,\n\t\t\tch: line.text.length - 1\n\t\t}));\n\t\tvar types = firstTok.type ? firstTok.type.split(\" \") : [];\n\t\tif(lastTok && token_state(lastTok).indentedCode) {\n\t\t\t// have to check last char, since first chars of first line aren\"t marked as indented\n\t\t\treturn \"indented\";\n\t\t} else if(types.indexOf(\"comment\") === -1) {\n\t\t\t// has to be after \"indented\" check, since first chars of first indented line aren\"t marked as such\n\t\t\treturn false;\n\t\t} else if(token_state(firstTok).fencedChars || token_state(lastTok).fencedChars || fencing_line(line)) {\n\t\t\treturn \"fenced\";\n\t\t} else {\n\t\t\treturn \"single\";\n\t\t}\n\t}\n\n\tfunction insertFencingAtSelection(cm, cur_start, cur_end, fenceCharsToInsert) {\n\t\tvar start_line_sel = cur_start.line + 1,\n\t\t\tend_line_sel = cur_end.line + 1,\n\t\t\tsel_multi = cur_start.line !== cur_end.line,\n\t\t\trepl_start = fenceCharsToInsert + \"\\n\",\n\t\t\trepl_end = \"\\n\" + fenceCharsToInsert;\n\t\tif(sel_multi) {\n\t\t\tend_line_sel++;\n\t\t}\n\t\t// handle last char including \\n or not\n\t\tif(sel_multi && cur_end.ch === 0) {\n\t\t\trepl_end = fenceCharsToInsert + \"\\n\";\n\t\t\tend_line_sel--;\n\t\t}\n\t\t_replaceSelection(cm, false, [repl_start, repl_end]);\n\t\tcm.setSelection({\n\t\t\tline: start_line_sel,\n\t\t\tch: 0\n\t\t}, {\n\t\t\tline: end_line_sel,\n\t\t\tch: 0\n\t\t});\n\t}\n\n\tvar cm = editor.codemirror,\n\t\tcur_start = cm.getCursor(\"start\"),\n\t\tcur_end = cm.getCursor(\"end\"),\n\t\ttok = cm.getTokenAt({\n\t\t\tline: cur_start.line,\n\t\t\tch: cur_start.ch || 1\n\t\t}), // avoid ch 0 which is a cursor pos but not token\n\t\tline = cm.getLineHandle(cur_start.line),\n\t\tis_code = code_type(cm, cur_start.line, line, tok);\n\tvar block_start, block_end, lineCount;\n\n\tif(is_code === \"single\") {\n\t\t// similar to some SimpleMDE _toggleBlock logic\n\t\tvar start = line.text.slice(0, cur_start.ch).replace(\"`\", \"\"),\n\t\t\tend = line.text.slice(cur_start.ch).replace(\"`\", \"\");\n\t\tcm.replaceRange(start + end, {\n\t\t\tline: cur_start.line,\n\t\t\tch: 0\n\t\t}, {\n\t\t\tline: cur_start.line,\n\t\t\tch: 99999999999999\n\t\t});\n\t\tcur_start.ch--;\n\t\tif(cur_start !== cur_end) {\n\t\t\tcur_end.ch--;\n\t\t}\n\t\tcm.setSelection(cur_start, cur_end);\n\t\tcm.focus();\n\t} else if(is_code === \"fenced\") {\n\t\tif(cur_start.line !== cur_end.line || cur_start.ch !== cur_end.ch) {\n\t\t\t// use selection\n\n\t\t\t// find the fenced line so we know what type it is (tilde, backticks, number of them)\n\t\t\tfor(block_start = cur_start.line; block_start >= 0; block_start--) {\n\t\t\t\tline = cm.getLineHandle(block_start);\n\t\t\t\tif(fencing_line(line)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar fencedTok = cm.getTokenAt({\n\t\t\t\tline: block_start,\n\t\t\t\tch: 1\n\t\t\t});\n\t\t\tvar fence_chars = token_state(fencedTok).fencedChars;\n\t\t\tvar start_text, start_line;\n\t\t\tvar end_text, end_line;\n\t\t\t// check for selection going up against fenced lines, in which case we don't want to add more fencing\n\t\t\tif(fencing_line(cm.getLineHandle(cur_start.line))) {\n\t\t\t\tstart_text = \"\";\n\t\t\t\tstart_line = cur_start.line;\n\t\t\t} else if(fencing_line(cm.getLineHandle(cur_start.line - 1))) {\n\t\t\t\tstart_text = \"\";\n\t\t\t\tstart_line = cur_start.line - 1;\n\t\t\t} else {\n\t\t\t\tstart_text = fence_chars + \"\\n\";\n\t\t\t\tstart_line = cur_start.line;\n\t\t\t}\n\t\t\tif(fencing_line(cm.getLineHandle(cur_end.line))) {\n\t\t\t\tend_text = \"\";\n\t\t\t\tend_line = cur_end.line;\n\t\t\t\tif(cur_end.ch === 0) {\n\t\t\t\t\tend_line += 1;\n\t\t\t\t}\n\t\t\t} else if(cur_end.ch !== 0 && fencing_line(cm.getLineHandle(cur_end.line + 1))) {\n\t\t\t\tend_text = \"\";\n\t\t\t\tend_line = cur_end.line + 1;\n\t\t\t} else {\n\t\t\t\tend_text = fence_chars + \"\\n\";\n\t\t\t\tend_line = cur_end.line + 1;\n\t\t\t}\n\t\t\tif(cur_end.ch === 0) {\n\t\t\t\t// full last line selected, putting cursor at beginning of next\n\t\t\t\tend_line -= 1;\n\t\t\t}\n\t\t\tcm.operation(function() {\n\t\t\t\t// end line first, so that line numbers don't change\n\t\t\t\tcm.replaceRange(end_text, {\n\t\t\t\t\tline: end_line,\n\t\t\t\t\tch: 0\n\t\t\t\t}, {\n\t\t\t\t\tline: end_line + (end_text ? 0 : 1),\n\t\t\t\t\tch: 0\n\t\t\t\t});\n\t\t\t\tcm.replaceRange(start_text, {\n\t\t\t\t\tline: start_line,\n\t\t\t\t\tch: 0\n\t\t\t\t}, {\n\t\t\t\t\tline: start_line + (start_text ? 0 : 1),\n\t\t\t\t\tch: 0\n\t\t\t\t});\n\t\t\t});\n\t\t\tcm.setSelection({\n\t\t\t\tline: start_line + (start_text ? 1 : 0),\n\t\t\t\tch: 0\n\t\t\t}, {\n\t\t\t\tline: end_line + (start_text ? 1 : -1),\n\t\t\t\tch: 0\n\t\t\t});\n\t\t\tcm.focus();\n\t\t} else {\n\t\t\t// no selection, search for ends of this fenced block\n\t\t\tvar search_from = cur_start.line;\n\t\t\tif(fencing_line(cm.getLineHandle(cur_start.line))) { // gets a little tricky if cursor is right on a fenced line\n\t\t\t\tif(code_type(cm, cur_start.line + 1) === \"fenced\") {\n\t\t\t\t\tblock_start = cur_start.line;\n\t\t\t\t\tsearch_from = cur_start.line + 1; // for searching for \"end\"\n\t\t\t\t} else {\n\t\t\t\t\tblock_end = cur_start.line;\n\t\t\t\t\tsearch_from = cur_start.line - 1; // for searching for \"start\"\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(block_start === undefined) {\n\t\t\t\tfor(block_start = search_from; block_start >= 0; block_start--) {\n\t\t\t\t\tline = cm.getLineHandle(block_start);\n\t\t\t\t\tif(fencing_line(line)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(block_end === undefined) {\n\t\t\t\tlineCount = cm.lineCount();\n\t\t\t\tfor(block_end = search_from; block_end < lineCount; block_end++) {\n\t\t\t\t\tline = cm.getLineHandle(block_end);\n\t\t\t\t\tif(fencing_line(line)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcm.operation(function() {\n\t\t\t\tcm.replaceRange(\"\", {\n\t\t\t\t\tline: block_start,\n\t\t\t\t\tch: 0\n\t\t\t\t}, {\n\t\t\t\t\tline: block_start + 1,\n\t\t\t\t\tch: 0\n\t\t\t\t});\n\t\t\t\tcm.replaceRange(\"\", {\n\t\t\t\t\tline: block_end - 1,\n\t\t\t\t\tch: 0\n\t\t\t\t}, {\n\t\t\t\t\tline: block_end,\n\t\t\t\t\tch: 0\n\t\t\t\t});\n\t\t\t});\n\t\t\tcm.focus();\n\t\t}\n\t} else if(is_code === \"indented\") {\n\t\tif(cur_start.line !== cur_end.line || cur_start.ch !== cur_end.ch) {\n\t\t\t// use selection\n\t\t\tblock_start = cur_start.line;\n\t\t\tblock_end = cur_end.line;\n\t\t\tif(cur_end.ch === 0) {\n\t\t\t\tblock_end--;\n\t\t\t}\n\t\t} else {\n\t\t\t// no selection, search for ends of this indented block\n\t\t\tfor(block_start = cur_start.line; block_start >= 0; block_start--) {\n\t\t\t\tline = cm.getLineHandle(block_start);\n\t\t\t\tif(line.text.match(/^\\s*$/)) {\n\t\t\t\t\t// empty or all whitespace - keep going\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tif(code_type(cm, block_start, line) !== \"indented\") {\n\t\t\t\t\t\tblock_start += 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlineCount = cm.lineCount();\n\t\t\tfor(block_end = cur_start.line; block_end < lineCount; block_end++) {\n\t\t\t\tline = cm.getLineHandle(block_end);\n\t\t\t\tif(line.text.match(/^\\s*$/)) {\n\t\t\t\t\t// empty or all whitespace - keep going\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tif(code_type(cm, block_end, line) !== \"indented\") {\n\t\t\t\t\t\tblock_end -= 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// if we are going to un-indent based on a selected set of lines, and the next line is indented too, we need to\n\t\t// insert a blank line so that the next line(s) continue to be indented code\n\t\tvar next_line = cm.getLineHandle(block_end + 1),\n\t\t\tnext_line_last_tok = next_line && cm.getTokenAt({\n\t\t\t\tline: block_end + 1,\n\t\t\t\tch: next_line.text.length - 1\n\t\t\t}),\n\t\t\tnext_line_indented = next_line_last_tok && token_state(next_line_last_tok).indentedCode;\n\t\tif(next_line_indented) {\n\t\t\tcm.replaceRange(\"\\n\", {\n\t\t\t\tline: block_end + 1,\n\t\t\t\tch: 0\n\t\t\t});\n\t\t}\n\n\t\tfor(var i = block_start; i <= block_end; i++) {\n\t\t\tcm.indentLine(i, \"subtract\"); // TODO: this doesn't get tracked in the history, so can't be undone :(\n\t\t}\n\t\tcm.focus();\n\t} else {\n\t\t// insert code formatting\n\t\tvar no_sel_and_starting_of_line = (cur_start.line === cur_end.line && cur_start.ch === cur_end.ch && cur_start.ch === 0);\n\t\tvar sel_multi = cur_start.line !== cur_end.line;\n\t\tif(no_sel_and_starting_of_line || sel_multi) {\n\t\t\tinsertFencingAtSelection(cm, cur_start, cur_end, fenceCharsToInsert);\n\t\t} else {\n\t\t\t_replaceSelection(cm, false, [\"`\", \"`\"]);\n\t\t}\n\t}\n}\n\n/**\n * Action for toggling blockquote.\n */\nfunction toggleBlockquote(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleLine(cm, \"quote\");\n}\n\n/**\n * Action for toggling heading size: normal -> h1 -> h2 -> h3 -> h4 -> h5 -> h6 -> normal\n */\nfunction toggleHeadingSmaller(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"smaller\");\n}\n\n/**\n * Action for toggling heading size: normal -> h6 -> h5 -> h4 -> h3 -> h2 -> h1 -> normal\n */\nfunction toggleHeadingBigger(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"bigger\");\n}\n\n/**\n * Action for toggling heading size 1\n */\nfunction toggleHeading1(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, undefined, 1);\n}\n\n/**\n * Action for toggling heading size 2\n */\nfunction toggleHeading2(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, undefined, 2);\n}\n\n/**\n * Action for toggling heading size 3\n */\nfunction toggleHeading3(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, undefined, 3);\n}\n\n\n/**\n * Action for toggling ul.\n */\nfunction toggleUnorderedList(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleLine(cm, \"unordered-list\");\n}\n\n\n/**\n * Action for toggling ol.\n */\nfunction toggleOrderedList(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleLine(cm, \"ordered-list\");\n}\n\n/**\n * Action for clean block (remove headline, list, blockquote code, markers)\n */\nfunction cleanBlock(editor) {\n\tvar cm = editor.codemirror;\n\t_cleanBlock(cm);\n}\n\n/**\n * Action for drawing a link.\n */\nfunction drawLink(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.link);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.link, options.insertTexts.link, url);\n}\n\n/**\n * Action for drawing an img.\n */\nfunction drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options.insertTexts.image, url);\n}\n\n/**\n * Action for drawing a table.\n */\nfunction drawTable(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.table, options.insertTexts.table);\n}\n\n/**\n * Action for drawing a horizontal rule.\n */\nfunction drawHorizontalRule(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n}\n\n\n/**\n * Undo action.\n */\nfunction undo(editor) {\n\tvar cm = editor.codemirror;\n\tcm.undo();\n\tcm.focus();\n}\n\n\n/**\n * Redo action.\n */\nfunction redo(editor) {\n\tvar cm = editor.codemirror;\n\tcm.redo();\n\tcm.focus();\n}\n\n\n/**\n * Toggle side by side preview\n */\nfunction toggleSideBySide(editor) {\n\tvar cm = editor.codemirror;\n\tvar wrapper = cm.getWrapperElement();\n\tvar preview = wrapper.nextSibling;\n\tvar toolbarButton = editor.toolbarElements[\"side-by-side\"];\n\tvar useSideBySideListener = false;\n\tif(/editor-preview-active-side/.test(preview.className)) {\n\t\tpreview.className = preview.className.replace(\n\t\t\t/\\s*editor-preview-active-side\\s*/g, \"\"\n\t\t);\n\t\ttoolbarButton.className = toolbarButton.className.replace(/\\s*active\\s*/g, \"\");\n\t\twrapper.className = wrapper.className.replace(/\\s*CodeMirror-sided\\s*/g, \" \");\n\t} else {\n\t\t// When the preview button is clicked for the first time,\n\t\t// give some time for the transition from editor.css to fire and the view to slide from right to left,\n\t\t// instead of just appearing.\n\t\tsetTimeout(function() {\n\t\t\tif(!cm.getOption(\"fullScreen\"))\n\t\t\t\ttoggleFullScreen(editor);\n\t\t\tpreview.className += \" editor-preview-active-side\";\n\t\t}, 1);\n\t\ttoolbarButton.className += \" active\";\n\t\twrapper.className += \" CodeMirror-sided\";\n\t\tuseSideBySideListener = true;\n\t}\n\n\t// Hide normal preview if active\n\tvar previewNormal = wrapper.lastChild;\n\tif(/editor-preview-active/.test(previewNormal.className)) {\n\t\tpreviewNormal.className = previewNormal.className.replace(\n\t\t\t/\\s*editor-preview-active\\s*/g, \"\"\n\t\t);\n\t\tvar toolbar = editor.toolbarElements.preview;\n\t\tvar toolbar_div = wrapper.previousSibling;\n\t\ttoolbar.className = toolbar.className.replace(/\\s*active\\s*/g, \"\");\n\t\ttoolbar_div.className = toolbar_div.className.replace(/\\s*disabled-for-preview*/g, \"\");\n\t}\n\n\tvar sideBySideRenderingFunction = function() {\n\t\tpreview.innerHTML = editor.options.previewRender(editor.value(), preview);\n\t};\n\n\tif(!cm.sideBySideRenderingFunction) {\n\t\tcm.sideBySideRenderingFunction = sideBySideRenderingFunction;\n\t}\n\n\tif(useSideBySideListener) {\n\t\tpreview.innerHTML = editor.options.previewRender(editor.value(), preview);\n\t\tcm.on(\"update\", cm.sideBySideRenderingFunction);\n\t} else {\n\t\tcm.off(\"update\", cm.sideBySideRenderingFunction);\n\t}\n\n\t// Refresh to fix selection being off (#309)\n\tcm.refresh();\n}\n\n\n/**\n * Preview action.\n */\nfunction togglePreview(editor) {\n\tvar cm = editor.codemirror;\n\tvar wrapper = cm.getWrapperElement();\n\tvar toolbar_div = wrapper.previousSibling;\n\tvar toolbar = editor.options.toolbar ? editor.toolbarElements.preview : false;\n\tvar preview = wrapper.lastChild;\n\tif(!preview || !/editor-preview/.test(preview.className)) {\n\t\tpreview = document.createElement(\"div\");\n\t\tpreview.className = \"editor-preview\";\n\t\twrapper.appendChild(preview);\n\t}\n\tif(/editor-preview-active/.test(preview.className)) {\n\t\tpreview.className = preview.className.replace(\n\t\t\t/\\s*editor-preview-active\\s*/g, \"\"\n\t\t);\n\t\tif(toolbar) {\n\t\t\ttoolbar.className = toolbar.className.replace(/\\s*active\\s*/g, \"\");\n\t\t\ttoolbar_div.className = toolbar_div.className.replace(/\\s*disabled-for-preview*/g, \"\");\n\t\t}\n\t} else {\n\t\t// When the preview button is clicked for the first time,\n\t\t// give some time for the transition from editor.css to fire and the view to slide from right to left,\n\t\t// instead of just appearing.\n\t\tsetTimeout(function() {\n\t\t\tpreview.className += \" editor-preview-active\";\n\t\t}, 1);\n\t\tif(toolbar) {\n\t\t\ttoolbar.className += \" active\";\n\t\t\ttoolbar_div.className += \" disabled-for-preview\";\n\t\t}\n\t}\n\tpreview.innerHTML = editor.options.previewRender(editor.value(), preview);\n\n\t// Turn off side by side if needed\n\tvar sidebyside = cm.getWrapperElement().nextSibling;\n\tif(/editor-preview-active-side/.test(sidebyside.className))\n\t\ttoggleSideBySide(editor);\n}\n\nfunction _replaceSelection(cm, active, startEnd, url) {\n\tif(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))\n\t\treturn;\n\n\tvar text;\n\tvar start = startEnd[0];\n\tvar end = startEnd[1];\n\tvar startPoint = cm.getCursor(\"start\");\n\tvar endPoint = cm.getCursor(\"end\");\n\tif(url) {\n\t\tend = end.replace(\"#url#\", url);\n\t}\n\tif(active) {\n\t\ttext = cm.getLine(startPoint.line);\n\t\tstart = text.slice(0, startPoint.ch);\n\t\tend = text.slice(startPoint.ch);\n\t\tcm.replaceRange(start + end, {\n\t\t\tline: startPoint.line,\n\t\t\tch: 0\n\t\t});\n\t} else {\n\t\ttext = cm.getSelection();\n\t\tcm.replaceSelection(start + text + end);\n\n\t\tstartPoint.ch += start.length;\n\t\tif(startPoint !== endPoint) {\n\t\t\tendPoint.ch += start.length;\n\t\t}\n\t}\n\tcm.setSelection(startPoint, endPoint);\n\tcm.focus();\n}\n\n\nfunction _toggleHeading(cm, direction, size) {\n\tif(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))\n\t\treturn;\n\n\tvar startPoint = cm.getCursor(\"start\");\n\tvar endPoint = cm.getCursor(\"end\");\n\tfor(var i = startPoint.line; i <= endPoint.line; i++) {\n\t\t(function(i) {\n\t\t\tvar text = cm.getLine(i);\n\t\t\tvar currHeadingLevel = text.search(/[^#]/);\n\n\t\t\tif(direction !== undefined) {\n\t\t\t\tif(currHeadingLevel <= 0) {\n\t\t\t\t\tif(direction == \"bigger\") {\n\t\t\t\t\t\ttext = \"###### \" + text;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext = \"# \" + text;\n\t\t\t\t\t}\n\t\t\t\t} else if(currHeadingLevel == 6 && direction == \"smaller\") {\n\t\t\t\t\ttext = text.substr(7);\n\t\t\t\t} else if(currHeadingLevel == 1 && direction == \"bigger\") {\n\t\t\t\t\ttext = text.substr(2);\n\t\t\t\t} else {\n\t\t\t\t\tif(direction == \"bigger\") {\n\t\t\t\t\t\ttext = text.substr(1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext = \"#\" + text;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(size == 1) {\n\t\t\t\t\tif(currHeadingLevel <= 0) {\n\t\t\t\t\t\ttext = \"# \" + text;\n\t\t\t\t\t} else if(currHeadingLevel == size) {\n\t\t\t\t\t\ttext = text.substr(currHeadingLevel + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext = \"# \" + text.substr(currHeadingLevel + 1);\n\t\t\t\t\t}\n\t\t\t\t} else if(size == 2) {\n\t\t\t\t\tif(currHeadingLevel <= 0) {\n\t\t\t\t\t\ttext = \"## \" + text;\n\t\t\t\t\t} else if(currHeadingLevel == size) {\n\t\t\t\t\t\ttext = text.substr(currHeadingLevel + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext = \"## \" + text.substr(currHeadingLevel + 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(currHeadingLevel <= 0) {\n\t\t\t\t\t\ttext = \"### \" + text;\n\t\t\t\t\t} else if(currHeadingLevel == size) {\n\t\t\t\t\t\ttext = text.substr(currHeadingLevel + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext = \"### \" + text.substr(currHeadingLevel + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcm.replaceRange(text, {\n\t\t\t\tline: i,\n\t\t\t\tch: 0\n\t\t\t}, {\n\t\t\t\tline: i,\n\t\t\t\tch: 99999999999999\n\t\t\t});\n\t\t})(i);\n\t}\n\tcm.focus();\n}\n\n\nfunction _toggleLine(cm, name) {\n\tif(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))\n\t\treturn;\n\n\tvar stat = getState(cm);\n\tvar startPoint = cm.getCursor(\"start\");\n\tvar endPoint = cm.getCursor(\"end\");\n\tvar repl = {\n\t\t\"quote\": /^(\\s*)\\>\\s+/,\n\t\t\"unordered-list\": /^(\\s*)(\\*|\\-|\\+)\\s+/,\n\t\t\"ordered-list\": /^(\\s*)\\d+\\.\\s+/\n\t};\n\tvar map = {\n\t\t\"quote\": \"> \",\n\t\t\"unordered-list\": \"* \",\n\t\t\"ordered-list\": \"1. \"\n\t};\n\tfor(var i = startPoint.line; i <= endPoint.line; i++) {\n\t\t(function(i) {\n\t\t\tvar text = cm.getLine(i);\n\t\t\tif(stat[name]) {\n\t\t\t\ttext = text.replace(repl[name], \"$1\");\n\t\t\t} else {\n\t\t\t\ttext = map[name] + text;\n\t\t\t}\n\t\t\tcm.replaceRange(text, {\n\t\t\t\tline: i,\n\t\t\t\tch: 0\n\t\t\t}, {\n\t\t\t\tline: i,\n\t\t\t\tch: 99999999999999\n\t\t\t});\n\t\t})(i);\n\t}\n\tcm.focus();\n}\n\nfunction _toggleBlock(editor, type, start_chars, end_chars) {\n\tif(/editor-preview-active/.test(editor.codemirror.getWrapperElement().lastChild.className))\n\t\treturn;\n\n\tend_chars = (typeof end_chars === \"undefined\") ? start_chars : end_chars;\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\n\tvar text;\n\tvar start = start_chars;\n\tvar end = end_chars;\n\n\tvar startPoint = cm.getCursor(\"start\");\n\tvar endPoint = cm.getCursor(\"end\");\n\n\tif(stat[type]) {\n\t\ttext = cm.getLine(startPoint.line);\n\t\tstart = text.slice(0, startPoint.ch);\n\t\tend = text.slice(startPoint.ch);\n\t\tif(type == \"bold\") {\n\t\t\tstart = start.replace(/(\\*\\*|__)(?![\\s\\S]*(\\*\\*|__))/, \"\");\n\t\t\tend = end.replace(/(\\*\\*|__)/, \"\");\n\t\t} else if(type == \"italic\") {\n\t\t\tstart = start.replace(/(\\*|_)(?![\\s\\S]*(\\*|_))/, \"\");\n\t\t\tend = end.replace(/(\\*|_)/, \"\");\n\t\t} else if(type == \"strikethrough\") {\n\t\t\tstart = start.replace(/(\\*\\*|~~)(?![\\s\\S]*(\\*\\*|~~))/, \"\");\n\t\t\tend = end.replace(/(\\*\\*|~~)/, \"\");\n\t\t}\n\t\tcm.replaceRange(start + end, {\n\t\t\tline: startPoint.line,\n\t\t\tch: 0\n\t\t}, {\n\t\t\tline: startPoint.line,\n\t\t\tch: 99999999999999\n\t\t});\n\n\t\tif(type == \"bold\" || type == \"strikethrough\") {\n\t\t\tstartPoint.ch -= 2;\n\t\t\tif(startPoint !== endPoint) {\n\t\t\t\tendPoint.ch -= 2;\n\t\t\t}\n\t\t} else if(type == \"italic\") {\n\t\t\tstartPoint.ch -= 1;\n\t\t\tif(startPoint !== endPoint) {\n\t\t\t\tendPoint.ch -= 1;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ttext = cm.getSelection();\n\t\tif(type == \"bold\") {\n\t\t\ttext = text.split(\"**\").join(\"\");\n\t\t\ttext = text.split(\"__\").join(\"\");\n\t\t} else if(type == \"italic\") {\n\t\t\ttext = text.split(\"*\").join(\"\");\n\t\t\ttext = text.split(\"_\").join(\"\");\n\t\t} else if(type == \"strikethrough\") {\n\t\t\ttext = text.split(\"~~\").join(\"\");\n\t\t}\n\t\tcm.replaceSelection(start + text + end);\n\n\t\tstartPoint.ch += start_chars.length;\n\t\tendPoint.ch = startPoint.ch + text.length;\n\t}\n\n\tcm.setSelection(startPoint, endPoint);\n\tcm.focus();\n}\n\nfunction _cleanBlock(cm) {\n\tif(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))\n\t\treturn;\n\n\tvar startPoint = cm.getCursor(\"start\");\n\tvar endPoint = cm.getCursor(\"end\");\n\tvar text;\n\n\tfor(var line = startPoint.line; line <= endPoint.line; line++) {\n\t\ttext = cm.getLine(line);\n\t\ttext = text.replace(/^[ ]*([# ]+|\\*|\\-|[> ]+|[0-9]+(.|\\)))[ ]*/, \"\");\n\n\t\tcm.replaceRange(text, {\n\t\t\tline: line,\n\t\t\tch: 0\n\t\t}, {\n\t\t\tline: line,\n\t\t\tch: 99999999999999\n\t\t});\n\t}\n}\n\n// Merge the properties of one object into another.\nfunction _mergeProperties(target, source) {\n\tfor(var property in source) {\n\t\tif(source.hasOwnProperty(property)) {\n\t\t\tif(source[property] instanceof Array) {\n\t\t\t\ttarget[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n\t\t\t} else if(\n\t\t\t\tsource[property] !== null &&\n\t\t\t\ttypeof source[property] === \"object\" &&\n\t\t\t\tsource[property].constructor === Object\n\t\t\t) {\n\t\t\t\ttarget[property] = _mergeProperties(target[property] || {}, source[property]);\n\t\t\t} else {\n\t\t\t\ttarget[property] = source[property];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n}\n\n// Merge an arbitrary number of objects into one.\nfunction extend(target) {\n\tfor(var i = 1; i < arguments.length; i++) {\n\t\ttarget = _mergeProperties(target, arguments[i]);\n\t}\n\n\treturn target;\n}\n\n/* The right word count in respect for CJK. */\nfunction wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}\n\nvar toolbarBuiltInButtons = {\n\t\"bold\": {\n\t\tname: \"bold\",\n\t\taction: toggleBold,\n\t\tclassName: \"fa fa-bold\",\n\t\ttitle: \"Bold\",\n\t\tdefault: true\n\t},\n\t\"italic\": {\n\t\tname: \"italic\",\n\t\taction: toggleItalic,\n\t\tclassName: \"fa fa-italic\",\n\t\ttitle: \"Italic\",\n\t\tdefault: true\n\t},\n\t\"strikethrough\": {\n\t\tname: \"strikethrough\",\n\t\taction: toggleStrikethrough,\n\t\tclassName: \"fa fa-strikethrough\",\n\t\ttitle: \"Strikethrough\"\n\t},\n\t\"heading\": {\n\t\tname: \"heading\",\n\t\taction: toggleHeadingSmaller,\n\t\tclassName: \"fa fa-header\",\n\t\ttitle: \"Heading\",\n\t\tdefault: true\n\t},\n\t\"heading-smaller\": {\n\t\tname: \"heading-smaller\",\n\t\taction: toggleHeadingSmaller,\n\t\tclassName: \"fa fa-header fa-header-x fa-header-smaller\",\n\t\ttitle: \"Smaller Heading\"\n\t},\n\t\"heading-bigger\": {\n\t\tname: \"heading-bigger\",\n\t\taction: toggleHeadingBigger,\n\t\tclassName: \"fa fa-header fa-header-x fa-header-bigger\",\n\t\ttitle: \"Bigger Heading\"\n\t},\n\t\"heading-1\": {\n\t\tname: \"heading-1\",\n\t\taction: toggleHeading1,\n\t\tclassName: \"fa fa-header fa-header-x fa-header-1\",\n\t\ttitle: \"Big Heading\"\n\t},\n\t\"heading-2\": {\n\t\tname: \"heading-2\",\n\t\taction: toggleHeading2,\n\t\tclassName: \"fa fa-header fa-header-x fa-header-2\",\n\t\ttitle: \"Medium Heading\"\n\t},\n\t\"heading-3\": {\n\t\tname: \"heading-3\",\n\t\taction: toggleHeading3,\n\t\tclassName: \"fa fa-header fa-header-x fa-header-3\",\n\t\ttitle: \"Small Heading\"\n\t},\n\t\"separator-1\": {\n\t\tname: \"separator-1\"\n\t},\n\t\"code\": {\n\t\tname: \"code\",\n\t\taction: toggleCodeBlock,\n\t\tclassName: \"fa fa-code\",\n\t\ttitle: \"Code\"\n\t},\n\t\"quote\": {\n\t\tname: \"quote\",\n\t\taction: toggleBlockquote,\n\t\tclassName: \"fa fa-quote-left\",\n\t\ttitle: \"Quote\",\n\t\tdefault: true\n\t},\n\t\"unordered-list\": {\n\t\tname: \"unordered-list\",\n\t\taction: toggleUnorderedList,\n\t\tclassName: \"fa fa-list-ul\",\n\t\ttitle: \"Generic List\",\n\t\tdefault: true\n\t},\n\t\"ordered-list\": {\n\t\tname: \"ordered-list\",\n\t\taction: toggleOrderedList,\n\t\tclassName: \"fa fa-list-ol\",\n\t\ttitle: \"Numbered List\",\n\t\tdefault: true\n\t},\n\t\"clean-block\": {\n\t\tname: \"clean-block\",\n\t\taction: cleanBlock,\n\t\tclassName: \"fa fa-eraser fa-clean-block\",\n\t\ttitle: \"Clean block\"\n\t},\n\t\"separator-2\": {\n\t\tname: \"separator-2\"\n\t},\n\t\"link\": {\n\t\tname: \"link\",\n\t\taction: drawLink,\n\t\tclassName: \"fa fa-link\",\n\t\ttitle: \"Create Link\",\n\t\tdefault: true\n\t},\n\t\"image\": {\n\t\tname: \"image\",\n\t\taction: drawImage,\n\t\tclassName: \"fa fa-picture-o\",\n\t\ttitle: \"Insert Image\",\n\t\tdefault: true\n\t},\n\t\"table\": {\n\t\tname: \"table\",\n\t\taction: drawTable,\n\t\tclassName: \"fa fa-table\",\n\t\ttitle: \"Insert Table\"\n\t},\n\t\"horizontal-rule\": {\n\t\tname: \"horizontal-rule\",\n\t\taction: drawHorizontalRule,\n\t\tclassName: \"fa fa-minus\",\n\t\ttitle: \"Insert Horizontal Line\"\n\t},\n\t\"separator-3\": {\n\t\tname: \"separator-3\"\n\t},\n\t\"preview\": {\n\t\tname: \"preview\",\n\t\taction: togglePreview,\n\t\tclassName: \"fa fa-eye no-disable\",\n\t\ttitle: \"Toggle Preview\",\n\t\tdefault: true\n\t},\n\t\"side-by-side\": {\n\t\tname: \"side-by-side\",\n\t\taction: toggleSideBySide,\n\t\tclassName: \"fa fa-columns no-disable no-mobile\",\n\t\ttitle: \"Toggle Side by Side\",\n\t\tdefault: true\n\t},\n\t\"fullscreen\": {\n\t\tname: \"fullscreen\",\n\t\taction: toggleFullScreen,\n\t\tclassName: \"fa fa-arrows-alt no-disable no-mobile\",\n\t\ttitle: \"Toggle Fullscreen\",\n\t\tdefault: true\n\t},\n\t\"separator-4\": {\n\t\tname: \"separator-4\"\n\t},\n\t\"guide\": {\n\t\tname: \"guide\",\n\t\taction: \"https://simplemde.com/markdown-guide\",\n\t\tclassName: \"fa fa-question-circle\",\n\t\ttitle: \"Markdown Guide\",\n\t\tdefault: true\n\t},\n\t\"separator-5\": {\n\t\tname: \"separator-5\"\n\t},\n\t\"undo\": {\n\t\tname: \"undo\",\n\t\taction: undo,\n\t\tclassName: \"fa fa-undo no-disable\",\n\t\ttitle: \"Undo\"\n\t},\n\t\"redo\": {\n\t\tname: \"redo\",\n\t\taction: redo,\n\t\tclassName: \"fa fa-repeat no-disable\",\n\t\ttitle: \"Redo\"\n\t}\n};\n\nvar insertTexts = {\n\tlink: [\"[\", \"](#url#)\"],\n\timage: [\"![](\", \"#url#)\"],\n\ttable: [\"\", \"\\n\\n| Column 1 | Column 2 | Column 3 |\\n| -------- | -------- | -------- |\\n| Text | Text | Text |\\n\\n\"],\n\thorizontalRule: [\"\", \"\\n\\n-----\\n\\n\"]\n};\n\nvar promptTexts = {\n\tlink: \"URL for the link:\",\n\timage: \"URL of the image:\"\n};\n\nvar blockStyles = {\n\t\"bold\": \"**\",\n\t\"code\": \"```\",\n\t\"italic\": \"*\"\n};\n\n/**\n * Interface of SimpleMDE.\n */\nfunction SimpleMDE(options) {\n\t// Handle options parameter\n\toptions = options || {};\n\n\n\t// Used later to refer to it\"s parent\n\toptions.parent = this;\n\n\n\t// Check if Font Awesome needs to be auto downloaded\n\tvar autoDownloadFA = true;\n\n\tif(options.autoDownloadFontAwesome === false) {\n\t\tautoDownloadFA = false;\n\t}\n\n\tif(options.autoDownloadFontAwesome !== true) {\n\t\tvar styleSheets = document.styleSheets;\n\t\tfor(var i = 0; i < styleSheets.length; i++) {\n\t\t\tif(!styleSheets[i].href)\n\t\t\t\tcontinue;\n\n\t\t\tif(styleSheets[i].href.indexOf(\"//maxcdn.bootstrapcdn.com/font-awesome/\") > -1) {\n\t\t\t\tautoDownloadFA = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tif(autoDownloadFA) {\n\t\tvar link = document.createElement(\"link\");\n\t\tlink.rel = \"stylesheet\";\n\t\tlink.href = \"https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css\";\n\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(link);\n\t}\n\n\n\t// Find the textarea to use\n\tif(options.element) {\n\t\tthis.element = options.element;\n\t} else if(options.element === null) {\n\t\t// This means that the element option was specified, but no element was found\n\t\tconsole.log(\"SimpleMDE: Error. No element was found.\");\n\t\treturn;\n\t}\n\n\n\t// Handle toolbar\n\tif(options.toolbar === undefined) {\n\t\t// Initialize\n\t\toptions.toolbar = [];\n\n\n\t\t// Loop over the built in buttons, to get the preferred order\n\t\tfor(var key in toolbarBuiltInButtons) {\n\t\t\tif(toolbarBuiltInButtons.hasOwnProperty(key)) {\n\t\t\t\tif(key.indexOf(\"separator-\") != -1) {\n\t\t\t\t\toptions.toolbar.push(\"|\");\n\t\t\t\t}\n\n\t\t\t\tif(toolbarBuiltInButtons[key].default === true || (options.showIcons && options.showIcons.constructor === Array && options.showIcons.indexOf(key) != -1)) {\n\t\t\t\t\toptions.toolbar.push(key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// Handle status bar\n\tif(!options.hasOwnProperty(\"status\")) {\n\t\toptions.status = [\"autosave\", \"lines\", \"words\", \"cursor\"];\n\t}\n\n\n\t// Add default preview rendering function\n\tif(!options.previewRender) {\n\t\toptions.previewRender = function(plainText) {\n\t\t\t// Note: \"this\" refers to the options object\n\t\t\treturn this.parent.markdown(plainText);\n\t\t};\n\t}\n\n\n\t// Set default options for parsing config\n\toptions.parsingConfig = extend({\n\t\thighlightFormatting: true // needed for toggleCodeBlock to detect types of code\n\t}, options.parsingConfig || {});\n\n\n\t// Merging the insertTexts, with the given options\n\toptions.insertTexts = extend({}, insertTexts, options.insertTexts || {});\n\n\n\t// Merging the promptTexts, with the given options\n\toptions.promptTexts = promptTexts;\n\n\n\t// Merging the blockStyles, with the given options\n\toptions.blockStyles = extend({}, blockStyles, options.blockStyles || {});\n\n\n\t// Merging the shortcuts, with the given options\n\toptions.shortcuts = extend({}, shortcuts, options.shortcuts || {});\n\n\n\t// Change unique_id to uniqueId for backwards compatibility\n\tif(options.autosave != undefined && options.autosave.unique_id != undefined && options.autosave.unique_id != \"\")\n\t\toptions.autosave.uniqueId = options.autosave.unique_id;\n\n\n\t// Update this options\n\tthis.options = options;\n\n\n\t// Auto render\n\tthis.render();\n\n\n\t// The codemirror component is only available after rendering\n\t// so, the setter for the initialValue can only run after\n\t// the element has been rendered\n\tif(options.initialValue && (!this.options.autosave || this.options.autosave.foundSavedValue !== true)) {\n\t\tthis.value(options.initialValue);\n\t}\n}\n\n/**\n * Default markdown render.\n */\nSimpleMDE.prototype.markdown = function(text) {\n\tif(marked) {\n\t\t// Initialize\n\t\tvar markedOptions = {};\n\n\n\t\t// Update options\n\t\tif(this.options && this.options.renderingConfig && this.options.renderingConfig.singleLineBreaks === false) {\n\t\t\tmarkedOptions.breaks = false;\n\t\t} else {\n\t\t\tmarkedOptions.breaks = true;\n\t\t}\n\n\t\tif(this.options && this.options.renderingConfig && this.options.renderingConfig.codeSyntaxHighlighting === true && window.hljs) {\n\t\t\tmarkedOptions.highlight = function(code) {\n\t\t\t\treturn window.hljs.highlightAuto(code).value;\n\t\t\t};\n\t\t}\n\n\n\t\t// Set options\n\t\tmarked.setOptions(markedOptions);\n\n\n\t\t// Return\n\t\treturn marked(text);\n\t}\n};\n\n/**\n * Render editor to the given element.\n */\nSimpleMDE.prototype.render = function(el) {\n\tif(!el) {\n\t\tel = this.element || document.getElementsByTagName(\"textarea\")[0];\n\t}\n\n\tif(this._rendered && this._rendered === el) {\n\t\t// Already rendered.\n\t\treturn;\n\t}\n\n\tthis.element = el;\n\tvar options = this.options;\n\n\tvar self = this;\n\tvar keyMaps = {};\n\n\tfor(var key in options.shortcuts) {\n\t\t// null stands for \"do not bind this command\"\n\t\tif(options.shortcuts[key] !== null && bindings[key] !== null) {\n\t\t\t(function(key) {\n\t\t\t\tkeyMaps[fixShortcut(options.shortcuts[key])] = function() {\n\t\t\t\t\tbindings[key](self);\n\t\t\t\t};\n\t\t\t})(key);\n\t\t}\n\t}\n\n\tkeyMaps[\"Enter\"] = \"newlineAndIndentContinueMarkdownList\";\n\tkeyMaps[\"Tab\"] = \"tabAndIndentMarkdownList\";\n\tkeyMaps[\"Shift-Tab\"] = \"shiftTabAndUnindentMarkdownList\";\n\tkeyMaps[\"Esc\"] = function(cm) {\n\t\tif(cm.getOption(\"fullScreen\")) toggleFullScreen(self);\n\t};\n\n\tdocument.addEventListener(\"keydown\", function(e) {\n\t\te = e || window.event;\n\n\t\tif(e.keyCode == 27) {\n\t\t\tif(self.codemirror.getOption(\"fullScreen\")) toggleFullScreen(self);\n\t\t}\n\t}, false);\n\n\tvar mode, backdrop;\n\tif(options.spellChecker !== false) {\n\t\tmode = \"spell-checker\";\n\t\tbackdrop = options.parsingConfig;\n\t\tbackdrop.name = \"gfm\";\n\t\tbackdrop.gitHubSpice = false;\n\n\t\tCodeMirrorSpellChecker({\n\t\t\tcodeMirrorInstance: CodeMirror\n\t\t});\n\t} else {\n\t\tmode = options.parsingConfig;\n\t\tmode.name = \"gfm\";\n\t\tmode.gitHubSpice = false;\n\t}\n\n\tthis.codemirror = CodeMirror.fromTextArea(el, {\n\t\tmode: mode,\n\t\tbackdrop: backdrop,\n\t\ttheme: \"paper\",\n\t\ttabSize: (options.tabSize != undefined) ? options.tabSize : 2,\n\t\tindentUnit: (options.tabSize != undefined) ? options.tabSize : 2,\n\t\tindentWithTabs: (options.indentWithTabs === false) ? false : true,\n\t\tlineNumbers: false,\n\t\tautofocus: (options.autofocus === true) ? true : false,\n\t\textraKeys: keyMaps,\n\t\tlineWrapping: (options.lineWrapping === false) ? false : true,\n\t\tallowDropFileTypes: [\"text/plain\"],\n\t\tplaceholder: options.placeholder || el.getAttribute(\"placeholder\") || \"\",\n\t\tstyleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : true\n\t});\n\n\tif(options.forceSync === true) {\n\t\tvar cm = this.codemirror;\n\t\tcm.on(\"change\", function() {\n\t\t\tcm.save();\n\t\t});\n\t}\n\n\tthis.gui = {};\n\n\tif(options.toolbar !== false) {\n\t\tthis.gui.toolbar = this.createToolbar();\n\t}\n\tif(options.status !== false) {\n\t\tthis.gui.statusbar = this.createStatusbar();\n\t}\n\tif(options.autosave != undefined && options.autosave.enabled === true) {\n\t\tthis.autosave();\n\t}\n\n\tthis.gui.sideBySide = this.createSideBySide();\n\n\tthis._rendered = this.element;\n\n\n\t// Fixes CodeMirror bug (#344)\n\tvar temp_cm = this.codemirror;\n\tsetTimeout(function() {\n\t\ttemp_cm.refresh();\n\t}.bind(temp_cm), 0);\n};\n\n// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem throw QuotaExceededError. We're going to detect this and set a variable accordingly.\nfunction isLocalStorageAvailable() {\n\tif(typeof localStorage === \"object\") {\n\t\ttry {\n\t\t\tlocalStorage.setItem(\"smde_localStorage\", 1);\n\t\t\tlocalStorage.removeItem(\"smde_localStorage\");\n\t\t} catch(e) {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nSimpleMDE.prototype.autosave = function() {\n\tif(isLocalStorageAvailable()) {\n\t\tvar simplemde = this;\n\n\t\tif(this.options.autosave.uniqueId == undefined || this.options.autosave.uniqueId == \"\") {\n\t\t\tconsole.log(\"SimpleMDE: You must set a uniqueId to use the autosave feature\");\n\t\t\treturn;\n\t\t}\n\n\t\tif(simplemde.element.form != null && simplemde.element.form != undefined) {\n\t\t\tsimplemde.element.form.addEventListener(\"submit\", function() {\n\t\t\t\tlocalStorage.removeItem(\"smde_\" + simplemde.options.autosave.uniqueId);\n\t\t\t});\n\t\t}\n\n\t\tif(this.options.autosave.loaded !== true) {\n\t\t\tif(typeof localStorage.getItem(\"smde_\" + this.options.autosave.uniqueId) == \"string\" && localStorage.getItem(\"smde_\" + this.options.autosave.uniqueId) != \"\") {\n\t\t\t\tthis.codemirror.setValue(localStorage.getItem(\"smde_\" + this.options.autosave.uniqueId));\n\t\t\t\tthis.options.autosave.foundSavedValue = true;\n\t\t\t}\n\n\t\t\tthis.options.autosave.loaded = true;\n\t\t}\n\n\t\tlocalStorage.setItem(\"smde_\" + this.options.autosave.uniqueId, simplemde.value());\n\n\t\tvar el = document.getElementById(\"autosaved\");\n\t\tif(el != null && el != undefined && el != \"\") {\n\t\t\tvar d = new Date();\n\t\t\tvar hh = d.getHours();\n\t\t\tvar m = d.getMinutes();\n\t\t\tvar dd = \"am\";\n\t\t\tvar h = hh;\n\t\t\tif(h >= 12) {\n\t\t\t\th = hh - 12;\n\t\t\t\tdd = \"pm\";\n\t\t\t}\n\t\t\tif(h == 0) {\n\t\t\t\th = 12;\n\t\t\t}\n\t\t\tm = m < 10 ? \"0\" + m : m;\n\n\t\t\tel.innerHTML = \"Autosaved: \" + h + \":\" + m + \" \" + dd;\n\t\t}\n\n\t\tthis.autosaveTimeoutId = setTimeout(function() {\n\t\t\tsimplemde.autosave();\n\t\t}, this.options.autosave.delay || 10000);\n\t} else {\n\t\tconsole.log(\"SimpleMDE: localStorage not available, cannot autosave\");\n\t}\n};\n\nSimpleMDE.prototype.clearAutosavedValue = function() {\n\tif(isLocalStorageAvailable()) {\n\t\tif(this.options.autosave == undefined || this.options.autosave.uniqueId == undefined || this.options.autosave.uniqueId == \"\") {\n\t\t\tconsole.log(\"SimpleMDE: You must set a uniqueId to clear the autosave value\");\n\t\t\treturn;\n\t\t}\n\n\t\tlocalStorage.removeItem(\"smde_\" + this.options.autosave.uniqueId);\n\t} else {\n\t\tconsole.log(\"SimpleMDE: localStorage not available, cannot autosave\");\n\t}\n};\n\nSimpleMDE.prototype.createSideBySide = function() {\n\tvar cm = this.codemirror;\n\tvar wrapper = cm.getWrapperElement();\n\tvar preview = wrapper.nextSibling;\n\n\tif(!preview || !/editor-preview-side/.test(preview.className)) {\n\t\tpreview = document.createElement(\"div\");\n\t\tpreview.className = \"editor-preview-side\";\n\t\twrapper.parentNode.insertBefore(preview, wrapper.nextSibling);\n\t}\n\n\t// Syncs scroll editor -> preview\n\tvar cScroll = false;\n\tvar pScroll = false;\n\tcm.on(\"scroll\", function(v) {\n\t\tif(cScroll) {\n\t\t\tcScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tpScroll = true;\n\t\tvar height = v.getScrollInfo().height - v.getScrollInfo().clientHeight;\n\t\tvar ratio = parseFloat(v.getScrollInfo().top) / height;\n\t\tvar move = (preview.scrollHeight - preview.clientHeight) * ratio;\n\t\tpreview.scrollTop = move;\n\t});\n\n\t// Syncs scroll preview -> editor\n\tpreview.onscroll = function() {\n\t\tif(pScroll) {\n\t\t\tpScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tcScroll = true;\n\t\tvar height = preview.scrollHeight - preview.clientHeight;\n\t\tvar ratio = parseFloat(preview.scrollTop) / height;\n\t\tvar move = (cm.getScrollInfo().height - cm.getScrollInfo().clientHeight) * ratio;\n\t\tcm.scrollTo(0, move);\n\t};\n\treturn preview;\n};\n\nSimpleMDE.prototype.createToolbar = function(items) {\n\titems = items || this.options.toolbar;\n\n\tif(!items || items.length === 0) {\n\t\treturn;\n\t}\n\tvar i;\n\tfor(i = 0; i < items.length; i++) {\n\t\tif(toolbarBuiltInButtons[items[i]] != undefined) {\n\t\t\titems[i] = toolbarBuiltInButtons[items[i]];\n\t\t}\n\t}\n\n\tvar bar = document.createElement(\"div\");\n\tbar.className = \"editor-toolbar\";\n\n\tvar self = this;\n\n\tvar toolbarData = {};\n\tself.toolbar = items;\n\n\tfor(i = 0; i < items.length; i++) {\n\t\tif(items[i].name == \"guide\" && self.options.toolbarGuideIcon === false)\n\t\t\tcontinue;\n\n\t\tif(self.options.hideIcons && self.options.hideIcons.indexOf(items[i].name) != -1)\n\t\t\tcontinue;\n\n\t\t// Fullscreen does not work well on mobile devices (even tablets)\n\t\t// In the future, hopefully this can be resolved\n\t\tif((items[i].name == \"fullscreen\" || items[i].name == \"side-by-side\") && isMobile())\n\t\t\tcontinue;\n\n\n\t\t// Don't include trailing separators\n\t\tif(items[i] === \"|\") {\n\t\t\tvar nonSeparatorIconsFollow = false;\n\n\t\t\tfor(var x = (i + 1); x < items.length; x++) {\n\t\t\t\tif(items[x] !== \"|\" && (!self.options.hideIcons || self.options.hideIcons.indexOf(items[x].name) == -1)) {\n\t\t\t\t\tnonSeparatorIconsFollow = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!nonSeparatorIconsFollow)\n\t\t\t\tcontinue;\n\t\t}\n\n\n\t\t// Create the icon and append to the toolbar\n\t\t(function(item) {\n\t\t\tvar el;\n\t\t\tif(item === \"|\") {\n\t\t\t\tel = createSep();\n\t\t\t} else {\n\t\t\t\tel = createIcon(item, self.options.toolbarTips, self.options.shortcuts);\n\t\t\t}\n\n\t\t\t// bind events, special for info\n\t\t\tif(item.action) {\n\t\t\t\tif(typeof item.action === \"function\") {\n\t\t\t\t\tel.onclick = function(e) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\titem.action(self);\n\t\t\t\t\t};\n\t\t\t\t} else if(typeof item.action === \"string\") {\n\t\t\t\t\tel.href = item.action;\n\t\t\t\t\tel.target = \"_blank\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttoolbarData[item.name || item] = el;\n\t\t\tbar.appendChild(el);\n\t\t})(items[i]);\n\t}\n\n\tself.toolbarElements = toolbarData;\n\n\tvar cm = this.codemirror;\n\tcm.on(\"cursorActivity\", function() {\n\t\tvar stat = getState(cm);\n\n\t\tfor(var key in toolbarData) {\n\t\t\t(function(key) {\n\t\t\t\tvar el = toolbarData[key];\n\t\t\t\tif(stat[key]) {\n\t\t\t\t\tel.className += \" active\";\n\t\t\t\t} else if(key != \"fullscreen\" && key != \"side-by-side\") {\n\t\t\t\t\tel.className = el.className.replace(/\\s*active\\s*/g, \"\");\n\t\t\t\t}\n\t\t\t})(key);\n\t\t}\n\t});\n\n\tvar cmWrapper = cm.getWrapperElement();\n\tcmWrapper.parentNode.insertBefore(bar, cmWrapper);\n\treturn bar;\n};\n\nSimpleMDE.prototype.createStatusbar = function(status) {\n\t// Initialize\n\tstatus = status || this.options.status;\n\tvar options = this.options;\n\tvar cm = this.codemirror;\n\n\n\t// Make sure the status variable is valid\n\tif(!status || status.length === 0)\n\t\treturn;\n\n\n\t// Set up the built-in items\n\tvar items = [];\n\tvar i, onUpdate, defaultValue;\n\n\tfor(i = 0; i < status.length; i++) {\n\t\t// Reset some values\n\t\tonUpdate = undefined;\n\t\tdefaultValue = undefined;\n\n\n\t\t// Handle if custom or not\n\t\tif(typeof status[i] === \"object\") {\n\t\t\titems.push({\n\t\t\t\tclassName: status[i].className,\n\t\t\t\tdefaultValue: status[i].defaultValue,\n\t\t\t\tonUpdate: status[i].onUpdate\n\t\t\t});\n\t\t} else {\n\t\t\tvar name = status[i];\n\n\t\t\tif(name === \"words\") {\n\t\t\t\tdefaultValue = function(el) {\n\t\t\t\t\tel.innerHTML = wordCount(cm.getValue());\n\t\t\t\t};\n\t\t\t\tonUpdate = function(el) {\n\t\t\t\t\tel.innerHTML = wordCount(cm.getValue());\n\t\t\t\t};\n\t\t\t} else if(name === \"lines\") {\n\t\t\t\tdefaultValue = function(el) {\n\t\t\t\t\tel.innerHTML = cm.lineCount();\n\t\t\t\t};\n\t\t\t\tonUpdate = function(el) {\n\t\t\t\t\tel.innerHTML = cm.lineCount();\n\t\t\t\t};\n\t\t\t} else if(name === \"cursor\") {\n\t\t\t\tdefaultValue = function(el) {\n\t\t\t\t\tel.innerHTML = \"0:0\";\n\t\t\t\t};\n\t\t\t\tonUpdate = function(el) {\n\t\t\t\t\tvar pos = cm.getCursor();\n\t\t\t\t\tel.innerHTML = pos.line + \":\" + pos.ch;\n\t\t\t\t};\n\t\t\t} else if(name === \"autosave\") {\n\t\t\t\tdefaultValue = function(el) {\n\t\t\t\t\tif(options.autosave != undefined && options.autosave.enabled === true) {\n\t\t\t\t\t\tel.setAttribute(\"id\", \"autosaved\");\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\titems.push({\n\t\t\t\tclassName: name,\n\t\t\t\tdefaultValue: defaultValue,\n\t\t\t\tonUpdate: onUpdate\n\t\t\t});\n\t\t}\n\t}\n\n\n\t// Create element for the status bar\n\tvar bar = document.createElement(\"div\");\n\tbar.className = \"editor-statusbar\";\n\n\n\t// Create a new span for each item\n\tfor(i = 0; i < items.length; i++) {\n\t\t// Store in temporary variable\n\t\tvar item = items[i];\n\n\n\t\t// Create span element\n\t\tvar el = document.createElement(\"span\");\n\t\tel.className = item.className;\n\n\n\t\t// Ensure the defaultValue is a function\n\t\tif(typeof item.defaultValue === \"function\") {\n\t\t\titem.defaultValue(el);\n\t\t}\n\n\n\t\t// Ensure the onUpdate is a function\n\t\tif(typeof item.onUpdate === \"function\") {\n\t\t\t// Create a closure around the span of the current action, then execute the onUpdate handler\n\t\t\tthis.codemirror.on(\"update\", (function(el, item) {\n\t\t\t\treturn function() {\n\t\t\t\t\titem.onUpdate(el);\n\t\t\t\t};\n\t\t\t}(el, item)));\n\t\t}\n\n\n\t\t// Append the item to the status bar\n\t\tbar.appendChild(el);\n\t}\n\n\n\t// Insert the status bar into the DOM\n\tvar cmWrapper = this.codemirror.getWrapperElement();\n\tcmWrapper.parentNode.insertBefore(bar, cmWrapper.nextSibling);\n\treturn bar;\n};\n\n/**\n * Get or set the text content.\n */\nSimpleMDE.prototype.value = function(val) {\n\tif(val === undefined) {\n\t\treturn this.codemirror.getValue();\n\t} else {\n\t\tthis.codemirror.getDoc().setValue(val);\n\t\treturn this;\n\t}\n};\n\n\n/**\n * Bind static methods for exports.\n */\nSimpleMDE.toggleBold = toggleBold;\nSimpleMDE.toggleItalic = toggleItalic;\nSimpleMDE.toggleStrikethrough = toggleStrikethrough;\nSimpleMDE.toggleBlockquote = toggleBlockquote;\nSimpleMDE.toggleHeadingSmaller = toggleHeadingSmaller;\nSimpleMDE.toggleHeadingBigger = toggleHeadingBigger;\nSimpleMDE.toggleHeading1 = toggleHeading1;\nSimpleMDE.toggleHeading2 = toggleHeading2;\nSimpleMDE.toggleHeading3 = toggleHeading3;\nSimpleMDE.toggleCodeBlock = toggleCodeBlock;\nSimpleMDE.toggleUnorderedList = toggleUnorderedList;\nSimpleMDE.toggleOrderedList = toggleOrderedList;\nSimpleMDE.cleanBlock = cleanBlock;\nSimpleMDE.drawLink = drawLink;\nSimpleMDE.drawImage = drawImage;\nSimpleMDE.drawTable = drawTable;\nSimpleMDE.drawHorizontalRule = drawHorizontalRule;\nSimpleMDE.undo = undo;\nSimpleMDE.redo = redo;\nSimpleMDE.togglePreview = togglePreview;\nSimpleMDE.toggleSideBySide = toggleSideBySide;\nSimpleMDE.toggleFullScreen = toggleFullScreen;\n\n/**\n * Bind instance methods for exports.\n */\nSimpleMDE.prototype.toggleBold = function() {\n\ttoggleBold(this);\n};\nSimpleMDE.prototype.toggleItalic = function() {\n\ttoggleItalic(this);\n};\nSimpleMDE.prototype.toggleStrikethrough = function() {\n\ttoggleStrikethrough(this);\n};\nSimpleMDE.prototype.toggleBlockquote = function() {\n\ttoggleBlockquote(this);\n};\nSimpleMDE.prototype.toggleHeadingSmaller = function() {\n\ttoggleHeadingSmaller(this);\n};\nSimpleMDE.prototype.toggleHeadingBigger = function() {\n\ttoggleHeadingBigger(this);\n};\nSimpleMDE.prototype.toggleHeading1 = function() {\n\ttoggleHeading1(this);\n};\nSimpleMDE.prototype.toggleHeading2 = function() {\n\ttoggleHeading2(this);\n};\nSimpleMDE.prototype.toggleHeading3 = function() {\n\ttoggleHeading3(this);\n};\nSimpleMDE.prototype.toggleCodeBlock = function() {\n\ttoggleCodeBlock(this);\n};\nSimpleMDE.prototype.toggleUnorderedList = function() {\n\ttoggleUnorderedList(this);\n};\nSimpleMDE.prototype.toggleOrderedList = function() {\n\ttoggleOrderedList(this);\n};\nSimpleMDE.prototype.cleanBlock = function() {\n\tcleanBlock(this);\n};\nSimpleMDE.prototype.drawLink = function() {\n\tdrawLink(this);\n};\nSimpleMDE.prototype.drawImage = function() {\n\tdrawImage(this);\n};\nSimpleMDE.prototype.drawTable = function() {\n\tdrawTable(this);\n};\nSimpleMDE.prototype.drawHorizontalRule = function() {\n\tdrawHorizontalRule(this);\n};\nSimpleMDE.prototype.undo = function() {\n\tundo(this);\n};\nSimpleMDE.prototype.redo = function() {\n\tredo(this);\n};\nSimpleMDE.prototype.togglePreview = function() {\n\ttogglePreview(this);\n};\nSimpleMDE.prototype.toggleSideBySide = function() {\n\ttoggleSideBySide(this);\n};\nSimpleMDE.prototype.toggleFullScreen = function() {\n\ttoggleFullScreen(this);\n};\n\nSimpleMDE.prototype.isPreviewActive = function() {\n\tvar cm = this.codemirror;\n\tvar wrapper = cm.getWrapperElement();\n\tvar preview = wrapper.lastChild;\n\n\treturn /editor-preview-active/.test(preview.className);\n};\n\nSimpleMDE.prototype.isSideBySideActive = function() {\n\tvar cm = this.codemirror;\n\tvar wrapper = cm.getWrapperElement();\n\tvar preview = wrapper.nextSibling;\n\n\treturn /editor-preview-active-side/.test(preview.className);\n};\n\nSimpleMDE.prototype.isFullscreenActive = function() {\n\tvar cm = this.codemirror;\n\n\treturn cm.getOption(\"fullScreen\");\n};\n\nSimpleMDE.prototype.getState = function() {\n\tvar cm = this.codemirror;\n\n\treturn getState(cm);\n};\n\nSimpleMDE.prototype.toTextArea = function() {\n\tvar cm = this.codemirror;\n\tvar wrapper = cm.getWrapperElement();\n\n\tif(wrapper.parentNode) {\n\t\tif(this.gui.toolbar) {\n\t\t\twrapper.parentNode.removeChild(this.gui.toolbar);\n\t\t}\n\t\tif(this.gui.statusbar) {\n\t\t\twrapper.parentNode.removeChild(this.gui.statusbar);\n\t\t}\n\t\tif(this.gui.sideBySide) {\n\t\t\twrapper.parentNode.removeChild(this.gui.sideBySide);\n\t\t}\n\t}\n\n\tcm.toTextArea();\n\n\tif(this.autosaveTimeoutId) {\n\t\tclearTimeout(this.autosaveTimeoutId);\n\t\tthis.autosaveTimeoutId = undefined;\n\t\tthis.clearAutosavedValue();\n\t}\n};\n\nmodule.exports = SimpleMDE;","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"/**\\n * simplemde v1.11.2\\n * Copyright Next Step Webs, Inc.\\n * @link https://github.com/NextStepWebs/simplemde-markdown-editor\\n * @license MIT\\n */\\n.CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;min-height:300px;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-scroll{min-height:300px}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,\\\"Helvetica Neue\\\",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:\\\"1\\\"}.editor-toolbar a.fa-header-2:after{content:\\\"2\\\"}.editor-toolbar a.fa-header-3:after{content:\\\"3\\\"}.editor-toolbar a.fa-header-bigger:after{content:\\\"▲\\\"}.editor-toolbar a.fa-header-smaller:after{content:\\\"▼\\\"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\nvar CodeMirror = require(\"codemirror\");\n\nCodeMirror.commands.tabAndIndentMarkdownList = function (cm) {\n\tvar ranges = cm.listSelections();\n\tvar pos = ranges[0].head;\n\tvar eolState = cm.getStateAfter(pos.line);\n\tvar inList = eolState.list !== false;\n\n\tif (inList) {\n\t\tcm.execCommand(\"indentMore\");\n\t\treturn;\n\t}\n\n\tif (cm.options.indentWithTabs) {\n\t\tcm.execCommand(\"insertTab\");\n\t}\n\telse {\n\t\tvar spaces = Array(cm.options.tabSize + 1).join(\" \");\n\t\tcm.replaceSelection(spaces);\n\t}\n};\n\nCodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {\n\tvar ranges = cm.listSelections();\n\tvar pos = ranges[0].head;\n\tvar eolState = cm.getStateAfter(pos.line);\n\tvar inList = eolState.list !== false;\n\n\tif (inList) {\n\t\tcm.execCommand(\"indentLess\");\n\t\treturn;\n\t}\n\n\tif (cm.options.indentWithTabs) {\n\t\tcm.execCommand(\"insertTab\");\n\t}\n\telse {\n\t\tvar spaces = Array(cm.options.tabSize + 1).join(\" \");\n\t\tcm.replaceSelection(spaces);\n\t}\n};\n"],"sourceRoot":""}