summaryrefslogtreecommitdiff
path: root/src/html.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-03-13 21:25:25 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2016-03-13 21:25:25 -0700
commitc4eb6bc33d9639ce0840a5fa3cea173c2c816fd1 (patch)
tree6724e3dbf909f022095cb5a7ad669c15477dfb78 /src/html.c
parentc187089e8725b45144ec668c4bd95b99b28633d5 (diff)
parentaf98c75f1ad3338c813aa475aa1b543dd80c138a (diff)
Merge pull request #109 from nwellnhof/msvc-c99
Compile in plain C mode with MSVC 12.0 or newer
Diffstat (limited to 'src/html.c')
-rw-r--r--src/html.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/html.c b/src/html.c
index 27e0586..9ffa08a 100644
--- a/src/html.c
+++ b/src/html.c
@@ -10,6 +10,8 @@
#include "houdini.h"
#include "scanners.h"
+#define BUFFER_SIZE 100
+
// Functions to convert cmark_nodes to HTML strings.
static void escape_html(cmark_strbuf *dest, const unsigned char *source,
@@ -17,7 +19,7 @@ static void escape_html(cmark_strbuf *dest, const unsigned char *source,
houdini_escape_html0(dest, source, length, 0);
}
-static inline void cr(cmark_strbuf *html) {
+static CMARK_INLINE void cr(cmark_strbuf *html) {
if (html->size && html->ptr[html->size - 1] != '\n')
cmark_strbuf_putc(html, '\n');
}
@@ -29,7 +31,6 @@ struct render_state {
static void S_render_sourcepos(cmark_node *node, cmark_strbuf *html,
int options) {
- const size_t BUFFER_SIZE = 100;
char buffer[BUFFER_SIZE];
if (CMARK_OPT_SOURCEPOS & options) {
snprintf(buffer, BUFFER_SIZE, " data-sourcepos=\"%d:%d-%d:%d\"",
@@ -47,7 +48,6 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
char start_heading[] = "<h0";
char end_heading[] = "</h0";
bool tight;
- const size_t BUFFER_SIZE = 100;
char buffer[BUFFER_SIZE];
bool entering = (ev_type == CMARK_EVENT_ENTER);