[BUG] emoji_variant is ignored when markup contains tags
まだ誰も着手していません。
評価
調査の方向性
issue では、rich.markup.render 内の2つの経路と、プレーンテキストのセグメントで欠けている emoji_variant 引数が示されています。この関数と既存の markup テストを読み、render(":warning:", emoji_variant="emoji") と太字タグ付きのバージョンを比較する回帰ケースを追加してください。両方の出力に U+FE0F が含まれ、関連するテストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
- I've checked the docs and existing issues for possible solutions.
- I can't find this issue in the FAQ.
Describe the bug
emoji_variant is applied when markup contains no square brackets, but appears to be dropped when the markup has style tags. In rich.markup.render, the no-bracket fast path calls emoji_replace(markup, default_variant=emoji_variant). In the general parsing loop, plain-text segments call emoji_replace(plain_text) without forwarding emoji_variant.
Minimal reproduction (Rich 15.0.0):
from rich.markup import render
plain = render(":warning:", emoji_variant="emoji").plain
tagged = render("[bold]:warning:[/bold]", emoji_variant="emoji").plain
print(repr(plain), [hex(ord(char)) for char in plain])
print(repr(tagged), [hex(ord(char)) for char in tagged])
assert plain == tagged
Actual result
'⚠️' ['0x26a0', '0xfe0f']
'⚠' ['0x26a0']
The assertion fails because the tagged case is missing U+FE0F.
Expected result
Both strings should include U+FE0F and be equal. This means the configured emoji presentation is consistent with and without markup tags.
The same code path is used by callers such as Text.from_markup. I reproduced the issue with render(); I have not separately tested every higher-level caller.
Platform
Reproduced with Rich 15.0.0 on macOS.
- 主要言語
- Python
- スター
- 57.8k
- フォーク
- 2.6k
- 平均マージ
- 20分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Textualize/rich のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Textualize/rich#4269 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Textualize/rich#4268 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
Textualize/rich#4266 ·
-
[BUG] `Text.right_crop(0)` empties the text and an amount larger than the text makes `len()` raiseオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Textualize/rich#4265 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Textualize/rich#4262 ·
Textualize/rich の issue をすべて見る
似ている issue
-
ready-for-agent
難易度 1/5 1〜3時間 初心者へのやさしさ 79/100
gregwebs/agent-vm-images#216 ·
メンテナーはふだん 1 日以内に返信
-
Layout accepts a step threshold of 0 or less, then in-toto-verify crashes with StopIteration対応中かも @BahaaMattar が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
gcivil-nyu-org/team5-mon-fall26#145 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gcivil-nyu-org/team3-mon-fall26#156 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
antlr/grammars-v4#5220 ·
メンテナーはふだん 1 日以内に返信