Steam.BBCode 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Steam.BBCode --version 1.0.1                
NuGet\Install-Package Steam.BBCode -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Steam.BBCode" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Steam.BBCode --version 1.0.1                
#r "nuget: Steam.BBCode, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Steam.BBCode as a Cake Addin
#addin nuget:?package=Steam.BBCode&version=1.0.1

// Install Steam.BBCode as a Cake Tool
#tool nuget:?package=Steam.BBCode&version=1.0.1                

Steam.BBCode

BBCode-Parser for Steam-API

Usage

Import neccessary packages:

using Steam.BBCode;
using Steam.BBCode.Components;

Start parsing your BBCode from Steam/Workshop:

BBCode code = new BBCode();
List<Component> components = code.Parse("<BBCODE>"); // Insert your BBCode here!

After that, you can iterate over all Components:

foreach(Component component in components) {
	
	// Bold
	if(component.GetType() == typeof(Bold)) {
		Console.WriteLine("BOLD: " + component.GetContent());
		
	// Code
	} else if(component.GetType() == typeof(Code)) {
		Console.WriteLine("CODE: " + component.GetContent());
	
	// Italic
	} else if(component.GetType() == typeof(Italic)) {
		Console.WriteLine("ITALIC: " + component.GetContent());
		
	// List
	} else if component.GetType() == typeof(List)) {
		List list = (List) component;
		Console.WriteLine("LIST:");

		// Entries
		foreach(string item in list.GetItems()) {
			Console.WriteLine(" >> " + item);
		}

	// NoParse
	} else if(component.GetType() == typeof(NoParse)) {
		Console.WriteLine("NOPARSE: " + component.GetContent());
		
	// PlainText
	} else if(component.GetType() == typeof(PlainText)) {
		Console.WriteLine("PLAINTEXT: " + component.GetContent());
		
	// Quote
	} else if(component.GetType() == typeof(Quote)) {
		Console.WriteLine("QUOTE: " + component.GetContent());

	// Spoiler
	} else if(component.GetType() == typeof(Spoiler)) {
		Console.WriteLine("SPOILER: " + component.GetContent());
		
	// Strike
	} else if(component.GetType() == typeof(Strike)) {
		Console.WriteLine("STRIKE: " + component.GetContent());
		
	// Title
	} else if(component.GetType() == typeof(Title)) {
		Console.WriteLine("TITLE: " + component.GetContent());
		
	// Underline
	} else if(component.GetType() == typeof(Underline)) {
		Console.WriteLine("UNSERLINE: " + component.GetContent());
		
	// URL
	} else if(component.GetType() == typeof(URL)) {
		URL url = (URL) component;
		Console.WriteLine("URL: " + url.GetURL() + " (" + url.GetContent() + ")");

	// Image
	} else if(component.GetType() == typeof(Image)) {
		Image url = (Image) component;
		Console.WriteLine("Image: " + url.GetURL());
	}
}

Is it an BBCode-to-HTML Parser?

NO! This parser is only an parser. If you want a renderer, you must write your own. This library was made to use own renderers.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 674 2/20/2019
1.0.1 656 2/20/2019
1.0.0 667 2/20/2019