refactored to adopt to the new style of cebe/markdown 1.0