UNPKG

@ginstone/nga-api

Version:

37 lines (36 loc) 988 B
import { BbsTag } from "./BbsTag"; export declare class BbsTagParser { /** * 解析正文(总入口) * @param content 正文 */ static parseContent(content?: string): BbsTag[]; /** * 解析标签,将一段bbsCode解析为一个标签数组 * @param code 标签 */ static parseCode(code?: string): BbsTag[]; /** * 对本就会渲染为一行的标签,删除其首尾多余的br换行符 * @param content 正文 * @param tagName 标签名称 */ private static removeBr; /** * 从代码片段中截取指定标签名称的分段 * @param suffixCode 代码片段 * @param tagName 标签名称 */ private static getSubCode; /** * 统计子字符串在母串中出现的次数 * @param s 母串 * @param search 子串 */ private static countMatches; /** * 正文的预处理 * @param content 正文 */ private static preHandle; }