{"id":16665679,"url":"https://github.com/zmmbreeze/ubbparser","last_synced_at":"2025-04-09T19:15:16.109Z","repository":{"id":2393166,"uuid":"3359437","full_name":"zmmbreeze/UBBParser","owner":"zmmbreeze","description":"A javascript bbcode parser for browser","archived":false,"fork":false,"pushed_at":"2012-11-28T06:47:38.000Z","size":862,"stargazers_count":27,"open_issues_count":4,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T19:15:11.609Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zencode.in/UBBParser/","language":"JavaScript","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/zmmbreeze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-05T13:11:01.000Z","updated_at":"2022-05-18T09:41:12.000Z","dependencies_parsed_at":"2022-09-15T20:51:05.516Z","dependency_job_id":null,"html_url":"https://github.com/zmmbreeze/UBBParser","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FUBBParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FUBBParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FUBBParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmmbreeze%2FUBBParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmmbreeze","download_url":"https://codeload.github.com/zmmbreeze/UBBParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094987,"owners_count":21046770,"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-12T11:07:54.613Z","updated_at":"2025-04-09T19:15:16.075Z","avatar_url":"https://github.com/zmmbreeze.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"UBBParser is a UBB code parser writing in javascript.\nIt is highly flexible and easy to custom. Support major desktop browser like IE 6+,Firefox10+,Safari5+,Opera,Chrome.\n\n#License\nMIT.\nBe pleasure to fork and modify it.\n\n#Feature:\nConvert UBB string to HTML string;\nConvert HTML element to UBB string, parse by element style not html string;\nAuto correct UBB string;\nCustom your own UBB tag;\n\n#Demo:\n    \n    var parser = new UBB({\n            defaultColor: '#000000',            // [option] color of all text element\n            linkDefaultColor: '#006699',        // [option] color of a elment\n            flashImage: '/skin/imgs/flash.png', // [option] flash image to show\n            tags: {\n                newtagname: {\n                    parseHTML: function(nodeName, node, re) {\n                        // define which dom node to convert\n                        // node is a jquery object\n                        if (nodeName === 'div' \u0026\u0026 node[0].className === 'gui-ubb-ref') {\n                            // return prefix string\n                            re.prefix = '[ref]' + (re.prefix || '');\n                            // return suffix string\n                            re.suffix = (re.suffix || '') + '[/ref]';\n                        }\n                    },\n                    parseUBB: function(node, sonString, setting) {\n                        // parser will find a matched tag for you\n                        // return UBB string include sonString\n                        return '\u003cdiv class=\"gui-ubb-ref\"\u003e' + sonString + '\u003c/div\u003e';\n                    },\n                    // string.\n                    // Specified which tag can be contained.\n                    // '' or undefined indicate it can't contian any tag.\n                    // '*' indicate it can contian any tag.\n                    canContains: 'bold,italic,color,url,image',\n                    // bool.\n                    // If true, then this tag can contains '\\n'.\n                    canWrap: 0,\n                    // bool.\n                    // If true, then the '\\n' right after this tag should be ignore.\n                    isBlock: 0,\n                    noAttr: 1\n                }\n            }\n        });\n    // convert HTML element to UBB string\n    parser.HTMLtoUBB($('#container'));\n    // convert UBB string to HTML string\n    parser.UBBtoHTML('[bold]aaa[/bold]');\n    // auto correct UBB string\n    parser.fixUBB('[bold]aaa');   // ==\u003e echo [bold]aaa[/bold]\n\nPlease check index.html for detail.\n\n#NOTE:\nWhen converting HTML elements to UBB string, UBBParser can deal with whitespace and newline in pre style. But in case of IE 6/7/8's bug, it's not work very well in this situation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmmbreeze%2Fubbparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmmbreeze%2Fubbparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmmbreeze%2Fubbparser/lists"}