version 1.258, 2019/09/01 15:12:19 |
version 1.260, 2019/09/03 18:08:02 |
Line 271 print_metaf(struct html *h) |
|
Line 271 print_metaf(struct html *h) |
|
void |
void |
html_close_paragraph(struct html *h) |
html_close_paragraph(struct html *h) |
{ |
{ |
struct tag *t; |
struct tag *this, *next; |
|
int flags; |
|
|
for (t = h->tag; t != NULL && t->closed == 0; t = t->next) { |
this = h->tag; |
switch(t->tag) { |
for (;;) { |
case TAG_P: |
next = this->next; |
case TAG_PRE: |
flags = htmltags[this->tag].flags; |
print_tagq(h, t); |
if (flags & (HTML_INPHRASE | HTML_TOPHRASE)) |
|
print_ctag(h, this); |
|
if ((flags & HTML_INPHRASE) == 0) |
break; |
break; |
case TAG_A: |
this = next; |
print_tagq(h, t); |
|
continue; |
|
default: |
|
continue; |
|
} |
|
break; |
|
} |
} |
} |
} |
|
|
Line 593 print_otag(struct html *h, enum htmltag tag, const cha |
|
Line 590 print_otag(struct html *h, enum htmltag tag, const cha |
|
assert((htmltags[t->tag].flags & HTML_TOPHRASE) == 0); |
assert((htmltags[t->tag].flags & HTML_TOPHRASE) == 0); |
break; |
break; |
} |
} |
} |
|
|
|
|
/* |
|
* Always wrap phrasing elements in a paragraph |
|
* unless already contained in some flow container; |
|
* never put them directly into a section. |
|
*/ |
|
|
|
} else if (tflags & HTML_TOPHRASE && h->tag->tag == TAG_SECTION) |
|
print_otag(h, TAG_P, "c", "Pp"); |
|
|
/* Push this tag onto the stack of open scopes. */ |
/* Push this tag onto the stack of open scopes. */ |
|
|
if ((tflags & HTML_NOSTACK) == 0) { |
if ((tflags & HTML_NOSTACK) == 0) { |
Line 799 print_gen_comment(struct html *h, struct roff_node *n) |
|
Line 804 print_gen_comment(struct html *h, struct roff_node *n) |
|
void |
void |
print_text(struct html *h, const char *word) |
print_text(struct html *h, const char *word) |
{ |
{ |
|
/* |
|
* Always wrap text in a paragraph unless already contained in |
|
* some flow container; never put it directly into a section. |
|
*/ |
|
|
|
if (h->tag->tag == TAG_SECTION) |
|
print_otag(h, TAG_P, "c", "Pp"); |
|
|
|
/* Output whitespace before this text? */ |
|
|
if (h->col && (h->flags & HTML_NOSPACE) == 0) { |
if (h->col && (h->flags & HTML_NOSPACE) == 0) { |
if ( ! (HTML_KEEP & h->flags)) { |
if ( ! (HTML_KEEP & h->flags)) { |
if (HTML_PREKEEP & h->flags) |
if (HTML_PREKEEP & h->flags) |
Line 807 print_text(struct html *h, const char *word) |
|
Line 822 print_text(struct html *h, const char *word) |
|
} else |
} else |
print_word(h, " "); |
print_word(h, " "); |
} |
} |
|
|
|
/* |
|
* Print the text, optionally surrounded by HTML whitespace, |
|
* optionally manually switching fonts before and after. |
|
*/ |
|
|
assert(h->metaf == NULL); |
assert(h->metaf == NULL); |
print_metaf(h); |
print_metaf(h); |