lib/inky.rb in inky-rb-1.3.8.0 vs lib/inky.rb in inky-rb-1.4.2.0
- old
+ new
@@ -18,11 +18,12 @@
menu: 'menu',
center: 'center',
callout: 'callout',
spacer: 'spacer',
wrapper: 'wrapper',
- menu_item: 'item'
+ menu_item: 'item',
+ h_line: 'h-line',
}.merge(::Inky.configuration.components).merge(options[:components] || {})
self.component_lookup = components.invert
self.column_count = options[:column_count] || ::Inky.configuration.column_count
@@ -39,9 +40,10 @@
parse_cmd = str =~ /<html/i ? :parse : :fragment
html = Nokogiri::HTML.public_send(parse_cmd, str)
transform_doc(html)
string = html.to_html
string.gsub!(INTERIM_TH_TAG_REGEX, 'th')
+ string.gsub!(' ', ' ') # Convert non-breaking spaces to explicit entity
Inky::Core.re_inject_raws(string, raws)
end
def transform_doc(elem)
if elem.respond_to?(:children)