* mdocml: Indentation must be measured in units of the surrounding text,
@ 2017-01-08 22:52 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-01-08 22:52 UTC (permalink / raw)
To: source
Log Message:
-----------
Indentation must be measured in units of the surrounding text,
not in units of the contained text. Consequently, "display"
and "lit" class tags must not be on the same element: First,
"display" must set up the indentation, still using the outer
units, and only after that, "lit" may change the font.
This fixes .Bd -literal which got the wrong indentation.
Bug reported by tb@.
Modified Files:
--------------
mdocml:
mdoc_html.c
Revision Data
-------------
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v
retrieving revision 1.240
retrieving revision 1.241
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.240 -r1.241
--- mdoc_html.c
+++ mdoc_html.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -1121,15 +1121,15 @@ mdoc_bd_pre(MDOC_ARGS)
bufcat_su(h, "margin-left", &su);
PAIR_STYLE_INIT(&tag[0], h);
- if (DISP_unfilled != n->norm->Bd.type &&
- DISP_literal != n->norm->Bd.type) {
- PAIR_CLASS_INIT(&tag[1], "display");
- print_otag(h, TAG_DIV, 2, tag);
+ PAIR_CLASS_INIT(&tag[1], "display");
+ print_otag(h, TAG_DIV, 2, tag);
+
+ if (n->norm->Bd.type != DISP_unfilled &&
+ n->norm->Bd.type != DISP_literal)
return 1;
- }
- PAIR_CLASS_INIT(&tag[1], "lit display");
- print_otag(h, TAG_PRE, 2, tag);
+ PAIR_CLASS_INIT(&tag[0], "lit");
+ print_otag(h, TAG_PRE, 1, tag);
/* This can be recursive: save & set our literal state. */
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-08 22:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-08 22:52 mdocml: Indentation must be measured in units of the surrounding text, schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).