From 9c62a1979e3ea0f278835a15164bf139d2c68fd1 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 20 Mar 2009 19:56:25 +0000 Subject: Proper .Dl literalism. --- action.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'action.c') diff --git a/action.c b/action.c index 7919f3ec..122f861b 100644 --- a/action.c +++ b/action.c @@ -1,4 +1,4 @@ -/* $Id: action.c,v 1.45 2009/03/20 16:43:28 kristaps Exp $ */ +/* $Id: action.c,v 1.46 2009/03/20 19:56:25 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -57,8 +57,8 @@ static int post_ar(POST_ARGS); static int post_bl(POST_ARGS); static int post_bl_width(POST_ARGS); static int post_bl_tagwidth(POST_ARGS); -static int post_bd(POST_ARGS); static int post_dd(POST_ARGS); +static int post_display(POST_ARGS); static int post_dt(POST_ARGS); static int post_nm(POST_ARGS); static int post_os(POST_ARGS); @@ -67,6 +67,7 @@ static int post_sh(POST_ARGS); static int post_std(POST_ARGS); static int pre_bd(PRE_ARGS); +static int pre_dl(PRE_ARGS); #define merr(m, t) perr((m), (m)->last->line, (m)->last->pos, (t)) #define mwarn(m, t) pwarn((m), (m)->last->line, (m)->last->pos, (t)) @@ -80,8 +81,8 @@ const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* Ss */ { NULL, NULL }, /* Pp */ { NULL, NULL }, /* D1 */ - { NULL, NULL }, /* Dl */ - { pre_bd, post_bd }, /* Bd */ + { pre_dl, post_display }, /* Dl */ + { pre_bd, post_display }, /* Bd */ { NULL, NULL }, /* Ed */ { NULL, post_bl }, /* Bl */ { NULL, NULL }, /* El */ @@ -685,6 +686,17 @@ post_prol(POST_ARGS) } +static int +pre_dl(PRE_ARGS) +{ + + if (MDOC_BODY != n->type) + return(1); + m->flags |= MDOC_LITERAL; + return(1); +} + + static int pre_bd(PRE_ARGS) { @@ -714,7 +726,7 @@ pre_bd(PRE_ARGS) static int -post_bd(POST_ARGS) +post_display(POST_ARGS) { if (MDOC_BODY == m->last->type) -- cgit v1.2.3