git-svn-id: svn://db.shs.com.ru/libs@911 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -10,8 +10,19 @@ extern "C" {
|
|||||||
# ifndef MKD_FENCEDCODE
|
# ifndef MKD_FENCEDCODE
|
||||||
# define MKD_FENCEDCODE 0x02000000
|
# define MKD_FENCEDCODE 0x02000000
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef MKD_EXTRA_FOOTNOTE
|
||||||
|
# define MKD_EXTRA_FOOTNOTE 0x00200000
|
||||||
|
# endif
|
||||||
|
# ifndef MKD_TOC
|
||||||
|
# define MKD_TOC 0x00001000
|
||||||
|
# endif
|
||||||
#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) {
|
QString md2html(const QByteArray & src) {
|
||||||
static bool _is_mkd_init = false;
|
static bool _is_mkd_init = false;
|
||||||
@@ -53,6 +64,7 @@ QString md2html(const QByteArray & src) {
|
|||||||
"<meta name=\"qrichtext\" content=\"1\" />\n"
|
"<meta name=\"qrichtext\" content=\"1\" />\n"
|
||||||
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
|
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
|
||||||
header.append("<title>" + title + "</title>\n");
|
header.append("<title>" + title + "</title>\n");
|
||||||
|
header.append("<style>" + markdown_css + "</style>\n");
|
||||||
header.append("</head>\n<body>\n");
|
header.append("</head>\n<body>\n");
|
||||||
ret.prepend(header);
|
ret.prepend(header);
|
||||||
ret.append("</body>\n</html>\n");
|
ret.append("</body>\n</html>\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user