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