Files
n8n_Demo/web_frontend/food-order-demo/node_modules/micromark-util-resolve-all
Yep_Q c3eb7125cc feat: 创建食品订单班演示系统基础框架
详细说明:
- 基于文旅订单班框架复制创建food-order-demo项目
- 修改端口配置为4174避免冲突
- 更新LandingPage为青莳轻食主题(绿色健康风格)
- 重新定义7个食品行业专业Agent:
  * 市场研究专家:轻食市场分析、客群画像
  * 营养配方师:营养成分配比、低卡高蛋白设计
  * 供应链管理专家:有机食材供应、溯源体系
  * 品牌策划师:品牌定位、店铺空间布局
  * 财务分析师:投资预算、ROI分析
  * 运营管理专家:运营流程、品控标准
  * 食品创业导师:中央协调、方案整合
- 创建专用启动脚本start.sh
- 验证系统可正常运行在端口4174
- 实现代码复用率90%,符合预期目标

影响文件: web_frontend/food-order-demo/
技术栈: React 18 + TypeScript + Tailwind CSS + Zustand
2025-09-28 10:32:44 +08:00
..

micromark-util-resolve-all

Build Coverage Downloads Size Sponsors Backers Chat

micromark utility to resolve subtokens.

Resolvers are functions that take events and manipulate them. This is needed for example because media (links, images) and attention (strong, italic) arent parsed left-to-right. Instead, their openings and closings are parsed, and when done, their openings and closings are matched, and left overs are turned into plain text. Because media and attention cant overlap, we need to perform that operation when one closing matches an opening, too.

Contents

What is this?

This package exposes a micromark internal that you probably dont need.

When should I use this?

This package might be useful when you are making your own micromark extensions.

Install

This package is ESM only. In Node.js (version 16+), install with npm:

npm install micromark-util-resolve-all

In Deno with esm.sh:

import {resolveAll} from 'https://esm.sh/micromark-util-resolve-all@1'

In browsers with esm.sh:

<script type="module">
  import {resolveAll} from 'https://esm.sh/micromark-util-resolve-all@1?bundle'
</script>

Use

import {push} from 'micromark-util-chunked'
import {resolveAll} from 'micromark-util-resolve-all'

/**
 * @type {Resolver}
 */
function resolveAllAttention(events, context) {
  // …

  // Walk through all events.
  while (++index < events.length) {
    // Find a token that can close.
    if (
      events[index][0] === 'enter' &&
      events[index][1].type === 'attentionSequence' &&
      events[index][1]._close
    ) {
      open = index

      // Now walk back to find an opener.
      while (open--) {
        // Find a token that can open the closer.
        if (
          // …
        ) {
          // …

          // Opening.
          nextEvents = push(nextEvents, [
            // …
          ])

          // Between.
          nextEvents = push(
            nextEvents,
            resolveAll(
              context.parser.constructs.insideSpan.null,
              events.slice(open + 1, index),
              context
            )
          )

          // Closing.
          nextEvents = push(nextEvents, [
            // …
          ])

          // …
        }
      }
    }
  }

  // …
}

API

This module exports the identifier resolveAll. There is no default export.

resolveAll(constructs, events, context)

Call all resolveAlls in constructs.

Parameters
  • constructs (Array<Construct>) — list of constructs, optionally with resolveAlls
  • events (Array<Event>) — list of events
  • context (TokenizeContext) — context used by tokenize
Returns

Changed events (Array<Events>).

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

Projects maintained by the unified collective are compatible with maintained versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of Node. This means we try to keep the current release line, micromark-util-resolve-all@2, compatible with Node.js 16. This package works with micromark@3.

Security

This package is safe. See security.md in micromark/.github for how to submit a security report.

Contribute

See contributing.md in micromark/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer