File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ var md = new MarkdownIt({
3737 }
3838});
3939
40- function writeMarkdown(input, output ) {
40+ function writeMarkdown(input) {
4141 var body = ' ' ;
4242 input.on(' data' , function(data) {
4343 body += data;
@@ -46,7 +46,7 @@ function writeMarkdown(input, output) {
4646 }
4747 });
4848 input.on(' end' , function () {
49- output .emit(' newContent' , md.render(body));
49+ io.sockets .emit(' newContent' , md.render(body));
5050 });
5151}
5252
@@ -103,7 +103,7 @@ function httpHandler(req, res) {
103103 break ;
104104
105105 case ' PUT' :
106- writeMarkdown(req, socket );
106+ writeMarkdown(req);
107107 res.writeHead(200);
108108 res.end ();
109109 break ;
@@ -113,9 +113,8 @@ function httpHandler(req, res) {
113113}
114114
115115io.sockets.on(' connection' , function(sock){
116- socket = sock;
117116 process.stdout.write(' connection established!' );
118- writeMarkdown(process.stdin, socket );
117+ writeMarkdown(process.stdin);
119118 process.stdin.resume ();
120119});
121120
You can’t perform that action at this time.
0 commit comments