Convert relative URLs to absolute URLs given an HTML source
Clone or download
Latest commit 48dcf4a Jan 14, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test change crazy regex to use cheerio Oct 21, 2013
.gitignore initial May 27, 2013
LICENSE Add license file and edit readme Jan 13, 2016
README.md Add license file and edit readme Jan 13, 2016
index.js change crazy regex to use cheerio Oct 21, 2013
package.json 1.0.0 Oct 21, 2013

README.md

Given an HTML source, it will convert any URL on links, images, scripts, etc to abosulte URLs.

Install

npm install rel-to-abs

Usage

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">

Credits

http://stackoverflow.com/questions/7544550/javascript-regex-to-change-all-relative-urls-to-absolute

Issue Reporting

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.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.