diff --git a/lib/tip_tap/html_renderable.rb b/lib/tip_tap/html_renderable.rb index ab389fd..012f235 100644 --- a/lib/tip_tap/html_renderable.rb +++ b/lib/tip_tap/html_renderable.rb @@ -58,12 +58,12 @@ def to_html end def html_attributes - {style: inline_styles, class: html_class_name}.reject { |key, value| value.blank?} + {style: inline_styles, class: html_class_name}.reject { |key, value| value.blank? } end def inline_styles styles = [] - styles << "text-align: #{attrs['textAlign']};" if attrs["textAlign"] + styles << "text-align: #{attrs["textAlign"]};" if attrs["textAlign"] styles.join(" ") end end diff --git a/spec/tip_tap/nodes/heading_spec.rb b/spec/tip_tap/nodes/heading_spec.rb index 0a34942..e7fd882 100644 --- a/spec/tip_tap/nodes/heading_spec.rb +++ b/spec/tip_tap/nodes/heading_spec.rb @@ -14,7 +14,7 @@ context "when the textAlign attribute is present" do it "returns a tag with the specified text alignment style" do - node = TipTap::Nodes::Heading.from_json({content: [], attrs: {'textAlign' => 'center', level: 2}}) + node = TipTap::Nodes::Heading.from_json({content: [], attrs: {"textAlign" => "center", :level => 2}}) html = node.to_html expect(html).to be_a(String) diff --git a/spec/tip_tap/nodes/paragraph_spec.rb b/spec/tip_tap/nodes/paragraph_spec.rb index 229d007..cf361a9 100644 --- a/spec/tip_tap/nodes/paragraph_spec.rb +++ b/spec/tip_tap/nodes/paragraph_spec.rb @@ -14,7 +14,7 @@ context "when the textAlign attribute is present" do it "returns a p tag with the specified text alignment style" do - node = TipTap::Nodes::Paragraph.from_json({content: [], attrs: {'textAlign' => 'center'}}) + node = TipTap::Nodes::Paragraph.from_json({content: [], attrs: {"textAlign" => "center"}}) html = node.to_html expect(html).to be_a(String)