bugfixes and minor tweaks + scripts are no longer needed for _edit template...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-07-27 02:38:17 +03:00
parent da7a1f446f
commit 0d228baba6
2 changed files with 5 additions and 5 deletions

View File

@ -80,6 +80,7 @@ var update_editor = function(){
.blur(() => {
reload()
})
.text($('.raw').html())
}
var go = (path) => {

View File

@ -222,7 +222,8 @@ var macro = {
.replace(/\s*\/\/.*$|\s*\/\*(.|[\n\r])*?\*\/\s*/mg, '')) },
// XXX
//nl2br: function(context, text){ return $('<div>').html(text.replace(/\n/g, '<br>\n')) },
nl2br: function(context, elem){
return $('<div>').html($(elem).html().replace(/\n/g, '<br>\n')) },
wikiword: function(context, elem){
return $('<span>')
@ -532,10 +533,8 @@ var data = {
+'<h1 class ="title" contenteditable>@include(../title)</h1>\n'
+'<br>\n'
+'<code><pre class="raw" saveto=".." contenteditable>@source(../raw)</pre></code>\n'
// XXX avoid this...
+'<script>\n'
+'\t$(".raw").text($(".raw").html())\n'
+'</script>\n'
+'<hr>\n'
+'<a href="#/">home</a>\n'
+'',
},
}