Permalink
Browse files

Move back to a Makefile -- remove isAnchorNested (unused) fn

  • Loading branch information...
1 parent 0db72d3 commit 0ea7523651aa30fd0330b4591f9a1cbc67897c0c @jsantell committed Oct 15, 2012
Showing with 6 additions and 26 deletions.
  1. +3 −0 Makefile
  2. +1 −1 README.md
  3. +1 −12 link-injection.js
  4. +1 −2 package.json
  5. +0 −11 src/link-injection.coffee
View
@@ -0,0 +1,3 @@
+all: test build
+build:
+ coffee -c -o ./ src/link-injection.coffee
View
@@ -53,4 +53,4 @@ is frequently used in 3D WebGL applications and audio processing.
Development
---
-Run `npm build` to build the coffee into JavaScript. Run `npm test` from project root -- requires `mocha` to be installed globally
+Run `make` in the project root to build the coffee into JavaScript. Run `npm test` from project root -- requires `mocha` to be installed globally
View
@@ -1,5 +1,5 @@
(function() {
- var cheerio, defaults, isAnchorNested, makeRegex, parse, _;
+ var cheerio, defaults, makeRegex, parse, _;
cheerio = require('cheerio');
@@ -12,17 +12,6 @@
return new RegExp("\\b(" + keyword + ")\\b", flags);
};
- isAnchorNested = function($el) {
- var $parent;
- if ($el.name === 'a') return false;
- $parent = $el.parent();
- while (!($parent === $el || $parent === null)) {
- if ($parent.name === 'a') return false;
- $parent = $parent.parent();
- }
- return true;
- };
-
defaults = {
caseSensitive: true,
repeat: 0
View
@@ -12,8 +12,7 @@
"chai" : ">= 1.3.0"
},
"scripts" : {
- "test" : "mocha --reporter nyan",
- "build" : "coffee -c -o ./ src/link-injection.coffee"
+ "test" : "mocha --reporter nyan"
},
"repository" : {
"type" : "git",
View
@@ -10,17 +10,6 @@ makeRegex = ( keyword, options ) ->
# flags += 'g' if options.repeat is 0
new RegExp "\\b(#{keyword})\\b", flags
-# Current text must not be nested inside of an anchor
-isAnchorNested = ( $el ) ->
- return false if $el.name is 'a'
-
- $parent = $el.parent()
- until $parent is $el or $parent is null
- return false if $parent.name is 'a'
- $parent = $parent.parent()
-
- return true
-
defaults =
caseSensitive: true
repeat: 0

0 comments on commit 0ea7523

Please sign in to comment.