Extract #format from Tag#to_html.
The HTML rendering is now done in two parts: 1. Tag#format method is called, passing the DocFormatter. This is where Markdown to HTML conversion happens. 2. Tag#to_html method is called, which must just return HTML. No more can formatter be used inside #to_html. This simplified the passing of DocFormatter instance to Tags - no more do we need to inject the formatter inside Tag classes, instead we can just pass it as a parameter. With this we remove the single remaining state object from Tag class.
Loading
Please register or sign in to comment