Implement a custom formatter using RedCloth::Formatters::Base
masterTo create a custom output format for RedCloth, you should implement a module that includes RedCloth::Formatters::Base. This module provides helper methods for handling phrase transformations, attribute generation, and versioning.
When implementing your formatter, you can use the following lifecycle hooks to manipulate the output:
before_transform(text): Called before the transformation process begins.after_transform(text): Called after the transformation process is complete.
Note that method_missing is implemented to return opts[:text] or an empty string, which allows the parser to gracefully handle unsupported phrase methods in your custom formatter.