require 'text_utils' module TextUtils class << self # TODO2 rename def markup data ps = [] ps << EnsureUtf ps << HtmlSanitizer ps << FormatQualifier ps << CodeHighlighter if rad.config.use_code_highlighter ps << CustomMarkdown ps << Markdown markup = Pipe.new *ps markup.call data end def truncate data, length truncate = Pipe.new( EnsureUtf, HtmlSanitizer, FormatQualifier, [Truncate, length] ) truncate.call data end end end