removes a second and useless definition for 'markdownize'

main
Paul Schneider 9 years ago
parent e0e832d730
commit f46e3d039c
1 changed files with 6 additions and 17 deletions

@ -1,26 +1,15 @@
var markdownize = function(content) {
if (!content) return '';
var html = content.split("\n").map($.trim).filter(function(line) {
return line != "";
return line != "" ;
}).join("\n");
return toMarkdown(html);
};
var converter = new showdown.Converter();
var markdownize = function(content) {
if (!content) return '';
var html = content.split("\n").map($.trim).filter(function(line) {
return line != "";
}).join("\n");
var md = toMarkdown(html);
console.log(md);
return md;
};
var htmlize = function(content) {
var htmlize = function(content) {
return converter.makeHtml(content);
};
var updateHtml = function(id,content) {
var jView = jQuery('*[for="'+id+'"]');
var updateHtml = function(jView,content) {
if (markdownize(jView.html()) === content) {
return;
}
@ -28,7 +17,7 @@ var markdownize = function(content) {
jView.html(html);
};
var updateMD = function(id,content) {
var updateMD = function(id,content) {
if (!content) return jQuery('#'+id).val('') ;
var markdown = markdownize(content);
if (jQuery('#'+id).val() === markdown) {
@ -36,7 +25,7 @@ var markdownize = function(content) {
}
jQuery('#'+id).val( markdown );
};
var onMDModified = ( function (event, data) {
$('#Submit').addClass('dirty');
var onMDModified = ( function (event, data) {
$('#Submit').addClass('success');
updateMD(this.attributes["for"].value, data.content);
});

Loading…