Given an HTML source, it will convert any URL on links, images, scripts, etc to abosulte URLs.
npm install rel-to-abs
var converter = require('rel-to-abs');
var converted = converter.convert('<img src="foo.png">', 'http://mysite.com');
converted == <img src="http://mysite.com/foo.png">
http://stackoverflow.com/questions/7544550/javascript-regex-to-change-all-relative-urls-to-absolute
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.