Skip to content

Last column attribute setting results unexpectedly #142

@hasanozgilik

Description

@hasanozgilik

Hi team
I am trying to solve sonar security issue , https://rules.sonarsource.com/html/RSPEC-1102.
Following sample shows that , only last column attribute settings is sending compiled attribute to "thead" instead of "th".
And it does not solve the sonar issue.
Is there a way to fix it.

Markdown-it versions:

"markdown-it": "^13.0.1",
"markdown-it-attrs": "^4.1.4",

Example input:

| Value {scope=col}   | Description {scope=col}                    | Is Final Status {scope=col}  |
|:-------|:------------------------------|:----------------:|
| -1     | MESSAGE NOT FOUND             |       YES        |
| 0      | NEW MESSAGE                   |        NO        |

Current output:

<thead scope="col">
<tr>
  <th style="text-align:left;" scope="col">Value</th>
  <th style="text-align:left;" scope="col">Description</th>
  <th style="text-align:center;">Is Final Status</th>
</tr>
</thead>

Expected output:

<thead >
<tr>
  <th style="text-align:left;" scope="col">Value</th>
  <th style="text-align:left;" scope="col">Description</th>
  <th style="text-align:center;" scope="col">Is Final Status</th>
</tr>
</thead>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions