Skip to content

Handle "width" in tables in direct_html #1540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def convert_table_tag(node)
'<table',
' border="1" cellpadding="4px"',
node.title ? %( summary="#{node.title}") : nil,
(width = node.attr 'width') ? %( width="#{width}") : nil,
'>',
].compact.join
end
Expand Down
15 changes: 15 additions & 0 deletions resources/asciidoctor/spec/docbook_compat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1713,5 +1713,20 @@ def expect_admonition(body)
HTML
end
end
context 'with width' do
let(:input) do
<<~ASCIIDOC
[width=50%]
|===
|Col 1 | Col 2
|===
ASCIIDOC
end
it 'has the width' do
expect(converted).to include <<~HTML
<table border="1" cellpadding="4px" width="50%">
HTML
end
end
end
end