refactor: Extract do_render_markdown().
refactor: Extract do_render_markdown().

For the import-data codepath, we will call
the extracted function directly in a
subsequent commit.

The do_render_markdown() function has more
required parameters, which allows for more
explicit code and also allows us to flatten
out some logic related to alert words.  (We
just pass in empty sets/dicts as needed).

tommyip/zulip,rht/zulip,synicalsyntax/zulip,punchagan/zulip,dhcrzf/zulip,andersk/zulip,zulip/zulip,punchagan/zulip,andersk/zulip,shubhamdhama/zulip,shubhamdhama/zulip,jackrzhang/zulip,zulip/zulip,rht/zulip,brainwane/zulip,kou/zulip,hackerkid/zulip,showell/zulip,brainwane/zulip,hackerkid/zulip,kou/zulip,showell/zulip,andersk/zulip,dhcrzf/zulip,timabbott/zulip,dhcrzf/zulip,eeshangarg/zulip,tommyip/zulip,timabbott/zulip,synicalsyntax/zulip,timabbott/zulip,hackerkid/zulip,jackrzhang/zulip,eeshangarg/zulip,eeshangarg/zulip,rishig/zulip,zulip/zulip,zulip/zulip,rht/zulip,rishig/zulip,timabbott/zulip,andersk/zulip,andersk/zulip,tommyip/zulip,rht/zulip,showell/zulip,shubhamdhama/zulip,timabbott/zulip,brainwane/zulip,rishig/zulip,punchagan/zulip,synicalsyntax/zulip,shubhamdhama/zulip,synicalsyntax/zulip,rishig/zulip,synicalsyntax/zulip,tommyip/zulip,tommyip/zulip,rishig/zulip,zulip/zulip,kou/zulip,shubhamdhama/zulip,rht/zulip,jackrzhang/zulip,dhcrzf/zulip,synicalsyntax/zulip,dhcrzf/zulip,kou/zulip,jackrzhang/zulip,hackerkid/zulip,eeshangarg/zulip,showell/zulip,punchagan/zulip,punchagan/zulip,brainwane/zulip,jackrzhang/zulip,timabbott/zulip,andersk/zulip,jackrzhang/zulip,timabbott/zulip,showell/zulip,punchagan/zulip,jackrzhang/zulip,zulip/zulip,andersk/zulip,eeshangarg/zulip,rishig/zulip,brainwane/zulip,kou/zulip,eeshangarg/zulip,showell/zulip,punchagan/zulip,brainwane/zulip,kou/zulip,eeshangarg/zulip,rht/zulip,tommyip/zulip,hackerkid/zulip,rht/zulip,synicalsyntax/zulip,shubhamdhama/zulip,showell/zulip,shubhamdhama/zulip,hackerkid/zulip,hackerkid/zulip,tommyip/zulip,brainwane/zulip,dhcrzf/zulip,dhcrzf/zulip,zulip/zulip,rishig/zulip,kou/zulip