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

Returns invalid attributes in tr/td elements #29

Closed
4 tasks done
Trott opened this issue Dec 19, 2021 · 3 comments
Closed
4 tasks done

Returns invalid attributes in tr/td elements #29

Trott opened this issue Dec 19, 2021 · 3 comments
Labels
💪 phase/solved Post is done

Comments

@Trott
Copy link

Trott commented Dec 19, 2021

Initial checklist

Affected packages and versions

remark-gfm@3.0.1

Link to runnable example

No response

Steps to reproduce

Run the example.js file in the README with the example.md in the README as input.

Expected behavior

Output should match the output shown in the README.

Actual behavior

The output for the table has align="none" attribute showing up. This appears to be an interoperability issue between rehypeStringify and remark-gfm (and really the underlying micromark-extension-gfm-table and hast-util-to-html modules).

align="none" is not valid, or at least that's my reading of https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-align. Regardless, align is deprecated and I think the right thing to do here is omit it (which is what the example output does).

Here's the output I get:

<h1>GFM</h1>
<h2>Autolink literals</h2>
<p><a href="http://www.example.com">www.example.com</a>, <a href="https://example.com">https://example.com</a>, and <a href="mailto:contact@example.com">contact@example.com</a>.</p>
<h2>Footnote</h2>
<p>A note<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref aria-describedby="footnote-label">1</a></sup></p>
<h2>Strikethrough</h2>
<p><del>one</del> or <del>two</del> tildes.</p>
<h2>Table</h2>
<table>
<thead>
<tr>
<th align="none">a</th>
<th align="left">b</th>
<th align="right">c</th>
<th align="center">d</th>
</tr>
</thead>
</table>
<h2>Tasklist</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" disabled> to do</li>
<li class="task-list-item"><input type="checkbox" checked disabled> done</li>
</ul>
<section data-footnotes class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
<ol>
<li id="user-content-fn-1">
<p>Big note. <a href="#user-content-fnref-1" data-footnote-backref class="data-footnote-backref" aria-label="Back to content">↩</a></p>
</li>
</ol>
</section>

Runtime

Node v17

Package manager

npm v7

OS

macOS

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Dec 19, 2021
@wooorm
Copy link
Member

wooorm commented Dec 19, 2021

Presumably a mistake I made before leaving for holiday last week. Will try to solve it tomorrow. Thanks for raising!

@github-actions

This comment has been minimized.

@wooorm
Copy link
Member

wooorm commented Dec 21, 2021

Something which I assumed was internal was leaking and causing this error. Fixed!

@wooorm wooorm added the 💪 phase/solved Post is done label Dec 21, 2021
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Dec 21, 2021
Trott added a commit to Trott/io.js that referenced this issue Dec 21, 2021
This fixes a bug that causes our tooling to generate invalid HTML. (The
`align` attribute on `tr` and `td` elements was ending up with the
invalid value of `"none"`.)

Refs: remarkjs/remark-gfm#29
Refs: syntax-tree/mdast-util-gfm-table@a28b860
nodejs-github-bot pushed a commit to nodejs/node that referenced this issue Dec 23, 2021
This fixes a bug that causes our tooling to generate invalid HTML. (The
`align` attribute on `tr` and `td` elements was ending up with the
invalid value of `"none"`.)

Refs: remarkjs/remark-gfm#29
Refs: syntax-tree/mdast-util-gfm-table@a28b860

PR-URL: #41260
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit to nodejs/node that referenced this issue Jan 14, 2022
This fixes a bug that causes our tooling to generate invalid HTML. (The
`align` attribute on `tr` and `td` elements was ending up with the
invalid value of `"none"`.)

Refs: remarkjs/remark-gfm#29
Refs: syntax-tree/mdast-util-gfm-table@a28b860

PR-URL: #41260
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit to nodejs/node that referenced this issue Jan 31, 2022
This fixes a bug that causes our tooling to generate invalid HTML. (The
`align` attribute on `tr` and `td` elements was ending up with the
invalid value of `"none"`.)

Refs: remarkjs/remark-gfm#29
Refs: syntax-tree/mdast-util-gfm-table@a28b860

PR-URL: #41260
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Jan 31, 2022
This fixes a bug that causes our tooling to generate invalid HTML. (The
`align` attribute on `tr` and `td` elements was ending up with the
invalid value of `"none"`.)

Refs: remarkjs/remark-gfm#29
Refs: syntax-tree/mdast-util-gfm-table@a28b860

PR-URL: nodejs#41260
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit to nodejs/node that referenced this issue Feb 1, 2022
This fixes a bug that causes our tooling to generate invalid HTML. (The
`align` attribute on `tr` and `td` elements was ending up with the
invalid value of `"none"`.)

Refs: remarkjs/remark-gfm#29
Refs: syntax-tree/mdast-util-gfm-table@a28b860

PR-URL: #41260
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

No branches or pull requests

2 participants