{"id":20237001,"url":"https://github.com/imerr/golonkabbcodeparser","last_synced_at":"2025-05-07T10:32:59.125Z","repository":{"id":42953993,"uuid":"155569544","full_name":"imerr/GolonkaBBCodeParser","owner":"imerr","description":"Copy of the now deleted bbcodeparser by golonkla","archived":false,"fork":false,"pushed_at":"2022-03-26T00:41:05.000Z","size":17,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-09-07T17:58:00.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/imerr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-31T14:18:31.000Z","updated_at":"2023-09-07T17:58:00.750Z","dependencies_parsed_at":"2022-08-19T13:10:40.715Z","dependency_job_id":null,"html_url":"https://github.com/imerr/GolonkaBBCodeParser","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imerr%2FGolonkaBBCodeParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imerr%2FGolonkaBBCodeParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imerr%2FGolonkaBBCodeParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imerr%2FGolonkaBBCodeParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imerr","download_url":"https://codeload.github.com/imerr/GolonkaBBCodeParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224589217,"owners_count":17336440,"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-14T08:24:11.051Z","updated_at":"2024-11-14T08:24:11.635Z","avatar_url":"https://github.com/imerr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Version](https://img.shields.io/github/release/golonka/bbcodeparser.svg?style=flat-square)](https://github.com/golonka/bbcodeparser/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/golonka/BBCodeParser/master.svg?style=flat-square)](https://travis-ci.org/golonka/BBCodeParser)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/golonka/bbcodeparser/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/golonka/bbcodeparser/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/golonka/bbcodeparser/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/golonka/bbcodeparser)\n[![Total Downloads](https://img.shields.io/packagist/dt/golonka/bbcodeparser.svg?style=flat-square)](https://packagist.org/packages/golonka/bbcodeparser)\n\nThe ``Golonka\\BBCodeParser`` package will help you with parsing BBCode.\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require golonka/bbcodeparser\n```\n\n## Usage\nTo parse some text it's as easy as this!\n``` php\n$bbcode = new Golonka\\BBCode\\BBCodeParser;\n\necho $bbcode-\u003eparse('[b]Bold Text![/b]');\n// \u003cstrong\u003eBold Text!\u003c/strong\u003e\n```\nWould like the parser to not use all bbcodes? Just do like this.\n``` php\n$bbcode = new Golonka\\BBCode\\BBCodeParser;\n\necho $bbcode-\u003eonly('bold', 'italic')\n            -\u003eparse('[b][u]Bold[/u] [i]Italic[/i]![/b]');\n            // \u003cstrong\u003e[u]Bold[/u] \u003cem\u003eItalic\u003c/em\u003e!\u003c/strong\u003e\n\necho $bbcode-\u003eexcept('bold')\n            -\u003eparse('[b]Bold[/b] [i]Italic[/i]');\n            // [b]Bold[/b] \u003cem\u003eItalic\u003c/em\u003e\n```\n\nBy default the parser is case sensitive. But if you would like the parser to accept tags like `` [B]Bold Text[/B] `` it's really easy.\n``` php\n$bbcode = new Golonka\\BBCode\\BBCodeParser;\n\n// Case insensitive\necho $bbcode-\u003eparse('[b]Bold[/b] [I]Italic![/I]', true);\n     // \u003cstrong\u003eBold\u003c/strong\u003e \u003cem\u003eItalic!\u003c/em\u003e\n\n// Or like this\n\necho $bbcode-\u003eparseCaseInsensitive('[b]Bold[/b] [i]Italic[/i]');\n     // \u003cstrong\u003eBold\u003c/strong\u003e \u003cem\u003eItalic!\u003c/em\u003e\n```\nYou could also make it more explicit that the parser is case sensitive by using another helper function.\n``` php\n    $bbcode = new Golonka\\BBCode\\BBCodeParser;\n\n    echo $bbcode-\u003eparseCaseSensitive('[b]Bold[/b] [I]Italic![/I]');\n         // \u003cstrong\u003eBold\u003c/strong\u003e [I]Italic![/I]\n```\n\nIf you would like to completely remove all BBCode it's just one function call away.\n``` php\n    $bbcode = new Golonka\\BBCode\\BBCodeParser;\n\n    echo $bbcode-\u003estripBBCodeTags('[b]Bold[/b] [i]Italic![/i]');\n         // Bold Italic!\n```\n\n## Laravel integration\nThe integration into Laravel is really easy, and the method is the same for both Laravel 4 and Laravel 5.\nJust open your ``app.php`` config file.\n\nIn there you just add this to your providers array\n``` php\n'Golonka\\BBCode\\BBCodeParserServiceProvider'\n```\n\nAnd this to your facades array\n``` php\n'BBCode' =\u003e 'Golonka\\BBCode\\Facades\\BBCodeParser'\n```\n\nThe syntax is the same as if you would use it in vanilla PHP but with the ``BBCode::`` before the methods.\nHere are some examples.\n``` php\n// Simple parsing\necho BBCode::parse('[b]Bold Text![/b]');\n\n// Limiting the parsers with the only method\necho BBCode::only('bold', 'italic')\n        -\u003eparse('[b][u]Bold[/u] [i]Italic[/i]![/b]');\n        // \u003cstrong\u003e[u]Bold[/u] \u003cem\u003eItalic\u003c/em\u003e!\u003c/strong\u003e\n\n// Or the except method\necho BBCode::except('bold')\n        -\u003eparse('[b]Bold[/b] [i]Italic[/i]');\n        // [b]Bold[/b] \u003cem\u003eItalic\u003c/em\u003e\n```\n\n## Testing\n\n``` bash\n$ phpunit\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Joseph Landberg](https://github.com/golonka)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimerr%2Fgolonkabbcodeparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimerr%2Fgolonkabbcodeparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimerr%2Fgolonkabbcodeparser/lists"}