aboutsummaryrefslogtreecommitdiff
path: root/lib/styles
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-28 21:08:40 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-28 21:08:40 +0000
commita12b966752ba7ae880f7d6348a42cc986e891a82 (patch)
treeab244d36ea978f5b75021c9c6b49b53376f33aef /lib/styles
parent481d5860686b6b02b5536d7455b88baf7325ecfd (diff)
Map breaks with style maps
Diffstat (limited to 'lib/styles')
-rw-r--r--lib/styles/document-matchers.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/styles/document-matchers.js b/lib/styles/document-matchers.js
index 3f7fbdd..afc0a7d 100644
--- a/lib/styles/document-matchers.js
+++ b/lib/styles/document-matchers.js
@@ -5,6 +5,9 @@ exports.italic = new Matcher("italic");
exports.underline = new Matcher("underline");
exports.strikethrough = new Matcher("strikethrough");
exports.commentReference = new Matcher("commentReference");
+exports.lineBreak = new Matcher("break", {breakType: "line"});
+exports.pageBreak = new Matcher("break", {breakType: "page"});
+exports.columnBreak = new Matcher("break", {breakType: "column"});
exports.equalTo = equalTo;
exports.startsWith = startsWith;
@@ -32,7 +35,8 @@ Matcher.prototype.matches = function(element) {
return element.type === this._elementType &&
(this._styleId === undefined || element.styleId === this._styleId) &&
(this._styleName === undefined || (element.styleName && this._styleName.operator(this._styleName.operand, element.styleName))) &&
- (this._listIndex === undefined || isList(element, this._listIndex, this._listIsOrdered));
+ (this._listIndex === undefined || isList(element, this._listIndex, this._listIsOrdered)) &&
+ (this._breakType === undefined || this._breakType === element.breakType);
};
function isList(element, levelIndex, isOrdered) {