Latest 0.2.0
Homepage https://github.com/werner77/WEBBCode
License MIT
Platforms ios 6.0
Authors

[![CI Status](http://img.shields.io/travis/Werner Altewischer/WEBBCode.svg?style=flat)](https://travis-ci.org/Werner Altewischer/WEBBCode)
Version
License
Platform

This is a lean and mean SAX style parser for BBCode written in Objective C/C.

It has support for output to HTML and NSAttributedString (work in progress) for simple BBCode.

It is totally pluggable and extensible to allow for full customization.

The pod has two sub specs:

Core: which contains the BBCode parser and model classes.
HTML: which contains support for transformation to HTML.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Example usage to parse:


WEBBCodeParser *parser = [WEBBCodeParser new];
parser.encoding = NSUTF8StringEncoding;
parser.delegate = self;

NSData *data = [NSData dataWithContentsOfFile:@"somefile"];
[parser parseData:data error:nil];

Example to convert BBCode to HTML:


WEBBCodeHtmlConverter *converter = [WEBBCodeHtmlConverter new];
converter.transformer = [WEBBCodeHtmlDefaultTagTransformer new];
converter.useParagraphs = NO;

NSString *input = @"some [b]bb code[/b]"";
NSError *error = nil;
NSString *output = [converter htmlFromBBCode:input error:&error];

if (output == nil) {
    NSLog(@"Error occurred: %@", error);
}

Also see the test cases for more code examples.

Requirements

Installation

WEBBCode is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "WEBBCode"

Author

Werner Altewischer, [email protected]

License

WEBBCode is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "WEBBCode",
    "version": "0.2.0",
    "summary": "A fast SAX style parser for BBCode in Objective C with support for various transformations",
    "description": "This is a lean and mean SAX style parser for BBCode written in Objective C/C.nnIt has support for output to HTML and NSAttributedString (work in progress) for simple BBCode.nnIt is totally pluggable and extensible to allow for full customization.",
    "homepage": "https://github.com/werner77/WEBBCode",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Werner Altewischer": "[email protected]"
    },
    "source": {
        "git": "https://github.com/werner77/WEBBCode.git",
        "tag": "0.2.0"
    },
    "platforms": {
        "ios": "6.0"
    },
    "subspecs": [
        {
            "name": "Core",
            "source_files": "WEBBCode/Classes/Core/**/*",
            "public_header_files": "WEBBCode/Classes/Core/**/*.h"
        },
        {
            "name": "HTML",
            "source_files": "WEBBCode/Classes/HTML/**/*",
            "public_header_files": "WEBBCode/Classes/HTML/**/*.h",
            "dependencies": {
                "WEBBCode/Core": []
            }
        }
    ]
}

Pin It on Pinterest

Share This