# frozen_string_literal: true module Stepmod module Utils module Converters class Dl < ReverseAdoc::Converters::Base def convert(node, state = {}) cleaned_node = cleanup_trash_tags(node.clone) treat_children(cleaned_node, state) end private # https://github.com/metanorma/stepmod-utils/issues/48#issuecomment-784000377 # For simplicity reasons and so that we don't depend on the CVS repository's updates, we directly converting: #
a3ma   :   annotated 3d model assembly
into a3ma:: annotated 3d model assembly def cleanup_trash_tags(node) inner_content = node.inner_html inner_content .gsub!(/
<\/dt>\s*?
(.+?)   :   (.+?)<\/dd>/) do "
#{$1}
#{$2}
" end node.inner_html = inner_content node end ReverseAdoc::Converters.register :dl, Dl.new end end end end