Skip to content

Commit b3f60bd

Browse files
committed
make spans containing images blocks
1 parent 53ac41c commit b3f60bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/ydocx/parser.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ def initialize
132132
@runs = []
133133
end
134134
def to_markup
135-
markup :span, @runs.map { |r| r.to_markup }, {:class => @css_class }
135+
classes = []
136+
classes << @css_class if @css_class
137+
# Image spans need to be blocks to size correctly
138+
classes << 'block' unless @runs.find_index{ |r| r.is_a?(Image) }.nil?
139+
markup :span, @runs.map { |r| r.to_markup }, {:class => classes.join(' ')}
136140
end
137141
end
138142

0 commit comments

Comments
 (0)