Browse files

Correct term is "stream" not "buffer"

  • Loading branch information...
1 parent 78a7a7d commit 44d2cc5a3d1d9369617136023406b50bbf5ead56 @brandonbloom committed Sep 20, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/convert.coffee
View
10 lib/convert.coffee
@@ -4,12 +4,12 @@ htmlparser = require 'htmlparser'
stringLiteral = (html) ->
inspect html.trim()
-exports.convert = (html, buffer, done) ->
+exports.convert = (html, stream, callback = (->)) ->
depth = 0
emit = (code) ->
- buffer.write Array(depth + 1).join(' ') + code + '\n'
+ stream.write Array(depth + 1).join(' ') + code + '\n'
nest = (callback) ->
depth++
@@ -83,15 +83,15 @@ exports.convert = (html, buffer, done) ->
throw 'omg'
handler = new htmlparser.DefaultHandler (err, dom) =>
- return done err if err
+ return callback err if err
try
visit.array dom
catch exception
err = exception
- done err
+ callback err
try
parser = new htmlparser.Parser(handler)
parser.parseComplete(html)
catch exception
- done exception
+ callback exception

0 comments on commit 44d2cc5

Please sign in to comment.