|
@@ -1,4 +1,4 @@
|
|
|
-;/*! showdown v 1.7.5 - 02-10-2017 */
|
|
|
+;/*! showdown v 1.7.5 - 06-10-2017 */
|
|
|
(function(){
|
|
|
/**
|
|
|
* Created by Tivie on 13-07-2015.
|
|
@@ -2843,9 +2843,9 @@ showdown.subParser('tables', function (text, options, globals) {
|
|
|
return text;
|
|
|
}
|
|
|
|
|
|
- var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
|
|
|
+ var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|<ol|<ul|¨0)/gm,
|
|
|
//singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
|
|
|
- singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|\n( {0,3}\|.+\|\n)*(?:\n|¨0)/gm;
|
|
|
+ singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|\n( {0,3}\|.+\|\n)*(?:\n|<ol|<ul|¨0)/gm;
|
|
|
|
|
|
function parseStyles (sLine) {
|
|
|
if (/^:[ \t]*--*$/.test(sLine)) {
|
|
@@ -2961,11 +2961,24 @@ showdown.subParser('tables', function (text, options, globals) {
|
|
|
return buildTable(headers, cells);
|
|
|
}
|
|
|
|
|
|
+ function hackFixTableFollowedByList (rawTable) {
|
|
|
+ var lastChars = rawTable.slice(-3);
|
|
|
+ if (lastChars === '<ol' || lastChars === '<ul') {
|
|
|
+ rawTable = rawTable.slice(0, -3) + '\n\n' + rawTable.slice(-3);
|
|
|
+ }
|
|
|
+ return rawTable;
|
|
|
+ }
|
|
|
+
|
|
|
text = globals.converter._dispatch('tables.before', text, options, globals);
|
|
|
|
|
|
// find escaped pipe characters
|
|
|
text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
|
|
|
|
|
|
+ // hackfix issue #443. Due to lists only having a linebreak before them, we need to manually insert a linebreak to prevent
|
|
|
+ // tables not being parsed when followed by a list
|
|
|
+ text = text.replace(tableRgx, hackFixTableFollowedByList);
|
|
|
+ text = text.replace(singeColTblRgx, hackFixTableFollowedByList);
|
|
|
+
|
|
|
// parse multi column tables
|
|
|
text = text.replace(tableRgx, parseTable);
|
|
|
|