sudoskys/telegramify-markdown

configurable unordered list item marker (default ⦁, allow -, •, etc.)

已关闭

#116 创建于 2026年5月27日

 (2 条评论) (0 个反应) (0 位负责人)Python (14 个派生)github user discovery
enhancementgood first issuemarkdown

仓库指标

星标
 (362 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Summary

Unordered list items are always rendered with a hardcoded ⦁ prefix. There is no way to customize this via get_runtime_config().markdown_symbol, unlike heading prefixes, task-list markers, and horizontal rules.

For bots and docs aimed at CommonMark-style output, a hyphen (- ) is often preferred.

Current behavior

In converter.py, _on_start_item() writes a fixed bullet for unordered lists:

Unordered list

self._buf.write(f"{indent}⦁ ") config.py exposes Symbol fields for:

heading_level_1 … heading_level_6 link, image task_completed, task_uncompleted horizontal_rule There is no field for unordered (or ordered) list markers.

Desired behavior

Add configuration on Symbol (or RenderConfig), for example:

from telegramify_markdown.config import get_runtime_config
cfg = get_runtime_config()
cfg.markdown_symbol.unordered_list_item = "- "   # or "• ", "⦁ ", "* ", etc.
# optional:
cfg.markdown_symbol.ordered_list_suffix = ". "  # if ever needed; today it's "N. "

Defaults should stay backward compatible:

unordered_list_item = "⦁ " (current behavior) Semantics: Value is inserted after indent, before list item text (same place as today’s ⦁ ). Plain text only (no entities on the marker), consistent with current list handling. Task lists should continue to use task_completed / task_uncompleted and replace the list marker as today (see _on_task_list_marker).

贡献者指南