My function parses through text, grabs parts and generates text only email format. But it also needs to generate html format.
The brain-dead way would be to use if ... else ... and add additional html tags around each paragraph or element. But it will violate DRY (don't repeat yourself) rule.
Is there an elegant way to solve this problem?