{"id":16315182,"url":"https://github.com/robrwo/plack-middleware-text-minify","last_synced_at":"2025-05-05T19:52:42.704Z","repository":{"id":56831648,"uuid":"320551712","full_name":"robrwo/Plack-Middleware-Text-Minify","owner":"robrwo","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-18T16:05:11.000Z","size":71,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-16T17:56:48.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","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/robrwo.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-11T11:13:53.000Z","updated_at":"2024-12-18T16:05:15.000Z","dependencies_parsed_at":"2022-08-28T21:02:34.873Z","dependency_job_id":"825925fb-539e-47dd-93ed-5c0a6ede59be","html_url":"https://github.com/robrwo/Plack-Middleware-Text-Minify","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FPlack-Middleware-Text-Minify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FPlack-Middleware-Text-Minify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FPlack-Middleware-Text-Minify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FPlack-Middleware-Text-Minify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robrwo","download_url":"https://codeload.github.com/robrwo/Plack-Middleware-Text-Minify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252566539,"owners_count":21769055,"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-10-10T21:56:27.187Z","updated_at":"2025-05-05T19:52:42.682Z","avatar_url":"https://github.com/robrwo.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nPlack::Middleware::Text::Minify - remove HTML indentation on the fly\n\n# VERSION\n\nversion v0.4.2\n\n# SYNOPSIS\n\n```perl\nuse Plack::Builder;\n\nbuilder {\n\n  enable \"Text::Minify\",\n      path =\u003e qr{\\.(html|css|js)},\n      type =\u003e qr{^text/};\n\n...\n\n};\n```\n\n# DESCRIPTION\n\nThis middleware uses [Text::Minify::XS](https://metacpan.org/pod/Text%3A%3AMinify%3A%3AXS) to remove indentation and\ntrailing whitespace from text content.\n\nIt will be disabled if the `psgix.no-minify` environment key is set\nto a true value. (Added in v0.2.0.)\n\n# ATTRIBUTES\n\n## path\n\nThis is a regex or callback that matches against `PATH_INFO`.  If it\ndoes not match, then the response won't be minified.\n\nThe callback takes the `PATH_INFO` and Plack environment as arguments.\n\nBy default, it will match against any path except for HTTP status\ncodes with no bodies, or request methods other than `GET` or `POST`.\n\n## type\n\nThis is a regex or callback that matches against the content-type. If it\ndoes not match, then the response won't be minified.\n\nThe callback takes the content-type header and the Plack reponse as\narguments.\n\nBy default, it will match against any \"text/\" MIME type.\n\n# SUPPORT FOR OLDER PERL VERSIONS\n\nThis module requires Perl v5.14 or newer.\n\nFuture releases may only support Perl versions released in the last ten years.\n\nIf you need this module on Perl v5.9.3, please use one of the v0.3.x\nversions of this module.  Significant bug or security fixes may be\nbackported to those versions.\n\n# KNOWN ISSUES\n\n## Use with templating directive that collapse whitespace\n\nIf you are using a templating system with directives that collapse\nwhitespace in HTML documents, e.g. in [Template-Toolkit](https://metacpan.org/pod/Template)\n\n```\n[%- IF something -%]\n  \u003cdiv class=\"foo\"\u003e\n    ...\n  \u003c/div\u003e\n[%- END -%]\n```\n\nthen you may find it worth removing these and letting the middleware\nclean up extra whitespace.\n\n## Collapsed Newlines\n\nThe underlying minifier does not understand markup, so newlines will\nstill be collapsed in HTML elements where whitespace is meaningful,\ne.g. `pre` or `textarea`.\n\n# SEE ALSO\n\n[Text::Minify::XS](https://metacpan.org/pod/Text%3A%3AMinify%3A%3AXS)\n\n[PSGI](https://metacpan.org/pod/PSGI)\n\n# SOURCE\n\nThe development version is on github at [https://github.com/robrwo/Plack-Middleware-Text-Minify](https://github.com/robrwo/Plack-Middleware-Text-Minify)\nand may be cloned from [git://github.com/robrwo/Plack-Middleware-Text-Minify.git](git://github.com/robrwo/Plack-Middleware-Text-Minify.git)\n\n# BUGS\n\nPlease report any bugs or feature requests on the bugtracker website\n[https://github.com/robrwo/Plack-Middleware-Text-Minify/issues](https://github.com/robrwo/Plack-Middleware-Text-Minify/issues)\n\nWhen submitting a bug or request, please include a test-file or a\npatch to an existing test-file that illustrates the bug or desired\nfeature.\n\n## Reporting Security Vulnerabilities\n\nSecurity issues should not be reported on the bugtracker website.  Please see `SECURITY.md` for instructions how to\nreport security vulnerabilities\n\n# AUTHOR\n\nRobert Rothenberg \u003crrwo@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2020-2024 by Robert Rothenberg.\n\nThis is free software, licensed under:\n\n```\nThe Artistic License 2.0 (GPL Compatible)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrwo%2Fplack-middleware-text-minify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobrwo%2Fplack-middleware-text-minify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrwo%2Fplack-middleware-text-minify/lists"}