Skip to content

Commit

Permalink
Fix handling of missing close TRs (Issue #494)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Feb 11, 2024
1 parent 4620dee commit c897072
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes in HTMLDOC v1.9.18

- Fixed table rendering when there are missing `</tr>` (Issue #494)
- Fixed support for links of the form "filename.html#anchor" in PDF output
(Issue #514)
- Fixed `--header1` support for web page output (Issue #515)
Expand Down
17 changes: 16 additions & 1 deletion htmldoc/htmllib.cxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* HTML parsing routines for HTMLDOC, a HTML document processing program.
*
* Copyright 2011-2023 by Michael R Sweet.
* Copyright 2011-2024 by Michael R Sweet.
* Copyright 1997-2010 by Easy Software Products. All rights reserved.
*
* This program is free software. Distribution and use rights are outlined in
Expand Down Expand Up @@ -571,9 +571,23 @@ htmlReadFile(tree_t *parent, // I - Parent tree entry
break;
}
}
else if (t->markup == MARKUP_TR)
{
for (temp = parent; temp != NULL; temp = temp->parent)
{
if (temp->markup == MARKUP_TR)
break;
else if (temp->markup == MARKUP_TABLE || t->markup == MARKUP_THEAD || t->markup == MARKUP_TBODY || t->markup == MARKUP_TFOOT || temp->markup == MARKUP_EMBED)
{
temp = NULL;
break;
}
}
}
else if (istentry(t->markup))
{
for (temp = parent; temp != NULL; temp = temp->parent)
{
if (istentry(temp->markup))
break;
else if (temp->markup == MARKUP_TABLE || istable(temp->markup) ||
Expand All @@ -598,6 +612,7 @@ htmlReadFile(tree_t *parent, // I - Parent tree entry
temp = NULL;
break;
}
}
}
else
temp = NULL;
Expand Down

0 comments on commit c897072

Please sign in to comment.