fix error
This commit is contained in:
parent
7b2c1d70d0
commit
2dec890b25
|
@ -45,8 +45,10 @@ class FaqsController < ApplicationController
|
||||||
tags = faq.tags.map{|tag| { "tag" => tag.name } } rescue []
|
tags = faq.tags.map{|tag| { "tag" => tag.name } } rescue []
|
||||||
temp_rich_title = Nokogiri::HTML(faq.rich_title).css('body')
|
temp_rich_title = Nokogiri::HTML(faq.rich_title).css('body')
|
||||||
temp_rich_title.children.each_with_index do |child,i|
|
temp_rich_title.children.each_with_index do |child,i|
|
||||||
|
if !child.attribute('style').nil?
|
||||||
temp_rich_title.children[i].attribute('style').value = child.attribute('style').value.gsub(/\b(?:font-size\s*?:\s*([^;>]*?)(?=[;">}]))/,'')
|
temp_rich_title.children[i].attribute('style').value = child.attribute('style').value.gsub(/\b(?:font-size\s*?:\s*([^;>]*?)(?=[;">}]))/,'')
|
||||||
end
|
end
|
||||||
|
end
|
||||||
{
|
{
|
||||||
"extras" => {"question" => temp_rich_title,"answer" => faq.answer},
|
"extras" => {"question" => temp_rich_title,"answer" => faq.answer},
|
||||||
"faqs_links" => faqs_links,
|
"faqs_links" => faqs_links,
|
||||||
|
|
Loading…
Reference in New Issue