Skip to content

Commit 8ad0b80

Browse files
committed
refactor: ニュース絵文字の判定ロジックを改善
1 parent 986d4ad commit 8ad0b80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/home/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
<ul class="list" style="list-style: none;">
180180
<% @news_items.each do |news| %>
181181
<li>
182-
<% has_emoji = news.title.chars.any? { |char| char.match?(/[\p{Emoji}\p{Emoji_Component}&&[:^ascii:]]/) } %>
182+
<% has_emoji = news.title.chars.any? { |char| char.match?(/[\p{Emoji}&&[^0-9#*]]/) } %>
183183
<% if has_emoji %>
184184
<% # 絵文字が含まれていれば、タイトルをそのまま表示 %>
185185
<%= link_to news.title, news.url, target: '_blank', rel: 'noopener noreferrer' %>

0 commit comments

Comments
 (0)