Skip to content

Add a slugify text helper #2

Description

@frankfika

需求

demo_toolkit.text 中新增 slugify(value: str) -> str,把普通标题转换为 URL slug。

验收示例

  • slugify("Hello GitHub Engineer") == "hello-github-engineer"
  • slugify(" Multiple Spaces ") == "multiple-spaces"
  • slugify("Python & Tests!") == "python-tests"
  • 连续分隔符需要合并,结果首尾不能包含 -
  • 补充单元测试并从包的 __init__.py 导出

只使用 Python 标准库。

Metadata

Metadata

Assignees

No one assigned

    Labels

    demo-readySmall, deterministic task prepared for GitHub Engineer demosenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions