Permalink
Browse files

Update README

  • Loading branch information...
1 parent c485607 commit 58ee3b4584e952f9760d20ad6bf5f0419dfa60f1 @watsonian committed Sep 4, 2012
Showing with 22 additions and 15 deletions.
  1. +22 −15 README.md
View
@@ -1,25 +1,32 @@
-h1. BlackList: dead simple content filtering
+# BlackList: dead simple content filtering
-This library is just a simple implementation of a blacklist to filter content. It comes
-with a set of default words for filtering in config/black_list.yml that were obtained from
-"http://www.noswearing.com":http://www.noswearing.com. You can add or remove from the list
-as necessary. It supports two types of filters currently--exact matches and greedy matches.
-Exact matches will only match if the word is found on its own. Greedy matches will find
-words nested within other words. It will also work out of the box as a Ruby on Rails plugin.
-Just drop it in vendor/plugins and it'll work.
+This library is just a simple implementation of a blacklist to filter content.
+It comes with a set of default words for filtering in `config/black_list.yml`
+that were obtained from [noswearing.com](http://www.noswearing.com). You can
+add or remove from the list as necessary. It supports two types of filters
+currently – exact matches and greedy matches. Exact matches will only match if
+the word is found on its own. Greedy matches will find words nested within
+other words. It will also work out of the box as a Ruby on Rails plugin. Just
+drop it in `vendor/plugins` and it'll work.
Usage is as follows:
- BlackList.block?("Stupid ass simple.") => true
- BlackList.block?("Squeaky clean.") => false
- BlackList.block?("Assassins!") => false
+```ruby
+BlackList.block?("Stupid ass simple.") => true
+BlackList.block?("Squeaky clean.") => false
+BlackList.block?("Assassins!") => false
+```
You can also just search for particular sorts of matches:
- BlackList.greedy?("Stupid ass simple.") => false
- BlackList.exact?("Stupid ass simple.") => true
+```ruby
+BlackList.greedy?("Stupid ass simple.") => false
+BlackList.exact?("Stupid ass simple.") => true
+```
It also supports highlighting flagged words:
- BlackList.highlight("Stupid ass simple.") => "<code><p>Stupid <strong>ass</strong> simple.</p></code>"
- BlackList.highlight("Squeaky clean.") => "<code><p>Squeaky clean.</p></code>"
+```ruby
+BlackList.highlight("Stupid ass simple.") => "<code><p>Stupid <strong>ass</strong> simple.</p></code>"
+BlackList.highlight("Squeaky clean.") => "<code><p>Squeaky clean.</p></code>"
+```

0 comments on commit 58ee3b4

Please sign in to comment.