summaryrefslogtreecommitdiffstats
path: root/mlg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mlg.c')
-rw-r--r--mlg.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/mlg.c b/mlg.c
index 780167b4..c6c3963a 100644
--- a/mlg.c
+++ b/mlg.c
@@ -24,15 +24,10 @@
#include <stdio.h>
#include <string.h>
-#include "private.h"
#include "ml.h"
/* TODO: literal tokens. */
-#define COLUMNS 72
-#define INDENT 4
-#define MAXINDENT 10
-
enum md_tok {
MD_TEXT,
MD_INLINE_IN,
@@ -239,14 +234,10 @@ mlg_endtag(struct md_mlg *p, enum md_ns ns, int tok)
static int
mlg_indent(struct md_mlg *p)
{
- size_t count;
-
- count = p->indent > MAXINDENT ?
- (size_t)MAXINDENT : p->indent;
- count *= INDENT;
assert(0 == p->pos);
- return(ml_putchars(p->mbuf, ' ', count, &p->pos));
+ return(ml_putchars(p->mbuf, ' ', INDENT_SZ *
+ INDENT(p->indent), &p->pos));
}
@@ -325,7 +316,7 @@ mlg_data(struct md_mlg *p, int space,
if ( ! mlg_nstring(p, start, buf, sz))
return(0);
- if (p->indent * INDENT + sz >= COLUMNS)
+ if (INDENT(p->indent) * INDENT_SZ + sz >= COLUMNS)
if ( ! mlg_newline(p))
return(0);