Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last column attribute setting results unexpectedly #142

Open
hasanozgilik opened this issue Jun 23, 2022 · 1 comment
Open

Last column attribute setting results unexpectedly #142

hasanozgilik opened this issue Jun 23, 2022 · 1 comment

Comments

@hasanozgilik
Copy link

hasanozgilik commented Jun 23, 2022

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>
@TheNorthMemory
Copy link
Contributor

It was resolved by #155 and released on v4.2.0. See the test case:

markdown-it-attrs/test.js

Lines 304 to 307 in 80a8e52

expected += '<tr>\n';
expected += '<th style="text-align:center">title</th>\n';
expected += '<th style="text-align:center" class="title-primar">title</th>\n';
expected += '</tr>\n';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants