{"id":28911721,"url":"https://github.com/markdown-it/mdurl","last_synced_at":"2025-06-21T19:10:48.492Z","repository":{"id":27927303,"uuid":"31419613","full_name":"markdown-it/mdurl","owner":"markdown-it","description":"URL utilities for markdown-it","archived":false,"fork":false,"pushed_at":"2023-12-01T05:03:25.000Z","size":35,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-06T17:33:44.989Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markdown-it.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-02-27T13:09:23.000Z","updated_at":"2024-05-15T09:13:07.000Z","dependencies_parsed_at":"2024-01-15T00:01:47.355Z","dependency_job_id":"ce37fd96-dc83-44d4-9243-ea1b4b1b6e91","html_url":"https://github.com/markdown-it/mdurl","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":0.6,"last_synced_commit":"ed058152769370008896679d08e8733bf4354c55"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/markdown-it/mdurl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmdurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmdurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmdurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmdurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markdown-it","download_url":"https://codeload.github.com/markdown-it/mdurl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdown-it%2Fmdurl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259989507,"owners_count":22942324,"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":"2025-06-21T19:09:39.529Z","updated_at":"2025-06-21T19:10:48.481Z","avatar_url":"https://github.com/markdown-it.png","language":"JavaScript","readme":"# mdurl\n\n[![CI](https://github.com/markdown-it/mdurl/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/mdurl/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/mdurl.svg?style=flat)](https://www.npmjs.org/package/mdurl)\n\n\u003e URL utilities for [markdown-it](https://github.com/markdown-it/markdown-it) parser.\n\n\n## API\n\n### .encode(str [, exclude, keepEncoded]) -\u003e String\n\nPercent-encode a string, avoiding double encoding. Don't touch `/a-zA-Z0-9/` +\nexcluded chars + `/%[a-fA-F0-9]{2}/` (if not disabled). Broken surrorates are\nreplaced with `U+FFFD`.\n\nParams:\n\n- __str__ - input string.\n- __exclude__ - optional, `;/?:@\u0026=+$,-_.!~*'()#`. Additional chars to keep intact\n  (except `/a-zA-Z0-9/`).\n- __keepEncoded__ - optional, `true`. By default it skips already encoded sequences\n  (`/%[a-fA-F0-9]{2}/`). If set to `false`, `%` will be encoded.\n\n\n### encode.defaultChars, encode.componentChars\n\nYou can use these constants as second argument to `encode` function.\n\n - `encode.defaultChars` is the same exclude set as in the standard `encodeURI()` function\n - `encode.componentChars` is the same exclude set as in the `encodeURIComponent()` function\n\nFor example, `encode('something', encode.componentChars, true)` is roughly the equivalent of\nthe `encodeURIComponent()` function (except `encode()` doesn't throw).\n\n\n### .decode(str [, exclude]) -\u003e String\n\nDecode percent-encoded string. Invalid percent-encoded sequences (e.g. `%2G`)\nare left as is. Invalid UTF-8 characters are replaced with `U+FFFD`.\n\n\nParams:\n\n- __str__ - input string.\n- __exclude__ - set of characters to leave encoded, optional, `;/?:@\u0026=+$,#`.\n\n\n### decode.defaultChars, decode.componentChars\n\nYou can use these constants as second argument to `decode` function.\n\n - `decode.defaultChars` is the same exclude set as in the standard `decodeURI()` function\n - `decode.componentChars` is the same exclude set as in the `decodeURIComponent()` function\n\nFor example, `decode('something', decode.defaultChars)` has the same behavior as\n`decodeURI('something')` on a correctly encoded input.\n\n\n### .parse(url, slashesDenoteHost) -\u003e urlObs\n\nParse url string. Similar to node's [url.parse](http://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost), but without any\nnormalizations and query string parse.\n\n - __url__ - input url (string)\n - __slashesDenoteHost__ - if url starts with `//`, expect a hostname after it. Optional, `false`.\n\nResult (hash):\n\n- protocol\n- slashes\n- auth\n- port\n- hostname\n- hash\n- search\n- pathname\n\nDifference with node's `url`:\n\n1. No leading slash in paths, e.g. in `url.parse('http://foo?bar')` pathname is\n   ``, not `/`\n2. Backslashes are not replaced with slashes, so `http:\\\\example.org\\` is\n   treated like a relative path\n3. Trailing colon is treated like a part of the path, i.e. in\n   `http://example.org:foo` pathname is `:foo`\n4. Nothing is URL-encoded in the resulting object, (in joyent/node some chars\n   in auth and paths are encoded)\n5. `url.parse()` does not have `parseQueryString` argument\n6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n   which can be constructed using other parts of the url.\n\n\n### .format(urlObject)\n\nFormat an object previously obtained with `.parse()` function. Similar to node's\n[url.format](http://nodejs.org/api/url.html#url_url_format_urlobj).\n\n\n## License\n\n[MIT](https://github.com/markdown-it/mdurl/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdown-it%2Fmdurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkdown-it%2Fmdurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdown-it%2Fmdurl/lists"}