Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

BBCode4D

Simple BBCode Interpreter for Delphi

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

BBCode4D: Convert BBCode to Rich Text in Delphi

pascal
[![Logo](/catalog-images/5b/5bf247279e5672c55acd682d.png)](https://github.com/weslleycapelari/BBCode4D)

BBCode4D

pascal
A Delphi library for converting BBCode to Rich Text Format (RTF).
pascal
[Explore the code ??](https://github.com/weslleycapelari/BBCode4D)
pascal
[View Demo](https://github.com/weslleycapelari/BBCode4D/sample)
??
[Report Bug](https://github.com/weslleycapelari/BBCode4D/issues)
??
[Request Feature](https://github.com/weslleycapelari/BBCode4D/issues)

About The Project

BBCode4D is a Delphi library that allows you to easily convert BBCode markup to RTF, which can be displayed in a TRichEdit component. This is ideal for applications where users need to format text with basic formatting options like bold, italics, lists, and links.

Currently, the library supports converting BBCode to RTF. The reverse functionality (RTF to BBCode) is planned for future development.

pascal
[![Screenshot](/catalog-images/d2/d2afb81aab052e6ea993a73b.png)](https://github.com/weslleycapelari/BBCode4D)

Getting Started

Prerequisites

  • Delphi (tested with Delphi 12)

Installation

There are two ways to install BBCode4D:

  1. Include the BBCode4D.pas file: Simply add the BBCode4D.pas file to your project and include it in your uses clause.
  2. Use Boss: If you're using the Boss package manager for Delphi, you can install BBCode4D by running the following command:
pascal
boss install weslleycapelari/BBCode4D

Usage

To use BBCode4D, follow these steps:

  1. Parse the BBCode: Use the TBBCode4D.ParseBBCode function to parse the BBCode string. This will return a TBBCode4D object.
  2. Write to RichEdit: Call the WriteToRich method of the TBBCode4D object, passing the TRichEdit component where you want to display the formatted text.

Here's an example:

delphi
var
  LBBCode: string;
  LBBCodeParser: TBBCode4D;
begin
  LBBCode := '[b]This is bold text[/b]';
  LBBCodeParser := TBBCode4D.ParseBBCode(LBBCode);
  LBBCodeParser.WriteToRich(RichEdit);
end;

Roadmap

  • [ ] Implement RTF to BBCode conversion.
  • [ ] Add support for more BBCode tags.
  • [ ] Improve error handling and reporting.

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines.

License

BBCode4D is distributed under the MIT License. See the LICENSE.txt file for more information.

Contact

Weslley Capelari - weslley.capelari@gmail.com

Acknowledgments

Thanks to the Delphi community for their support and feedback.