{"_id":"@cjser/micromark-util-resolve-all","name":"@cjser/micromark-util-resolve-all","dist-tags":{"latest":"2.0.1-cjser.2"},"versions":{"2.0.1-cjser.2":{"name":"@cjser/micromark-util-resolve-all","version":"2.0.1-cjser.2","description":"micromark utility to resolve subtokens","license":"MIT","keywords":["micromark","util","utility","resolve"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"dependencies":{"@cjser/micromark-util-types":"2.0.2-cjser.2"},"xo":{"envs":["shared-node-browser"],"prettier":true,"rules":{"unicorn/prefer-code-point":"off"}},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"2.0.1","cjserVersion":2,"original":{"name":"micromark-util-resolve-all","version":"2.0.1","exports":"./index.js","repository":"https://github.com/micromark/micromark/tree/main/packages/micromark-util-resolve-all","dependencies":{"micromark-util-types":"^2.0.0"},"files":["index.d.ts.map","index.d.ts","index.js"]}},"gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_id":"@cjser/micromark-util-resolve-all@2.0.1-cjser.2","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-6dEycFySurElXx0+kqgBJMBMhf7dejZb4E1iPRe10E4Lt0kd6t8pLsRLoaXrS72G7X6c+4rax6s+TPq8AAFQ7w==","shasum":"6ea7c85db41ff4447a2b61bdfd12230699600b07","tarball":"https://registry.npmjs.org/@cjser/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1-cjser.2.tgz","fileCount":7,"unpackedSize":12730,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCbShqdXcjBZF7yaOyi8YWZHGh3ZiE5b+Tm/wGb+LEXCgIhAL2c0QkQVIMUih6u4ocQ546FckKv32BcN46NNLYgFxsf"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/micromark-util-resolve-all_2.0.1-cjser.2_1778865046432_0.6140427055518036"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T17:10:46.324Z","2.0.1-cjser.2":"2026-05-15T17:10:46.573Z","modified":"2026-05-15T17:10:46.892Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"micromark utility to resolve subtokens","keywords":["micromark","util","utility","resolve"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"license":"MIT","readme":"# micromark-util-resolve-all\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\n[micromark][] utility to resolve subtokens.\n\n[Resolvers][resolver] are functions that take events and manipulate them.\nThis is needed for example because media (links, images) and attention (strong,\nitalic) aren’t parsed left-to-right.\nInstead, their openings and closings are parsed, and when done, their openings\nand closings are matched, and left overs are turned into plain text.\nBecause media and attention can’t overlap, we need to perform that operation\nwhen one closing matches an opening, too.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`resolveAll(constructs, events, context)`](#resolveallconstructs-events-context)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package exposes a micromark internal that you probably don’t need.\n\n## When should I use this?\n\nThis package might be useful when you are making your own micromark extensions.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-util-resolve-all\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {resolveAll} from 'https://esm.sh/micromark-util-resolve-all@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {resolveAll} from 'https://esm.sh/micromark-util-resolve-all@1?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {push} from 'micromark-util-chunked'\nimport {resolveAll} from 'micromark-util-resolve-all'\n\n/**\n * @type {Resolver}\n */\nfunction resolveAllAttention(events, context) {\n  // …\n\n  // Walk through all events.\n  while (++index < events.length) {\n    // Find a token that can close.\n    if (\n      events[index][0] === 'enter' &&\n      events[index][1].type === 'attentionSequence' &&\n      events[index][1]._close\n    ) {\n      open = index\n\n      // Now walk back to find an opener.\n      while (open--) {\n        // Find a token that can open the closer.\n        if (\n          // …\n        ) {\n          // …\n\n          // Opening.\n          nextEvents = push(nextEvents, [\n            // …\n          ])\n\n          // Between.\n          nextEvents = push(\n            nextEvents,\n            resolveAll(\n              context.parser.constructs.insideSpan.null,\n              events.slice(open + 1, index),\n              context\n            )\n          )\n\n          // Closing.\n          nextEvents = push(nextEvents, [\n            // …\n          ])\n\n          // …\n        }\n      }\n    }\n  }\n\n  // …\n}\n```\n\n## API\n\nThis module exports the identifier [`resolveAll`][api-resolve-all].\nThere is no default export.\n\n### `resolveAll(constructs, events, context)`\n\nCall all `resolveAll`s in `constructs`.\n\n###### Parameters\n\n* `constructs` (`Array<Construct>`)\n  — list of constructs, optionally with `resolveAll`s\n* `events` (`Array<Event>`)\n  — list of events\n* `context` (`TokenizeContext`)\n  — context used by `tokenize`\n\n###### Returns\n\nChanged events (`Array<Events>`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`micromark-util-resolve-all@2`, compatible with Node.js 16.\nThis package works with `micromark@3`.\n\n## Security\n\nThis package is safe.\nSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to\nsubmit a security report.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`micromark/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organisation, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-resolve-all.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-util-resolve-all\n\n[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-resolve-all\n\n[bundle-size]: https://bundlejs.com/?q=micromark-util-resolve-all\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[opencollective]: https://opencollective.com/unified\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/micromark/.github\n\n[securitymd]: https://github.com/micromark/.github/blob/main/security.md\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[resolver]: https://github.com/micromark/micromark/blob/a571c09/packages/micromark-util-types/index.js#L219\n\n[typescript]: https://www.typescriptlang.org\n\n[micromark]: https://github.com/micromark/micromark\n\n[api-resolve-all]: #resolveallconstructs-events-context\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/micromark/micromark/tree/main/packages/micromark-util-resolve-all\n","readmeFilename":"readme.md","_rev":"1-f73d81505891422a945595d452fb95f8"}