Fix author text bug.

This commit is contained in:
BoHung Chiu 2023-10-03 21:12:29 +08:00
parent 6c7d7ad339
commit 1e1ac607db
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ module Admin::PersonalBooksHelper
end end
full_authors_names = get_member(book).collect do |member| full_authors_names = get_member(book).collect do |member|
member_name = member.name member_name = member.name
idx = authors_names.index{|a| a.chomp('*') == member_name} idx = authors_names.index{|a| a.match(/(^|[ \(\[])#{member_name}([ \)\]\*]|$)/)}
if idx if idx
member_name = authors_names[idx] member_name = authors_names[idx]
authors_names[idx] = nil authors_names[idx] = nil
@ -31,7 +31,7 @@ module Admin::PersonalBooksHelper
end end
full_authors = get_member(book).collect do |member| full_authors = get_member(book).collect do |member|
member_name = member.name member_name = member.name
idx = authors_names.index{|a| a.chomp('*') == member_name} idx = authors_names.index{|a| a.match(/(^|[ \(\[])#{member_name}([ \)\]\*]|$)/)}
if idx if idx
member_name = authors_names[idx] member_name = authors_names[idx]
authors_names[idx] = nil authors_names[idx] = nil