Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed May 6, 2024
1 parent 320c2ff commit 671a5a4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 45 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
name: ${{matrix.node}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
strategy:
matrix:
node:
- lts/gallium
- node
- lts/iron
7 changes: 3 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,6 @@ function startTag(node, state) {
{...node, children: []},
{space: ns === webNamespaces.svg ? 'svg' : 'html'}
)
// Always element.
/* c8 ignore next */
const attrs = 'attrs' in result ? result.attrs : []

/** @type {TagToken} */
const tag = {
Expand All @@ -552,7 +549,9 @@ function startTag(node, state) {
// We always send start and end tags.
selfClosing: false,
ackSelfClosing: false,
attrs,
// Always element.
/* c8 ignore next */
attrs: 'attrs' in result ? result.attrs : [],
location: createParse5Location(node)
}

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"hastscript": "^9.0.0",
"mdast-util-from-markdown": "^2.0.0",
"prettier": "^3.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"unist-builder": "^4.0.0",
"xo": "^0.56.0"
"xo": "^0.58.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
Expand Down
62 changes: 31 additions & 31 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ HTML) again, keeping positional info okay.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`raw(tree[, options])`](#rawtree-options)
* [`Options`](#options)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`raw(tree[, options])`](#rawtree-options)
* [`Options`](#options)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down Expand Up @@ -53,10 +53,10 @@ If your final result is HTML and you trust content, then “strings” are fine
HTML through untouched).
But there are two main cases where a proper syntax tree is preferred:

* hast utilities need a proper syntax tree as they operate on actual nodes to
inspect or transform things, they can’t operate on strings of HTML
* other output formats (React, MDX, etc) need actual nodes and can’t handle
strings of HTML
* hast utilities need a proper syntax tree as they operate on actual nodes to
inspect or transform things, they can’t operate on strings of HTML
* other output formats (React, MDX, etc) need actual nodes and can’t handle
strings of HTML

The plugin [`rehype-raw`][rehype-raw] wraps this utility at a higher-level
(easier) abstraction.
Expand Down Expand Up @@ -127,10 +127,10 @@ nodes into actual nodes.

###### Parameters

* `tree` ([`Node`][node])
— original hast tree to transform
* `options` ([`Options`][api-options], optional)
— configuration
* `tree` ([`Node`][node])
— original hast tree to transform
* `options` ([`Options`][api-options], optional)
— configuration

###### Returns

Expand All @@ -142,12 +142,12 @@ Configuration (TypeScript type).

###### Fields

* `passThrough` (`Array<string>`, optional)
— list of custom hast node types to pass through (keep).
If the passed through nodes have children, those children are expected to be
hast and will be handled by this utility
* `file` ([`VFile`][vfile], optional)
— corresponding virtual file representing the input document
* `passThrough` (`Array<string>`, optional)
— list of custom hast node types to pass through (keep).
If the passed through nodes have children, those children are expected to be
hast and will be handled by this utility
* `file` ([`VFile`][vfile], optional)
— corresponding virtual file representing the input document

## Types

Expand Down Expand Up @@ -189,10 +189,10 @@ Either do not use this utility in combination with user input, or use

## Related

* [`mdast-util-to-hast`][mdast-util-to-hast]
— transform mdast to hast
* [`rehype-raw`](https://github.com/rehypejs/rehype-raw)
— rehype plugin
* [`mdast-util-to-hast`][mdast-util-to-hast]
— transform mdast to hast
* [`rehype-raw`](https://github.com/rehypejs/rehype-raw)
— rehype plugin

## Contribute

Expand Down
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ test('integration', async function (t) {
await t.test(
'should work together with the mdast -> hast utilities',
async function () {
const doc = [
const document = [
'<i>Some title</i>',
'',
'<p>Hello, world!',
Expand Down Expand Up @@ -1002,9 +1002,9 @@ test('integration', async function (t) {
}
}

const mdast = fromMarkdown(doc)
const mdast = fromMarkdown(document)
const hast = toHast(mdast, {allowDangerousHtml: true})
const hast2 = raw(hast, {file: new VFile(doc)})
const hast2 = raw(hast, {file: new VFile(document)})

assert.deepEqual(hast2, expected)

Expand Down

0 comments on commit 671a5a4

Please sign in to comment.