version 1.249, 2019/01/06 04:55:09 |
version 1.250, 2019/01/07 07:26:29 |
Line 272 html_close_paragraph(struct html *h) |
|
Line 272 html_close_paragraph(struct html *h) |
|
struct tag *t; |
struct tag *t; |
|
|
for (t = h->tag; t != NULL; t = t->next) { |
for (t = h->tag; t != NULL; t = t->next) { |
if (t->tag == TAG_P) { |
if (t->tag == TAG_P || t->tag == TAG_PRE) { |
print_tagq(h, t); |
print_tagq(h, t); |
break; |
break; |
} |
} |
Line 834 print_tagq(struct html *h, const struct tag *until) |
|
Line 834 print_tagq(struct html *h, const struct tag *until) |
|
|
|
while ((tag = h->tag) != NULL) { |
while ((tag = h->tag) != NULL) { |
print_ctag(h, tag); |
print_ctag(h, tag); |
if (until && tag == until) |
if (tag == until) |
return; |
return; |
} |
} |
} |
} |
|
|
|
/* |
|
* Close out all open elements up to but excluding suntil. |
|
* Note that a paragraph just inside stays open together with it |
|
* because paragraphs include subsequent phrasing content. |
|
*/ |
void |
void |
print_stagq(struct html *h, const struct tag *suntil) |
print_stagq(struct html *h, const struct tag *suntil) |
{ |
{ |
struct tag *tag; |
struct tag *tag; |
|
|
while ((tag = h->tag) != NULL) { |
while ((tag = h->tag) != NULL) { |
if (suntil && tag == suntil) |
if (tag == suntil || |
|
(tag->next == suntil && |
|
(tag->tag == TAG_P || tag->tag == TAG_PRE))) |
return; |
return; |
print_ctag(h, tag); |
print_ctag(h, tag); |
} |
} |
} |
|
|
|
void |
|
print_paragraph(struct html *h) |
|
{ |
|
struct tag *t; |
|
|
|
t = print_otag(h, TAG_DIV, "c", "Pp"); |
|
print_tagq(h, t); |
|
} |
} |
|
|
|
|