
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
@mapbox/hast-util-table-cell-style
Advanced tools
Transform deprecated styling attributes on HAST table cells to inline styles
Transform deprecated styling attributes on HAST table cells to inline styles.
HAST is the abstract syntax (AST) tree representing HTML that rehype uses.
If you use remark to process Markdown as GitHub Flavored Markdown, you may find that your table cell elements end up with align
attributes.
However, align
on these elements was deprecated in HTML5: the suggestion is to use a style
attribute that sets text-align
, instead.
This matters because more recent syntaxes might altogether ignore align
or other deprecated styling attributes.
React, for example, does not support align
attributes; so if you try to transform Markdown to React elements, you'll lose your align
values.
(remark-react had to confront this issue.)
This simple utility transforms the following deprecated styling attributes on <td>
, <th>
, and <tr>
elements to equivalent inline styles:
align
valign
width
height
npm install @mapbox/hast-util-table-cell-style
const tableCellStyle = require('@mapbox/hast-util-table-cell-style');
// Use rehype to get an AST.
const transformed = tableCellStyle(ast);
Mutates the HAST AST you pass in, and returns it.
0.2.1
FAQs
Transform deprecated styling attributes on HAST table cells to inline styles
The npm package @mapbox/hast-util-table-cell-style receives a total of 122,773 weekly downloads. As such, @mapbox/hast-util-table-cell-style popularity was classified as popular.
We found that @mapbox/hast-util-table-cell-style demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.