fix for php 5.2

This commit is contained in:
祁宁
2014-10-21 17:25:56 +08:00
parent 11bb981c99
commit 9d84c8f596
5 changed files with 8 additions and 6331 deletions
+3 -1
View File
@@ -64,7 +64,9 @@ $(document).ready(function () {
span = '<span class="diff" />',
cache = {};
Markdown.Extra.init(converter);
Markdown.Extra.init(converter, {
'extensions' : ["tables", "fenced_code_gfm", "def_list", "attr_list", "footnotes", "strikethrough", "newlines"]
});
// 自动跟随
converter.hooks.chain('postConversion', function (html) {
File diff suppressed because it is too large Load Diff
-26
View File
@@ -168,32 +168,6 @@
};
})($);
(function () {
Typecho.Markdown = function () {
this.hooks = new Markdown.HookCollection();
this.hooks.addNoop('postConversion');
this.lastIt = null;
};
Typecho.Markdown.prototype.makeHtml = function (text, preview) {
var self = this;
if (this.lastIt) {
clearTimeout(this.lastIt);
this.lastIt = null;
}
this.lastIt = setTimeout(function () {
html = MarkdownText(text);
preview(self.hooks.postConversion(html));
}, 500);
return false;
};
})();
/**
* TableDnD plug-in for JQuery, allows you to drag and drop table rows
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -1755,6 +1755,10 @@ class ParsedownExtra extends Parsedown
return $text;
}
protected function sortFootnotes($A, $B) {
return $A['number'] - $B['number'];
}
#
# ~
#
@@ -1777,9 +1781,7 @@ class ParsedownExtra extends Parsedown
),
);
usort($this->Definitions['Footnote'], function($A, $B) {
return $A['number'] - $B['number'];
});
usort($this->Definitions['Footnote'], array($this, 'sortFootnotes'));
foreach ($this->Definitions['Footnote'] as $name => $Data)
{