https://github.com/kefirfromperm/kefirbb
A flexible Java text processor. BB, BBCode, BB-code, HTML, Textile, Markdown, parser, translator, converter.
https://github.com/kefirfromperm/kefirbb
bbcode converter html html-filtration java java-library markdown text-processing textile translator
Last synced: 25 days ago
JSON representation
A flexible Java text processor. BB, BBCode, BB-code, HTML, Textile, Markdown, parser, translator, converter.
- Host: GitHub
- URL: https://github.com/kefirfromperm/kefirbb
- Owner: kefirfromperm
- License: lgpl-3.0
- Created: 2011-07-21T15:58:16.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2025-02-07T18:23:17.000Z (over 1 year ago)
- Last Synced: 2025-02-07T19:26:01.943Z (over 1 year ago)
- Topics: bbcode, converter, html, html-filtration, java, java-library, markdown, text-processing, textile, translator
- Language: Java
- Homepage:
- Size: 508 KB
- Stars: 86
- Watchers: 8
- Forks: 14
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
KefirBB
=======
[](https://travis-ci.org/kefirfromperm/kefirbb) [ ](https://bintray.com/kefirsf/libs/org.kefirsf%3Akefirbb/_latestVersion) [](https://maven-badges.herokuapp.com/maven-central/org.kefirsf/kefirbb) [](https://javadocio-badges.herokuapp.com/org.kefirsf/kefirbb) [](https://openhub.net/p/kefirbb)
About
-----
KefirBB is a Java-library for text processing. Initially it was developed for BBCode (Bulletin Board Code) to HTML
translation. But flexible configuration allows to use it in different cases. For example XML-to-HTML translation or
for HTML filtration. Now it supports Textile and Markdown markup languages. Actually it's the most powerfull and flexible Java-library for BBCode parsing.
Maven dependency
----------------
```xml
org.kefirsf
kefirbb
1.5
```
Usage
-----
### Convert BBCode
KefirBB fully supports converting from BBCode markup language to HTML. The syntax of BBCode is described at
[BBCode - Wikipedia](https://en.wikipedia.org/wiki/BBCode).
```java
TextProcessor processor = BBProcessorFactory.getInstance().create();
assert "text".equals(processor.process("[b]text[/b]"));
```
### HTML Filtration
If you don't want to use special markup languages in your site but you have to safe your users from XSS-attacks
you can use KefirBB configuration for HTMl filtration. It prevents using of javascript, styles etc.
```java
TextProcessor processor = BBProcessorFactory.getInstance()
.createFromResource(ConfigurationFactory.SAFE_HTML_CONFIGURATION_FILE);
assert "text".equals(processor.process("test"));
```
### Convert Textile
KefirBB fully supports Textile markup language. It's described at
[TxStyle](https://txstyle.org/)
```java
TextProcessor processor = BBProcessorFactory.getInstance()
.createFromResource(ConfigurationFactory.TEXTILE_CONFIGURATION_FILE);
assert "
text
".equals(processor.process("**text**"));
```
### Convert Markdown
KefirBB supports Markdown markup language partially described at
[Markdown Syntax](https://daringfireball.net/projects/markdown/syntax). It doesn't support fully blockquotes and lists.
```java
TextProcessor processor = BBProcessorFactory.getInstance()
.createFromResource(ConfigurationFactory.MARKDOWN_CONFIGURATION_FILE);
assert "
text
".equals(processor.process("**text**"));
```
### Your custom configuration
Also you can use your own configuration or customize existing. Just put your own configuration to
`classpath:kefirbb.xml`.
Documentation
-------------
You can find full documentation in [the wiki of the project](https://github.com/kefirfromperm/kefirbb/wiki).
* [User Guide (English)](https://github.com/kefirfromperm/kefirbb/wiki/User-Guide-%28English%29)
* [Руководство пользователя (русский)](https://github.com/kefirfromperm/kefirbb/wiki/%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE-%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8F-%28%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29)
* [Javadoc API](https://www.javadoc.io/doc/org.kefirsf/kefirbb/)
Support
-------
You can report bugs at [GitHub Issues](https://github.com/kefirfromperm/kefirbb/issues). Also you can ask me questions by email kefirfromperm@gmail.com.
Donation
------------
If you want to give me a beer just send some money to