Sha256: c0436225a51995ea960956ec17851d5df3380c79a0bd02740ff505f4f948c473
Contents?: true
Size: 1016 Bytes
Versions: 13
Compression:
Stored size: 1016 Bytes
Contents
# frozen_string_literal: true module Stepmod module Utils module Converters class Dl < Stepmod::Utils::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: # <dt></dt><dd>a3ma   :   annotated 3d model assembly</dd> into a3ma:: annotated 3d model assembly def cleanup_trash_tags(node) inner_content = node.inner_html inner_content .gsub!(/<dt><\/dt>\s*?<dd>(.+?)   :   (.+?)<\/dd>/) do "<dt>#{$1}</dt><dd>#{$2}</dd>" end node.inner_html = inner_content node end ReverseAdoc::Converters.register :dl, Dl.new end end end end
Version data entries
13 entries across 13 versions & 1 rubygems