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).

貢獻者指南