Sha256: d9895a97badc571f807a45ddddcfb9bb26cae20c94216d035dbde255857324a2
Contents?: true
Size: 1013 Bytes
Versions: 48
Compression:
Stored size: 1013 Bytes
Contents
# 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: # <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
48 entries across 48 versions & 1 rubygems