Add live markdown functionality for H1-H6, refactored to make it more DRY