{"id":18606061,"url":"https://github.com/hfagerlund/strip_anchors","last_synced_at":"2026-04-16T18:07:05.405Z","repository":{"id":164264928,"uuid":"148945968","full_name":"hfagerlund/strip_anchors","owner":"hfagerlund","description":"Custom Twig extension for RSS/Atom templates","archived":false,"fork":false,"pushed_at":"2018-09-15T23:05:00.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T19:46:45.903Z","etag":null,"topics":["php","phpunit","symfony","symfony4","twig","twig-extension","twig-filter"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hfagerlund.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-15T22:53:01.000Z","updated_at":"2020-07-13T21:32:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b7ef5d2-7468-44d7-8c92-465394de8c32","html_url":"https://github.com/hfagerlund/strip_anchors","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hfagerlund/strip_anchors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfagerlund%2Fstrip_anchors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfagerlund%2Fstrip_anchors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfagerlund%2Fstrip_anchors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfagerlund%2Fstrip_anchors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hfagerlund","download_url":"https://codeload.github.com/hfagerlund/strip_anchors/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfagerlund%2Fstrip_anchors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31897913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T17:33:00.867Z","status":"ssl_error","status_checked_at":"2026-04-16T17:32:57.401Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["php","phpunit","symfony","symfony4","twig","twig-extension","twig-filter"],"created_at":"2024-11-07T02:24:08.659Z","updated_at":"2026-04-16T18:07:05.384Z","avatar_url":"https://github.com/hfagerlund.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strip_anchors\n\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-%238892bf.svg?style=flat-square)](https://php.net/) [![Minimum Symfony Version](https://img.shields.io/badge/symfony-%3E%3D%204.1-%2332a0d6.svg?style=flat-square)](https://github.com/symfony/symfony/) [![Minimum Twig Version](https://img.shields.io/badge/twig-%3E%3D%202.5-%238e9e21.svg?style=flat-square)](https://github.com/twigphp/Twig/)\n\nThe `strip_anchors` [Twig (v.2.5.0)](https://github.com/twigphp/Twig/) filter removes all anchor links (ie. links pointing to different sections of the same page where they are located) from input.\n\n## Sample output:\n\n```html\n\u003c!-- BEFORE applying filter: --\u003e\n\u003ch2\u003e\u003ca href=\"#features\"\u003eFeatures of this Twig Extension\u003c/a\u003e\u003c/h2\u003e\n\n\u003c!-- AFTER applying `strip_anchors` filter: --\u003e\n\u003ch2\u003eFeatures of this Twig Extension\u003c/h2\u003e\n```\n\n**Please note:** This repository only shows directories and files from a [Symfony 4 skeleton project](https://github.com/hfagerlund/strip_anchors#how-to-use-in-symfony-4) that **need to be added or modified** to enable the 'strip_anchors' Twig extension.\n\n## Usage\nUse this Twig filter in an RSS feed template to help transform HTML input into valid RSS 2.0, as shown in the following examples:\n\n### Example:\n```\n{{ item.content|strip_anchors }}\n```\n\n### Example 2: use in combination with another filter\n```\n\u003c-- excerpt from rss.xml.twig: --\u003e\n\n\u003ccontent:encoded\u003e\n   \u003c![CDATA[\n    {{ item.content|md2html|strip_anchors }}\n   ]]\u003e\n\u003c/content:encoded\u003e\n```\n\n### How To use in Symfony 4\nThis repository shows how this custom Twig extension (ie. the `strip_anchors` Twig filter) can be implemented in a Symfony 4 project structure created using [symfony/skeleton](https://symfony.com/doc/current/best_practices/creating-the-project.html).\n\n#### Requirements\n* [PHP](https://php.net/) (v.7.1.16)\n* [Composer](https://getcomposer.org/) (v.1.6.5)\n  * [symfony/skeleton](https://github.com/symfony/skeleton) (v.4.1.4.2)\n  * [symfony/twig-bundle](https://github.com/symfony/twig-bundle) (v.4.1.4)\n  * [symfony/web-server-bundle](https://github.com/symfony/web-server-bundle) (optional: for dev environment)\n  * [phpunit/phpunit](https://packagist.org/packages/phpunit/phpunit) (v.7.3) OR [symfony/phpunit-bridge](https://github.com/symfony/phpunit-bridge), [symfony/test-pack](https://github.com/symfony/test-pack)\n\n(Copyrights for the above remain with their respective owners.)\n\n#### Installation\n* Create a new project:\n```\n$ composer create-project symfony/skeleton my-project\n```\n\n* Clone this repository (as shown below) and make the corresponding modifications:\n\n```\n$ git clone https://github.com/hfagerlund/strip_anchors.git\n```\n\n## Run (dev) Server:\n\n```\n$ php bin/console server:run\n```\n\n## Run Tests:\nFrom the project **root dir**, run one of the following:\n\n### using phpunit/phpunit:\n```\n$ ./vendor/phpunit/phpunit/phpunit ./tests/\n```\n\nOr (recommended):\n### using symfony/phpunit-bridge\n```\n$ ./bin/phpunit\n```\n\n## License\nCopyright (c) 2018 Heini Fagerlund. Licensed under the [MIT License](https://github.com/hfagerlund/strip_anchors/blob/master/LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfagerlund%2Fstrip_anchors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhfagerlund%2Fstrip_anchors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfagerlund%2Fstrip_anchors/lists"}