Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
luiswitz committed Dec 5, 2024
1 parent 18596c3 commit 5a886b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/tip_tap/html_renderable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/tip_tap/nodes/heading_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/tip_tap/nodes/paragraph_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5a886b0

Please sign in to comment.