contributors-readme-action icon indicating copy to clipboard operation
contributors-readme-action copied to clipboard

Missing 'tbody' in the generated 'table'

Open hwhsu1231 opened this issue 1 year ago • 0 comments

Problem Description

I found that there's no <tbody></tbody> inside the <table></table> generated by this GitHub Action.

<!-- readme: contributors -start -->
<table>
<tr>
    <td align="center">
        <a href="https://github.com/hwhsu1231">
            <img src="https://avatars.githubusercontent.com/u/71438617?v=4" width="50;" alt="hwhsu1231"/>
            <br />
            <sub><b>Haowei Hsu</b></sub>
        </a>
    </td></tr>
</table>
<!-- readme: contributors -end -->

Although it looks fine in GitHub or some Markdown Editors, there will be a problem when I upload a README.md which has this form of <table></table> to Crowdin. Take an issue I recently encountered while testing andrii-bodnar/action-crowdin-contributors for example.

Origianally, I used v1.0.2 version of this GitHub Action to generate a Crowdin Contributors List. The generated HTML table is as follow:

Click to expand codes
<!-- CROWDIN-CONTRIBUTORS-START -->
<table>
  <tr>
    <td align="center" valign="top">
      <a href="https://crowdin.com/profile/hwhsu1231"><img alt="logo" style="width: 50px" src="https://crowdin-static.downloads.crowdin.com/avatar/15619673/medium/2c1c17f04c7d3131cd44cba220d3ab93.png" />
        <br />
        <sub><b>Haowei Hsu (hwhsu1231)</b></sub></a>
      <br />
      <sub><b>2334 words</b></sub>
      <br /><sub><b><code title="Chinese Simplified">zh-CN</code></b>, <b><code title="Chinese Traditional">zh-TW</code></b></sub>
    </td>
  </tr>
</table>
<!-- CROWDIN-CONTRIBUTORS-END -->

However, an error showed up when I tried to upload this README.md to Crowdin:

Click to expand logs
D:\Test\test-crowdin-readme>crowdin upload --branch test
[OK] Fetching project info
[SKIPPED] Branch 'test' already exists in the project
[ERROR] File 'test\README.md'
[ERROR] Wrong parameters:
<key: storageId, code: fileInvalid, message: An unknown error occurred while importing the file.>
[ERROR] Current execution finished with errors

D:\Test\test-crowdin-readme>

After reporting to Crowdin Support Team, they fix this issue by upgrading this GitHub Action to v1.0.3, in which they add <tbody></tbody> into <table></table>. The newly generated table is as follow:

Click to expand codes
<!-- CROWDIN-CONTRIBUTORS-START -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top">
        <a href="https://crowdin.com/profile/hwhsu1231"><img alt="logo" style="width: 50px" src="https://crowdin-static.downloads.crowdin.com/avatar/15619673/medium/2c1c17f04c7d3131cd44cba220d3ab93.png" />
          <br />
          <sub><b>Haowei Hsu (hwhsu1231)</b></sub></a>
        <br />
        <sub><b>2334 words</b></sub>
        <br /><sub><b><code title="Chinese Simplified">zh-CN</code></b>, <b><code title="Chinese Traditional">zh-TW</code></b></sub>
      </td>
    </tr>
  </tbody>
</table>
<!-- CROWDIN-CONTRIBUTORS-END -->

Therefore, I hope this GitHub Action, akhilmhdh/contributors-readme-action, can fix this issue as well. That is, I hope it can generate the following form of table:

<!-- readme: contributors -start -->
<table>
  <tbody>
    <tr>
      <td align="center">
        <a href="https://github.com/hwhsu1231">
          <img src="https://avatars.githubusercontent.com/u/71438617?v=4" width="50;" alt="hwhsu1231"/>
          <br />
          <sub><b>Haowei Hsu</b></sub>
        </a>
      </td>
    </tr>
  </tbody>
</table>
<!-- readme: contributors -end -->

Versions

akhilmhdh/[email protected]

hwhsu1231 avatar Feb 03 '24 16:02 hwhsu1231