{"id":"egomoose/rich-text-helper","name":"rich-text-helper","scope":"egomoose","platform":"roblox","description":"https://github.com/EgoMoose/rich-text-helper","version":"0.2.0","latest":"0.2.0","versions":["0.1.0","0.2.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"csqrl/sift":{"version":"^0.0.9","alias":"Sift"}},"integrity":"9f2f8c8026aacb4dc213991efe8d00dfdb8de311e6ec2de06de70b06bbe3a3d1","likes":0,"downloads":0,"install":"forest install egomoose/rich-text-helper","url":"https://forest.dev/p/roblox/egomoose/rich-text-helper","files":"https://api.forest.dev/ai/package/roblox/egomoose/rich-text-helper/files","readme":"# rich-text-helper\n\nA Luau package for interpreting and modifying rich text in Roblox\n\nGet it here:\n\n* [Releases](https://github.com/EgoMoose/rich-text-helper/releases)\n\n## API\n\nThis module exports one type called `ParsedRichText`. To see this typing please reference the following [file.](src/Primitives/RichTextTypes.d.lua)\n\n```Lua\n--[=[\nGiven an rich text input string this function will return whether or not the string can be parsed by Roblox's rich text system.\n\n@param richText string -- The input rich text string\n@return boolean\n--]=]\nfunction module.validate(richText: string): boolean\n\n--[=[\nGiven an rich text input string this function will validate and return a parsed rich text format that's to be used with most other functions in this module.\n\n@param richText string -- The input rich text string\n@return ParsedRichText\n--]=]\nfunction module.parse(richText: string): ParsedRichText\n\n--[=[\nReturns the string form of parsed rich text. This function will attempt to use the minimum number of rich text tags possible so it is not guaranteed to be equal to origin string used to generate the ParsedRichText\n\nNote: `from` and `to` can be negative. `from` defaults to 1 and `to` defaults to -1.\n\n@param parsed ParsedRichText -- The input parsed rich text\n@param from number? -- The starting index of the rich text\n@param to number? -- The ending index of the rich text\n@return ParsedRichText\n--]=]\nfunction module.write(parsed: ParsedRichText, from: number?, to: number?): string\n\n--[=[\nReturns a rich text tag sanitized version of parsed rich text. This would be equivalent to using the `ContentText` property of a TextLabel Instance.\n\nExample:\n\"<b>Hello<b> <i>world!</i>\" -> \"Hello world!\"\n\n@param parsed ParsedRichText -- The input parsed rich text\n@return string\n--]=]\nfunction module.read(parsed: ParsedRichText): string\n\n--[=[\nTakes a variadic number of ParsedRichText arguments and concatenates them together.\n\n@param parsedArray { ParsedRichText } -- All the inputs that will be concatenated together\n@param richSeparator string -- The separating rich text string \n@return string\n--]=]\nfunction module.concat(parsedArray: { ParsedRichText }, richSeparator: string): ParsedRichText\n\n--[=[\nReturns a slice of the input ParsedRichText with the provided character range.\n\nNote: `from` and `to` can be negative. `from` defaults to 1 and `to` defaults to -1.\n\n@param parsed ParsedRichText -- The input parsed rich text\n@param from number? -- The starting index of the rich text\n@param to number? -- The ending index of the rich text\n@return string\n--]=]\nfunction module.slice(parsed: ParsedRichText, from: number?, to: number?): ParsedRichText\n\n--[=[\nAdds tags to all characters in the rich text.\n\nExample:\nmodule.tag(parsed, \"<b><i> </i></b>\")\n\n@param parsed ParsedRichText -- The input parsed rich text\n@param tag string -- The starting index of the rich text\n@return string\n--]=]\nfunction module.tag(parsed: ParsedRichText, tag: string): string\n```","readmeBorrowedFrom":{"version":"0.1.0","source":"wally"},"readmeTruncated":false}