Skip to content

Commit

Permalink
Correct term is "stream" not "buffer"
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonbloom committed Sep 20, 2011
1 parent 78a7a7d commit 44d2cc5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/convert.coffee
Expand Up @@ -4,12 +4,12 @@ htmlparser = require 'htmlparser'
stringLiteral = (html) -> stringLiteral = (html) ->
inspect html.trim() inspect html.trim()


exports.convert = (html, buffer, done) -> exports.convert = (html, stream, callback = (->)) ->


depth = 0 depth = 0


emit = (code) -> emit = (code) ->
buffer.write Array(depth + 1).join(' ') + code + '\n' stream.write Array(depth + 1).join(' ') + code + '\n'


nest = (callback) -> nest = (callback) ->
depth++ depth++
Expand Down Expand Up @@ -83,15 +83,15 @@ exports.convert = (html, buffer, done) ->
throw 'omg' throw 'omg'


handler = new htmlparser.DefaultHandler (err, dom) => handler = new htmlparser.DefaultHandler (err, dom) =>
return done err if err return callback err if err
try try
visit.array dom visit.array dom
catch exception catch exception
err = exception err = exception
done err callback err


try try
parser = new htmlparser.Parser(handler) parser = new htmlparser.Parser(handler)
parser.parseComplete(html) parser.parseComplete(html)
catch exception catch exception
done exception callback exception

0 comments on commit 44d2cc5

Please sign in to comment.