using Nuuru.Server.DTOs.BBCode; namespace Nuuru.Server.Services.BBCode { /// /// Result of parsing BBCode that includes both HTML and extracted mentions /// public record ParseResult(string Html, List MentionedUserIds, List QuotedForumPostIds); public interface IBBCodeService { /// /// Parses BBCode to sanitized HTML /// string Parse(string bbcode); /// /// Parses BBCode to sanitized HTML with context /// string Parse(string bbcode, BBCodeContext context); /// /// Parses BBCode to sanitized HTML and extracts mentioned user IDs /// ParseResult ParseWithMentions(string bbcode); /// /// Parses BBCode to sanitized HTML and extracts mentioned user IDs with context /// ParseResult ParseWithMentions(string bbcode, BBCodeContext context); /// /// Parses BBCode to sanitized HTML and extracts mentioned user IDs, with avatar lookup for quote headers /// ParseResult ParseWithMentions(string bbcode, Func? lookupAvatar); /// /// Parses BBCode to sanitized HTML and extracts mentioned user IDs with context and avatar lookup /// ParseResult ParseWithMentions(string bbcode, BBCodeContext context, Func? lookupAvatar); /// /// Parses BBCode to sanitized HTML with quote verification support /// string Parse(string bbcode, Func? lookupSource); /// /// Parses BBCode to sanitized HTML with quote verification and context /// string Parse(string bbcode, Func? lookupSource, BBCodeContext context); /// /// Parses BBCode to an AST for frontend consumption /// List ParseToAst(string bbcode); /// /// Parses BBCode to an AST for frontend consumption with context /// List ParseToAst(string bbcode, BBCodeContext context); /// /// Validates BBCode and returns any errors /// bool Validate(string bbcode, out List errors); /// /// Extracts plain text content from BBCode, stripping all tags /// string ExtractPlainText(string bbcode); /// /// Extracts plain text content from BBCode with context, stripping all tags /// string ExtractPlainText(string bbcode, BBCodeContext context); /// /// Extracts plain text content from BBCode, excluding text inside quote blocks /// string ExtractPlainTextExcludingQuotes(string bbcode, BBCodeContext context = BBCodeContext.Comment); } }