{"id":18561194,"url":"https://github.com/apostrophecms/absolution","last_synced_at":"2025-04-10T02:31:28.130Z","repository":{"id":10708942,"uuid":"12955944","full_name":"apostrophecms/absolution","owner":"apostrophecms","description":"Accepts HTML and a base URL, and returns HTML with absolute URLs. Great for generating valid RSS feed entries.","archived":false,"fork":false,"pushed_at":"2024-01-25T14:25:01.000Z","size":33,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-02T00:08:23.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apostrophecms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-09-19T18:25:04.000Z","updated_at":"2025-03-30T02:18:23.000Z","dependencies_parsed_at":"2024-06-19T06:11:56.178Z","dependency_job_id":"7d56c83c-223c-4f73-b16e-417af21b06bb","html_url":"https://github.com/apostrophecms/absolution","commit_stats":{"total_commits":13,"total_committers":9,"mean_commits":"1.4444444444444444","dds":0.7692307692307692,"last_synced_commit":"26834fb87f7c3892f278785f7ac3bca8a38bf7c8"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fabsolution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fabsolution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fabsolution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fabsolution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apostrophecms","download_url":"https://codeload.github.com/apostrophecms/absolution/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144207,"owners_count":21054886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T22:06:06.996Z","updated_at":"2025-04-10T02:31:27.823Z","avatar_url":"https://github.com/apostrophecms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# absolution\n\n\u003ca href=\"http://apostrophenow.org/\"\u003e\u003cimg src=\"https://raw.github.com/punkave/absolution/master/logos/logo-box-madefor.png\" align=\"right\" /\u003e\u003c/a\u003e\n\n`absolution` accepts HTML and a base URL, and returns HTML with absolute URLs. Great for generating valid RSS feeds.\n\n`absolution` is not too picky about your HTML.\n\n## Requirements\n\n`absolution` is intended for use with Node. That's pretty much it. All of its npm dependencies are pure JavaScript. `absolution` is built on the excellent `htmlparser2` module.\n\n## How to use\n\n`npm install absolution`\n\n```javascript\nvar absolution = require('absolution');\n\nvar dirty = '\u003ca href=\"/foo\"\u003eFoo!\u003c/a\u003e';\nvar clean = absolution(dirty, 'http://example.com');\n\n// clean is now:\n// \u003ca href=\"http://example.com/foo\"\u003eFoo!\u003c/a\u003e\n```\n\nBoom!\n\nIf you want to do further processing of each absolute URL, you can also pass a decorator function:\n\n```javascript\nvar clean = absolution(dirty, 'http://example.com', {\n  decorator: function(url) {\n    return 'http://mycoolthing.com?url=' + encodeURIComponent(url);\n  }\n});\n```\n\n## Having issues with SVG markup?\n\n\u003e How can I keep SVG self-closing tags intact?\n\nYou can add custom self-closing tags via the `selfClosing` option:\n\n```javascript\nvar absolution = require('absolution');\n\nvar dirty = `\n  \u003csvg width=\"100\" height=\"100\" xmlns=\"http://www.w3.org/2000/svg\"\u003e\n    \u003ca href=\"/docs/Web/SVG/Element/circle\"\u003e\n      \u003ccircle cx=\"50\" cy=\"40\" r=\"35\"/\u003e\n    \u003c/a\u003e\n    \u003cpath d=\"M 10 10 H 90 V 90 H 10 L 10 10\"/\u003e\n    \u003ccircle cx=\"10\" cy=\"90\" r=\"2\" fill=\"red\"/\u003e\n  \u003c/svg\u003e\n`;\nvar clean = absolution(dirty, 'http://example.com', {\n  selfClosing: [\n    // keep default `selfClosing` tags:\n    ...absolution.defaults.selfClosing,\n\n    // add custom tags:\n    'path',\n    'circle'\n  ]\n});\n\n// clean is now:\n// \u003csvg width=\"100\" height=\"100\" xmlns=\"http://www.w3.org/2000/svg\"\u003e\n//   \u003ca href=\"http://example.com/docs/Web/SVG/Element/circle\"\u003e\n//     \u003ccircle cx=\"50\" cy=\"40\" r=\"35\" /\u003e\n//   \u003c/a\u003e\n//   \u003cpath d=\"M 10 10 H 90 V 90 H 10 L 10 10\" /\u003e\n//   \u003ccircle cx=\"10\" cy=\"10\" r=\"2\" fill=\"red\" /\u003e\n// \u003c/svg\u003e\n```\n\n## Changelog\n\n1.0.2: Updates to lodash v4 and mocha v7 for security vulnerability fixes. Also update package metadata.\n\n1.0.0: no new changes; declared stable as with the addition of the decorator option there's little left to do, and all tests are passing nicely.\n\n0.2.0: decorator option added.\n\n0.1.0: initial release.\n\n## About P'unk Avenue and Apostrophe\n\n`absolution` was created at [P'unk Avenue](http://punkave.com) for use in Apostrophe, an open-source content management system built on node.js. If you like `absolution` you should definitely [check out apostrophenow.org](http://apostrophenow.org). Also be sure to visit us on [github](http://github.com/punkave).\n\n## Support\n\nFeel free to open issues on [github](http://github.com/punkave/absolution).\n\n\u003ca href=\"http://punkave.com/\"\u003e\u003cimg src=\"https://raw.github.com/punkave/absolution/master/logos/logo-box-builtby.png\" /\u003e\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms%2Fabsolution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostrophecms%2Fabsolution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms%2Fabsolution/lists"}