From 3698d2e9af56a749e071da50e0d15c200cf85c61 Mon Sep 17 00:00:00 2001 From: JK Date: Tue, 10 Feb 2026 21:08:38 +0900 Subject: [PATCH] =?UTF-8?q?fix(converter):=20emoji=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EB=AF=B8=EC=84=A4=EC=B9=98=20=EC=8B=9C=20converter?= =?UTF-8?q?=20=EC=8B=A4=ED=96=89=EC=9D=84=20=EC=A4=91=EB=8B=A8=ED=95=A9?= =?UTF-8?q?=EB=8B=88=EB=8B=A4=20(#644)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - context.py: EMOJI_AVAILABLE 플래그를 제거하고, emoji import 실패 시 SystemExit을 발생시킵니다. - core.py: EMOJI_AVAILABLE 분기를 제거하고, emoji.emojize()를 직접 호출합니다. Co-Authored-By: Claude Opus 4.6 --- confluence-mdx/bin/converter/context.py | 6 ++++-- confluence-mdx/bin/converter/core.py | 25 +++++++------------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/confluence-mdx/bin/converter/context.py b/confluence-mdx/bin/converter/context.py index bc4c846e6..b9f59de98 100644 --- a/confluence-mdx/bin/converter/context.py +++ b/confluence-mdx/bin/converter/context.py @@ -21,9 +21,11 @@ try: import emoji - EMOJI_AVAILABLE = True except ImportError: - EMOJI_AVAILABLE = False + raise SystemExit( + "Required package 'emoji' is not installed.\n" + "Run: pip install 'emoji>=2.8.0'" + ) # Type definitions for page_v1 structure diff --git a/confluence-mdx/bin/converter/core.py b/confluence-mdx/bin/converter/core.py index 2f6a595ec..2dfa2e317 100644 --- a/confluence-mdx/bin/converter/core.py +++ b/confluence-mdx/bin/converter/core.py @@ -27,7 +27,7 @@ import converter.context as ctx from converter.context import ( PAGES_BY_TITLE, - CONFLUENCE_COLOR_TO_BADGE_COLOR, EMOJI_AVAILABLE, + CONFLUENCE_COLOR_TO_BADGE_COLOR, confluence_url, parse_confluence_url, convert_confluence_url, get_page_v1, get_attachments, set_page_v1, set_attachments, relative_path_to_titled_page, resolve_external_link, @@ -333,24 +333,13 @@ def convert_recursively(self, node): self.markdown_lines.append(fallback) elif shortname: # Convert shortname to actual emoji - if EMOJI_AVAILABLE: - # Use emoji library to convert shortname to actual emoji - emoji_char = emoji.emojize(shortname, language='alias') - if emoji_char != shortname: - # Conversion successful (converted to actual emoji) - self.markdown_lines.append(emoji_char) - else: - # Conversion failed (use fallback or shortname as-is) - if fallback: - self.markdown_lines.append(fallback) - else: - self.markdown_lines.append(shortname) + emoji_char = emoji.emojize(shortname, language='alias') + if emoji_char != shortname: + self.markdown_lines.append(emoji_char) + elif fallback: + self.markdown_lines.append(fallback) else: - # emoji library not available, use fallback or shortname - if fallback: - self.markdown_lines.append(fallback) - else: - self.markdown_lines.append(shortname) + self.markdown_lines.append(shortname) elif fallback: # No shortname but fallback is available self.markdown_lines.append(fallback)