simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.05k stars 133 forks source link

Indent headers based on level #105

Closed JMcKiern closed 4 years ago

JMcKiern commented 4 years ago

Fixes an error that would occur when the first header is not at the highest level.

Previously, when the first header is not at the highest level (as in the markdown below), there would be too many closing </div> tags. This pr simply uses the appropriate number of <div> tags for each header based on its level.

## Header 1
# Header 2
simov commented 4 years ago

Nice, I like that it simplifies the code as well :+1: