bbcode

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bbcode 把 NGA 帖子内容(BBCode)渲染为终端可显示的 ANSI 文本。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(src string, width int) string

Render 把 BBCode 渲染为已按 width 折行的 ANSI 文本。

Types

type Node

type Node struct {
	Tag     string  // 小写标签名;文本节点为空
	Attr    string  // [tag=attr] 的参数
	Text    []*Node // 标签节点的子节点
	Content string  // 文本节点内容
}

Node 是 BBCode 解析树节点。

func Parse

func Parse(src string) *Node

Parse 把 BBCode 源码解析为树。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL