public SafeHtml convertMarkdownToHtmlInFrame(final String rawMarkdown) {
        if (NullSafe.isBlankString(rawMarkdown)) {
            return SafeHtmlUtils.EMPTY_SAFE_HTML;
        } else {

            final SafeHtml markdownSafeHtml = convertMarkdownToHtml(rawMarkdown);
            final String currentPreferenceClasses = userPreferencesManager.getCurrentPreferenceClasses();
            final SafeHtml iFrameHtmlContent = new SafeHtmlBuilder()
                    .appendHtmlConstant("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
                    .appendHtmlConstant("<!DOCTYPE html>")
                    .appendHtmlConstant("<html class=\"")
                    .append(SafeHtmlUtil.from(currentPreferenceClasses))
                    .appendHtmlConstant("\">")
                    .appendHtmlConstant("<head>")
                    .appendHtmlConstant("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">")
                    .appendHtmlConstant("<link rel=\"stylesheet\" href=\"ui/css/app.css\" type=\"text/css\" />")
                    .appendHtmlConstant("</head>")
                    .appendHtmlConstant("<body>")
                    .appendHtmlConstant("<div class=\"max info-page markdown-container\">")
                    .append(markdownSafeHtml)
                    .appendHtmlConstant("</div>")
                    .appendHtmlConstant("</body>")
                    .appendHtmlConstant("</html>")
                    .toSafeHtml();

            return iFrameHtmlContent;
        }
    }
Converts the supplied markdown into html with appropriate syntax highlighting
The markdown is surrounded by a container div and placed in a sandboxed iFrame for
safety from scripts.
stroom-core-client/src/main/java/stroom/entity/client/presenter/MarkdownConverter.java