{"id":16358294,"url":"https://github.com/chi-teck/text-formatter","last_synced_at":"2026-05-05T04:07:42.856Z","repository":{"id":13122970,"uuid":"15804868","full_name":"Chi-teck/text-formatter","owner":"Chi-teck","description":"A tool for handling the filtering of content.","archived":false,"fork":false,"pushed_at":"2014-01-10T17:53:25.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T13:26:48.243Z","etag":null,"topics":["drupal","drupal-text-filters","html-tags","php","text-formatting"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chi-teck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-10T17:39:28.000Z","updated_at":"2015-09-15T17:01:09.000Z","dependencies_parsed_at":"2022-09-10T22:51:02.055Z","dependency_job_id":null,"html_url":"https://github.com/Chi-teck/text-formatter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chi-teck%2Ftext-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chi-teck%2Ftext-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chi-teck%2Ftext-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chi-teck%2Ftext-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chi-teck","download_url":"https://codeload.github.com/Chi-teck/text-formatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239707997,"owners_count":19684156,"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":["drupal","drupal-text-filters","html-tags","php","text-formatting"],"created_at":"2024-10-11T02:05:16.364Z","updated_at":"2025-12-23T23:30:14.068Z","avatar_url":"https://github.com/Chi-teck.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Text Formatter\n\nA tool for handling the filtering of content.\n\nThe code based on Drupal text filters system.\nCheck out the [documentation](https://drupal.org/node/213156) about how Drupal text filters work.\n\nUsage\n===\n\n```php\n\u003c?php\n\nuse ChiTeck\\TextFormatter\\TextFormatter;\nuse ChiTeck\\TextFormatter\\Filters\\Html;\nuse ChiTeck\\TextFormatter\\Filters\\Autop;\nuse ChiTeck\\TextFormatter\\Filters\\Corrector;\n\n$formatter = new TextFormatter([\n    new Html(['allowedTags' =\u003e '\u003ca\u003e\u003cul\u003e\u003cli\u003e\u003cp\u003e\u003cbr\u003e']),\n    new Autop(),\n    new Corrector(),\n]);\n\n$safeText = $formatter-\u003echeckMarkup($text);\n```\n\nSupported filters\n===\n\n* Html – Limits allowed HTML tags.\n* Autop – Converts line breaks into `\u003cp\u003e` and `\u003cbr\u003e` in an intelligent fashion.\n* Corrector – Makes sure that HTML tags are properly closed.\n* Escape – Escapes all HTML tags, so they will be visible instead of being effective.\n* Nofollow – Adds `rel=\"nofollow\"` to all links.\n\nLicense\n===\nText Formatter licensed under GPLv2.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchi-teck%2Ftext-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchi-teck%2Ftext-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchi-teck%2Ftext-formatter/lists"}