Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Dec 16, 2023
1 parent 28c43a1 commit e1bc556
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions lib/asciidoctor/converter/semantic_html5.rb
Expand Up @@ -101,16 +101,11 @@ def convert_ulist node
ret = [%(<ul#{attributes}>)]
ret << %(<strong class="title">#{node.title}</strong>) if node.title?
node.items.each do |item|
sub_content = if item.blocks?
%(
ret << %(<li>#{item.text}#{item.blocks? ? %(
#{item.content}
)
else
""
end
ret << %(<li>#{item.text}#{sub_content}</li>)
) : ''}</li>)
end
ret << %{</ul>}
ret << %(</ul>)
ret.join LF
end

Expand All @@ -126,48 +121,38 @@ def convert_olist node
if node.option? 'reversed'
olist_attributes << %( reversed="true")
end
ret = [%(<ol#{attributes}#{olist_attributes.join('')}>)]
ret = [%(<ol#{attributes}#{olist_attributes.join}>)]
ret << %(<strong class="title">#{node.title}</strong>) if node.title?
node.items.each do |item|
sub_content = if item.blocks?
%(
ret << %(<li>#{item.text}#{item.blocks? ? %(
#{item.content}
)
else
""
end
ret << %(<li>#{item.text}#{sub_content}</li>)
) : ''}</li>)
end
ret << %{</ol>}
ret << %(</ol>)
ret.join LF
end

def convert_dlist node
roles = []
roles << node.style if node.style
roles << node.role if node.role
role = roles.join " "
role = roles.join ' '
attributes = common_html_attributes node.id, role.empty? ? nil : role
dlist_attributes = []
if node.list_marker_keyword
dlist_attributes << %( type="#{node.list_marker_keyword}")
end
ret = [%(<dl#{attributes}#{dlist_attributes.join('')}>)]
ret = [%(<dl#{attributes}#{dlist_attributes.join}>)]
ret << %(<strong class="title">#{node.title}</strong>) if node.title?
node.items.each do |terms, desc|
terms.each do |term|
ret << %(<dt>#{term.text}</dt>)
ret << %(<dt>#{term.text}</dt>)
end
sub_content = if desc.blocks?
%(
ret << %(<dd>#{desc.text}#{ desc.blocks? ? %(
#{desc.content}
)
else
""
end
ret << %(<dd>#{desc.text}#{sub_content}</dd>)
) : ''}</dd>)
end
ret << %{</dl>}
ret << %(</dl>)
ret.join LF
end

Expand Down

0 comments on commit e1bc556

Please sign in to comment.