mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 12:07:19 +00:00
Merge pull request #307 from Skeeve/issue_94
added fix for issue #94 for horizontal rules, tables and typed block
This commit is contained in:
commit
de2e5adf15
@ -22,7 +22,7 @@ exports.types = {block: true};
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /-{3,}\r?\n/mg;
|
||||
this.matchRegExp = /-{3,}\r?(?:\n|$)/mg;
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
|
@ -18,11 +18,11 @@ exports.types = {block: true};
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /^\|(?:[^\n]*)\|(?:[fhck]?)\r?\n/mg;
|
||||
this.matchRegExp = /^\|(?:[^\n]*)\|(?:[fhck]?)\r?(?:\n|$)/mg;
|
||||
};
|
||||
|
||||
var processRow = function(prevColumns) {
|
||||
var cellRegExp = /(?:\|([^\n\|]*)\|)|(\|[fhck]?\r?\n)/mg,
|
||||
var cellRegExp = /(?:\|([^\n\|]*)\|)|(\|[fhck]?\r?(?:\n|$))/mg,
|
||||
cellTermRegExp = /((?:\x20*)\|)/mg,
|
||||
tree = [],
|
||||
col = 0,
|
||||
@ -107,8 +107,8 @@ var processRow = function(prevColumns) {
|
||||
exports.parse = function() {
|
||||
var rowContainerTypes = {"c":"caption", "h":"thead", "":"tbody", "f":"tfoot"},
|
||||
table = {type: "element", tag: "table", children: []},
|
||||
rowRegExp = /^\|([^\n]*)\|([fhck]?)\r?\n/mg,
|
||||
rowTermRegExp = /(\|(?:[fhck]?)\r?\n)/mg,
|
||||
rowRegExp = /^\|([^\n]*)\|([fhck]?)\r?(?:\n|$)/mg,
|
||||
rowTermRegExp = /(\|(?:[fhck]?)\r?(?:\n|$))/mg,
|
||||
prevColumns = [],
|
||||
currRowType,
|
||||
rowContainer,
|
||||
|
@ -40,7 +40,7 @@ exports.init = function(parser) {
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
var reEnd = /\r?\n\$\$\$\r?\n/mg;
|
||||
var reEnd = /\r?\n\$\$\$\r?(?:\n|$)/mg;
|
||||
// Save the type
|
||||
var parseType = this.match[1],
|
||||
renderType = this.match[2];
|
||||
|
Loading…
Reference in New Issue
Block a user