gjtorikian / html-pipeline

HTML processing filters and utilities
MIT License
2.27k stars 382 forks source link

Ensure <pre> nodes are not removed after syntax highlighting #295

Closed ianks closed 6 years ago

ianks commented 6 years ago

After upgrading to rouge, I noticed the syntax highlighting in octodown has disappeared. It seems that the pre tags were being removed, which are neccesary for correct highlighting with rouge. This commit fixes this by replacing the inner_html of the preblock with the code highlighted by rouge.

gjtorikian commented 6 years ago

Looks great! Thanks.