2 Years Ago
Markup Library Improvements (#1732) * Markup Library Improvements - New argument to MarkupObject:Draw() (textAlign) allows for text alignment inside the maxWidth bounds (i.e. align text center, align text right) - Added MarkupObject:GetMaxWidth() - Added markup.Escape which escapes markup-sensitive characters ( & < > ) - Fixed trailing spaces on new lines - Fixed issue where new blocks were unnecessarily being split in the middle of a word - Changed pairs to ipairs - Improved code readability, cleaned up comments, removed a redundant comment * New blocks will not wrap unless preceded by a space, remove some redundant code, change name of variable and add new comment * Use lookup table for unescape string.gsub * Small optimizations - Changed blocks[ i ] to blk - Populate new_block tables during declaration rather than setting keys & values after creation * Create markup.Color which converts a Color into a string for use in <color> tags