You have a set of data that you need to process in multiple, possibly varying ways.
Solution
Use the Decorator pattern in order to structure how you apply the changes.
Results
Discussion
The TextProcessor serves the role of Decorator by binding the individual, specialized text processors together. This frees up the miniMarkdown and stripComments components to focus on handling nothing but a single line of text. Future developers only have to write functions that return a string and add it to the array of processors.
We can even modify the existing Decorator object on the fly: