Skip to content

weslleycapelari/BBCode4D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forks Stargazers Issues License LinkedIn

BBCode4D: Convert BBCode to Rich Text in Delphi


Logo

BBCode4D

A Delphi library for converting BBCode to Rich Text Format (RTF).
Explore the code »

View Demo · Report Bug · Request Feature

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.

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:

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:

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 - [email protected]

Acknowledgments

Thanks to the Delphi community for their support and feedback.

About

Simple BBCode Interpreter for Delphi

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages