move spinner show to start of renderMarkdown function