{"id":15044980,"url":"https://github.com/matafokka/bbcode-converter","last_synced_at":"2026-01-02T03:34:32.576Z","repository":{"id":57734078,"uuid":"261265254","full_name":"matafokka/bbcode-converter","owner":"matafokka","description":"Provides a class to effectively convert custom BBCode to HTML","archived":false,"fork":false,"pushed_at":"2021-07-31T19:24:10.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T13:23:30.911Z","etag":null,"topics":["bbcode","bbcode-converter","bbcode-parser","bbcode-to-html","gradle","html","java","java-11","java-8","java-library","maven","maven-repository"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matafokka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"matafokka","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-04T18:32:17.000Z","updated_at":"2025-01-17T17:13:30.000Z","dependencies_parsed_at":"2022-09-26T22:10:49.362Z","dependency_job_id":null,"html_url":"https://github.com/matafokka/bbcode-converter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matafokka%2Fbbcode-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matafokka%2Fbbcode-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matafokka%2Fbbcode-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matafokka%2Fbbcode-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matafokka","download_url":"https://codeload.github.com/matafokka/bbcode-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243451606,"owners_count":20293168,"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":["bbcode","bbcode-converter","bbcode-parser","bbcode-to-html","gradle","html","java","java-11","java-8","java-library","maven","maven-repository"],"created_at":"2024-09-24T20:51:18.438Z","updated_at":"2026-01-02T03:34:32.527Z","avatar_url":"https://github.com/matafokka.png","language":"Java","readme":"# BBCode Converter\nA Java library that provides a class to effectively convert custom BBCode to HTML. Also prevents XSS attacks.\n\nGrab it from maven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.matafokka\u003c/groupId\u003e\n  \u003cartifactId\u003ebbcode-converter\u003c/artifactId\u003e\n  \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOr for your building system from code [here](https://search.maven.org/artifact/io.github.matafokka/bbcode-converter/1.0/jar).\n\nYou can find the documentation [here](https://javadoc.io/doc/io.github.matafokka/bbcode-converter/latest/io/github/matafokka/bbcode_converter/BBCodeConverter.html).\n\n# Intro\nFirst of all, you've got 3 types of so-called \"tags\":\n1. **Simple tags**. These tags contains only one so-called part (string), i.e. \"\\[B\\]\", that will be replaced with another string, i.e. \"\\\u003cb\\\u003e\". These tags shouldn't be closed. Also, this tags contains HTML entities.\n1. **Complex tags**. These tags can contain 2 or 3 parts. Check [addComplexTag()](https://javadoc.io/static/io.github.matafokka/bbcode-converter/1.0/io/github/matafokka/bbcode_converter/BBCodeConverter.html#addComplexTag(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)) for more information.\n1. **URL entites**. Same as simple tags, but these will be used when parsing text between 1st and 2nd parts of a complex tag.\n\nNext, you need to know these rules:\n1. All tags are case-dependent. Don't add all the cases by yourself! Apply a code-style to your project, i.e. all tags should be either in a lower case or in a upper case.\n1. BBCodeConverter will escape all necessary HTML and URL entities. You don't need to add it by yourself.\n1. Put the output of toHtml() into `\u003cobject\u003e\u003c/object\u003e` block. This is needed to deal with bad markup.\n\n**List of included tags:**\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n**Tags added anyways**\n\n**Simple tags:**\n```\n\"\t=\u003e\t\u0026quot;\n'\t=\u003e\t\u0026apos;\n\u003c\t=\u003e\t\u0026lt;\n\u003e\t=\u003e\t\u0026gt;\n```\n\n**URL entities:**\n```\n\"\t=\u003e\t%22\n'\t=\u003e\t%27\n;\t=\u003e\t%3B\n\u003c\t=\u003e\t%3C\n\u003e\t=\u003e\t%3E\n```\n\n**Tags added when addDefaultTags = true**\n\n**Simple tags:**\n```\n[B]\t=\u003e\t\u003cb\u003e\n[/B]\t=\u003e\t\u003c/b\u003e\n[I]\t=\u003e\t\u003ci\u003e\n[/I]\t=\u003e\t\u003c/i\u003e\n[U]\t=\u003e\t\u003cu\u003e\n[/U]\t=\u003e\t\u003c/u\u003e\n[S]\t=\u003e\t\u003cs\u003e\n[/S]\t=\u003e\t\u003c/s\u003e\n```\n\n**Complex tags:**\n```\n[URL=\"http://\t\t\"]\t\t[/URL]\n\tV\t\tV\t\t  V\n\u003ca href=\"http://\t\"\u003e\"\t\t\u003c/a\u003e\n\n[URL=\"https://\t\t\"]\t\t[/URL]\n\tV\t\tV\t\t  V\n\u003ca href=\"https://\t\"\u003e\"\t\t\u003c/a\u003e\n\n[COLOR=\"\t\t\"]\t\t[/COLOR]\n\tV\t\tV\t\t  V\n\u003cspan style=\"color:\t;\"\u003e\t\t\u003c/span\u003e\n```\n\u003c/details\u003e\n\n# How to use\n0. Import the project :D\n```java\nimport io.github.matafokka.bbcode_converter.BBCodeConverter\n```\n\n1. Make an instance of this class:\n```java\n// With all default tags included\nBBCodeConverter conv = new BBCodeConverter();\nBBCodeConverter conv = new BBCodeConverter(true);\n\n// Only with necessary tags (HTML and URL-entities):\nBBCodeConverter conv = new BBCodeConverter(false);\n````\n\n2. Add your custom tags:\n```java\nconv.addSimpleTag(...);\nconv.addComplexTag(...);\nconv.addUrlEntity(...);\n```\n\n3. Use your converter:\n```java\nString output = conv.toHtml(input);\n```\n\n4. Put the output to your page or whatever. **DO NOT** escape the output!\n","funding_links":["https://ko-fi.com/matafokka"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatafokka%2Fbbcode-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatafokka%2Fbbcode-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatafokka%2Fbbcode-converter/lists"}