Replace all occurences
This commit is contained in:
@@ -66,10 +66,10 @@ class WpUser < WpItem
|
|||||||
title_tag.force_encoding('UTF-8') if title_tag.encoding == Encoding::ASCII_8BIT
|
title_tag.force_encoding('UTF-8') if title_tag.encoding == Encoding::ASCII_8BIT
|
||||||
title_tag = Nokogiri::HTML::DocumentFragment.parse(title_tag).to_s
|
title_tag = Nokogiri::HTML::DocumentFragment.parse(title_tag).to_s
|
||||||
# & are not decoded with Nokogiri
|
# & are not decoded with Nokogiri
|
||||||
title_tag.sub!('&', '&')
|
title_tag.gsub!('&', '&')
|
||||||
|
|
||||||
# replace UTF chars like » with dummy character
|
# replace UTF chars like » with dummy character
|
||||||
title_tag.sub!(/&#(\d+);/, '|')
|
title_tag.gsub!(/&#(\d+);/, '|')
|
||||||
|
|
||||||
name = title_tag[%r{([^|«»]+) }, 1]
|
name = title_tag[%r{([^|«»]+) }, 1]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user