Skip to content

Commit

Permalink
pp: remove backslashes from expected text
Browse files Browse the repository at this point in the history
  • Loading branch information
deniak committed May 25, 2016
1 parent 1a11646 commit 94bd60b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/rules/sotd/pp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ function buildWanted (groups, sr) {

var config = sr.config
, wanted
, result = {}
, isPP2002 = (config.patentPolicy === "pp2002");

if (isPP2002)
Expand Down Expand Up @@ -32,7 +33,9 @@ function buildWanted (groups, sr) {
wanted += " An individual who has actual knowledge of a patent which the individual " +
"believes contains Essential Claim\\(s\\) must disclose the information in " +
"accordance with section 6 of the W3C Patent Policy\\.";
return new RegExp(wanted);
result.regex = new RegExp(wanted);
result.text = wanted.replace(/\\/g, '');
return result;
}

function findPP ($candidates, sr) {
Expand All @@ -45,14 +48,14 @@ function findPP ($candidates, sr) {
, wanted = buildWanted(groups, sr)
, jointRegex = /This document was published by the (.+) Working Group and the (.+) Working Group./;
;
expected=wanted;
expected=wanted.text;
if (jointRegex.test(text)) {
var matches = text.match(jointRegex);
groups.push(matches[1]);
groups.push(matches[2]);
sr.warning(self, "joint-publication");
}
if (wanted.test(text)) {
if (wanted.regex.test(text)) {
$pp = $p;
return false;
}
Expand Down

0 comments on commit 94bd60b

Please sign in to comment.