git-svn-id: svn://db.shs.com.ru/libs@911 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2020-03-26 13:03:00 +00:00
parent 45815ee290
commit 64fb8d6c84

View File

@@ -10,8 +10,19 @@ extern "C" {
# ifndef MKD_FENCEDCODE
# define MKD_FENCEDCODE 0x02000000
# endif
# ifndef MKD_EXTRA_FOOTNOTE
# define MKD_EXTRA_FOOTNOTE 0x00200000
# endif
# ifndef MKD_TOC
# define MKD_TOC 0x00001000
# endif
#endif
static QString markdown_css = "table { margin: 5px; background-color: #cccccc; }"
"table tr { background-color: white; }"
"table td { vertical-align: middle; padding: 5px;}"
"table th { padding: 5px; };"
;
QString md2html(const QByteArray & src) {
static bool _is_mkd_init = false;
@@ -53,6 +64,7 @@ QString md2html(const QByteArray & src) {
"<meta name=\"qrichtext\" content=\"1\" />\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
header.append("<title>" + title + "</title>\n");
header.append("<style>" + markdown_css + "</style>\n");
header.append("</head>\n<body>\n");
ret.prepend(header);
ret.append("</body>\n</html>\n");