spec/builders/epub_spec.rb in softcover-1.2.6 vs spec/builders/epub_spec.rb in softcover-1.2.7
- old
+ new
@@ -170,9 +170,27 @@
it "should create math PNGs" do
expect(path("epub/OEBPS/images/texmath")).to exist
expect(Dir[path("epub/OEBPS/images/texmath/*.png")]).not_to be_empty
end
+
+ it "should record vertical-align of inline math SVGs" do
+ content = File.read(path("./epub/OEBPS/a_chapter_fragment.xhtml"))
+ html = Nokogiri::HTML(content)
+ math_imgs = html.search('span.inline_math img')
+ math_imgs.each do |math_img|
+ expect(math_img['style']).to match /vertical-align/
+ end
+ end
+
+ it "should not add vertical-align to displayed math" do
+ content = File.read(path("./epub/OEBPS/a_chapter_fragment.xhtml"))
+ html = Nokogiri::HTML(content)
+ math_imgs = html.search('div.equation img')
+ math_imgs.each do |math_img|
+ expect(math_img['style']).not_to match /vertical-align/
+ end
+ end
end
it "should create the style files" do
expect(path('epub/OEBPS/styles/page-template.xpgt')).to exist
expect(path('epub/OEBPS/styles/pygments.css')).to exist
\ No newline at end of file