Skip to content

I want to read a html, and convert to markdown, but failed #11

@base64coder

Description

@base64coder
var html2markdown = require('html2markdown');
var fs = require('fs');
var http = require('http');
http.createServer(function(req, res){
	fs.readFile('index.html',function (err, data){
		if (err) throw new Error(err);

		res.writeHead(200, {'Content-Type': 'text/html','Content-Length':data.length});
		res.write(html2markdown(data));
		res.end();
	});
}).listen(8000);

ERROR:

`
L:\github\Java\springmvc-cookbook\cloudstreetmarket-parent\cloudstreetmarket-webapp\src\main\webapp\static\node_modules\html2markdown\markdown_html_parser.js:105
match = html.match( startTag );
^

TypeError: html.match is not a function
at HTMLParser (L:\github\Java\springmvc-cookbook\cloudstreetmarket-parent\cloudstreetmarket-webapp\src\main\webapp\static\node_modules\html2markdown\markdown_html_parser.js:105:19)
at html2markdown (L:\github\Java\springmvc-cookbook\cloudstreetmarket-parent\cloudstreetmarket-webapp\src\main\webapp\static\node_modules\html2markdown\html2markdown.js:197:2)
at module.exports (L:\github\Java\springmvc-cookbook\cloudstreetmarket-parent\cloudstreetmarket-webapp\src\main\webapp\static\node_modules\html2markdown\index.js:7:10)
at L:\github\Java\springmvc-cookbook\cloudstreetmarket-parent\cloudstreetmarket-webapp\src\main\webapp\static\js\html2markdown.js:16:13
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions