aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-03 20:17:04 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-03 20:17:04 +0100
commit3047481420f215fb60b0380fa187975948ba54be (patch)
tree9ca20dae3e042e7bceed6e0fb09c2e3423a441a2
parent64b823c26c385dcd57aff3e19ce19af0489199e0 (diff)
Add comment reference document matcher
-rw-r--r--lib/document-matchers.js1
-rw-r--r--lib/style-reader.js4
-rw-r--r--test/style-reader.tests.js7
3 files changed, 11 insertions, 1 deletions
diff --git a/lib/document-matchers.js b/lib/document-matchers.js
index a9150e3..60bc65f 100644
--- a/lib/document-matchers.js
+++ b/lib/document-matchers.js
@@ -4,6 +4,7 @@ exports.bold = new Matcher("bold");
exports.italic = new Matcher("italic");
exports.underline = new Matcher("underline");
exports.strikethrough = new Matcher("strikethrough");
+exports.commentReference = new Matcher("comment-reference");
function paragraph(options) {
diff --git a/lib/style-reader.js b/lib/style-reader.js
index b5fb8ce..ab9a171 100644
--- a/lib/style-reader.js
+++ b/lib/style-reader.js
@@ -125,13 +125,15 @@ function documentMatcherRule() {
var italic = identifierToConstant("i", documentMatchers.italic);
var underline = identifierToConstant("u", documentMatchers.underline);
var strikethrough = identifierToConstant("strike", documentMatchers.strikethrough);
+ var commentReference = identifierToConstant("comment-reference", documentMatchers.commentReference);
return lop.rules.firstOf("element type",
paragraphOrRun,
bold,
italic,
underline,
- strikethrough
+ strikethrough,
+ commentReference
);
}
diff --git a/test/style-reader.tests.js b/test/style-reader.tests.js
index 0a4dccb..7265e8f 100644
--- a/test/style-reader.tests.js
+++ b/test/style-reader.tests.js
@@ -127,6 +127,13 @@ describe("styleReader.readDocumentMatcher", function() {
);
});
+ test("reads comment-reference", function() {
+ assertDocumentMatcher(
+ "comment-reference",
+ documentMatchers.commentReference
+ );
+ });
+
function assertDocumentMatcher(input, expected) {
assert.deepEqual(readDocumentMatcher(input), results.success(expected));
}