inline-source icon indicating copy to clipboard operation
inline-source copied to clipboard

blank img src

Open tianyk opened this issue 7 years ago • 0 comments

We have some rescue projects that are not standardized.

like this:

<img src="" alt="">

What should I do in this situation, thanks.

const { inlineSource } = require('inline-source');

(async () => {
	const html = await inlineSource('<img src="" alt="blank">', {
		attribute: false,
		compress: false,
		swallowErrors: true,
		rootpath: '.'
	});

	console.log(html);
})().catch(console.error);
TypeError: filepath.replace is not a function
    at getSourcepath (/Users/doog/Downloads/793111/node_modules/inline-source/lib/utils.js:164:23)
    at DomHandler.htmlparser.Parser.htmlparser.DomHandler [as _callback] (/Users/doog/Downloads/793111/node_modules/inline-source/lib/parse.js:44:28)
    at DomHandler._handleCallback.DomHandler.onerror (/Users/doog/Downloads/793111/node_modules/domhandler/index.js:52:8)
    at DomHandler.onend (/Users/doog/Downloads/793111/node_modules/domhandler/index.js:46:7)
    at Parser.onend (/Users/doog/Downloads/793111/node_modules/htmlparser2/lib/Parser.js:310:32)
    at Tokenizer._finish (/Users/doog/Downloads/793111/node_modules/htmlparser2/lib/Tokenizer.js:838:12)
    at Tokenizer.end (/Users/doog/Downloads/793111/node_modules/htmlparser2/lib/Tokenizer.js:829:25)
    at Parser.end (/Users/doog/Downloads/793111/node_modules/htmlparser2/lib/Parser.js:338:18)
    at Parser.parseComplete (/Users/doog/Downloads/793111/node_modules/htmlparser2/lib/Parser.js:330:7)
    at Promise (/Users/doog/Downloads/793111/node_modules/inline-source/lib/parse.js:79:14)

tianyk avatar Jan 22 '19 02:01 tianyk