Forum > General
FPDoc XML - TH is a table row?
dsiders:
Was it intentional that the TH tag in FPDoc XML is a used as table row markup?
I know most of the markup tags generally adhere to the common HTML usage - except for the custom ones used for topic structure. But TH is a definite exception. In HTML it is displayed as a table cell. In FPDoc it is used for a table row.
I know it's documented as being "by design".
Confusing.
lucamar:
My guess? Whoever "invented" it got confussed and thought <th> was an alternative to <tr> instead of to the correct <td>. It can be seen quite plainly in the doc page for <table>; where it says:
--- Code: HTML5 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<th><td>Value</td><td>Meaning</td></th>it should be
--- Code: HTML5 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<tr><th>Value</th><th>Meaning</th></tr>
valdir.marcos:
--- Quote from: dsiders on March 21, 2019, 08:03:10 pm ---Was it intentional that the TH tag in FPDoc XML is a used as table row markup?
I know most of the markup tags generally adhere to the common HTML usage - except for the custom ones used for topic structure. But TH is a definite exception. In HTML it is displayed as a table cell. In FPDoc it is used for a table row.
I know it's documented as being "by design".
Confusing.
--- End quote ---
--- Quote from: lucamar on March 21, 2019, 08:19:41 pm ---My guess? Whoever "invented" it got confussed and thought <th> was an alternative to <tr> instead of to the correct <td>. It can be seen quite plainly in the doc page for <table>; where it says:
--- Code: HTML5 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<th><td>Value</td><td>Meaning</td></th>it should be
--- Code: HTML5 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<tr><th>Value</th><th>Meaning</th></tr>
--- End quote ---
Should it be reported as a bug?
lucamar:
--- Quote from: valdir.marcos on March 21, 2019, 08:26:54 pm ---Should it be reported as a bug?
--- End quote ---
It depends on whether it can be considered a bug or just a queer "our-way" gotcha ;D
Fact is nobody said FPDoc XML is HTML; quite the contrary: it most emphatically is not. But the common "HTML-like" tags work like in HTML ... except <th>. So ... is it a bug or is there some reason?
We should see what real HTML is generated from such fpdoc tags: then we would know whether somebody just didn't pay attention to detail or there is a profound reason we don't know about.
dsiders:
--- Quote from: lucamar on March 21, 2019, 08:43:53 pm ---
--- Quote from: valdir.marcos on March 21, 2019, 08:26:54 pm ---Should it be reported as a bug?
--- End quote ---
It depends on whether it can be considered a bug or just a queer "our-way" gotcha ;D
Fact is nobody said FPDoc XML is HTML; quite the contrary: it most emphatically is not. But the common "HTML-like" tags work like in HTML ... except <th>. So ... is it a bug or is there some reason?
We should see what real HTML is generated from such fpdoc tags: then we would know whether somebody just didn't pay attention to detail or there is a profound reason we don't know about.
--- End quote ---
I never claimed it was HTML. They needed formatting tags for their XML, and smartly decided to re-use the common HTML conventions. They didn't get all crazy like DocBook or DITA. I appreciate that.
But this one exception has to be translated back to the common HTML convention for both HTML and CHM output. And it's being converted in the HTML writer fpdoc/dw_html.pp. Even dwriter.pp (the base writer class) handles it as a row-level element.
My question remains "was it by design"? It's little inconsistencies like this that drive me nuts. ;)
It's not like its a huge issue.15 total files in both FPC Docs and Lazarus use the TH tag. It wouldn't be very difficult to fix it in the XML source if it wasn't by design.
I was just curious.
Navigation
[0] Message Index
[#] Next page