Replace markdown with marked.

This commit is contained in:
Lars Jung 2014-08-03 21:12:40 +02:00
parent 114c63cfd7
commit 7ecefa554a
7 changed files with 1281 additions and 1733 deletions

View file

@ -1,5 +1,5 @@
modulejs.define('ext/custom', ['_', '$', 'markdown', 'core/settings', 'core/server', 'core/event', 'core/resource'], function (_, $, markdown, allsettings, server, event, resource) {
modulejs.define('ext/custom', ['_', '$', 'marked', 'core/settings', 'core/server', 'core/event', 'core/resource'], function (_, $, marked, allsettings, server, event, resource) {
var settings = _.extend({
enabled: false
@ -20,7 +20,7 @@ modulejs.define('ext/custom', ['_', '$', 'markdown', 'core/settings', 'core/serv
if (data.header) {
content = data.header;
if (data.header_type === 'md') {
content = markdown.toHTML(content);
content = marked(content);
}
$header.html(content).stop().slideDown(duration);
has_header = true;
@ -29,7 +29,7 @@ modulejs.define('ext/custom', ['_', '$', 'markdown', 'core/settings', 'core/serv
if (data.footer) {
content = data.footer;
if (data.footer_type === 'md') {
content = markdown.toHTML(content);
content = marked(content);
}
$footer.html(content).stop().slideDown(duration);
has_footer = true;

View file

@ -1,5 +1,5 @@
modulejs.define('ext/preview-txt', ['_', '$', 'markdown', 'core/settings', 'core/event', 'core/resource', 'ext/preview'], function (_, $, markdown, allsettings, event, resource, preview) {
modulejs.define('ext/preview-txt', ['_', '$', 'marked', 'core/settings', 'core/event', 'core/resource', 'ext/preview'], function (_, $, marked, allsettings, event, resource, preview) {
var settings = _.extend({
enabled: false,
@ -106,7 +106,7 @@ modulejs.define('ext/preview-txt', ['_', '$', 'markdown', 'core/settings', 'core
} else if (settings.types[currentItem.type] === 'markdown') {
$text = $(templateMarkdown).html(markdown.toHTML(textContent));
$text = $(templateMarkdown).html(marked(textContent));
} else {
$text = $(templateText).text(textContent);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
// ----------
// @include "lib/modernizr-*.js"
// @include "lib/underscore-*.js"
// @include "lib/markdown-*.js"
// @include "lib/marked-*.js"
// @include "lib/modulejs-*.js"
// @include "lib/moment-*.js"
@ -19,7 +19,7 @@
/*global jQuery, markdown, Modernizr, moment, _ */
modulejs.define('$', function () { return jQuery; });
modulejs.define('markdown', function () { return markdown; });
modulejs.define('marked', function () { return marked; });
modulejs.define('modernizr', function () { return Modernizr; });
modulejs.define('moment', function () { return moment; });
modulejs.define('_', function () { return _; });