Factor out common markdown page handling into MarkdownHandlerFunc.