<commit_before>LIST = /((?:[*#]+[^\n*#]+\n)+)/
LIST_ELEMENT = /([*#]+)\s([^\n*#]+)\n/

DEF_LIST = /((?:;[^:;]+(?:\:[^\n]+)?\n)+)\n/
DEF_ELEMENT = /;([^:;]+)(?:\:([^\n]+))?/

$list_type = {'*' => 'ul', '#' => 'ol'}

module WikiThis
  module Parse
    def lists( wiki )
      wiki.gsub!(LIST) do | l |
        list = l.scan(LIST_ELEMENT)
        stack = []
        l = ''
        list.each do |e|
          if e[0].length > stack.length
            stack.push(e[0].chr)
            l = "#{l}<#{$list_type[e[0].chr]}>"
          end
          l = "#{l}<li>#{e[1]}/li>"
          if e[0].length < stack.length
            top = stack.pop
            l = "#{l}</#{$list_type[top]}>"
          end
        end
        until stack.empty? do
          top = stack.pop
          l = "#{l}</#{$list_type[top]}>"
        end
        l
      end
      wiki.gsub!(DEF_LIST) do | l |
        list = l.scan(DEF_ELEMENT)
        l = '<dl>'
        list.each do |e|
          l = "#{l}<dt>#{e[0]}</dt><dd>#{e[1]}</dd>"
        end
        l = "#{l}</dl>"
        l
      end
      wiki
    end
  end
end<commit_msg>FIXED: missing character in tag<commit_after>LIST = /((?:[*#]+[^\n*#]+\n)+)/
LIST_ELEMENT = /([*#]+)\s([^\n*#]+)\n/

DEF_LIST = /((?:;[^:;]+(?:\:[^\n]+)?\n)+)\n/
DEF_ELEMENT = /;([^:;]+)(?:\:([^\n]+))?/

$list_type = {'*' => 'ul', '#' => 'ol'}

module WikiThis
  module Parse
    def lists( wiki )
      wiki.gsub!(LIST) do | l |
        list = l.scan(LIST_ELEMENT)
        stack = []
        l = ''
        list.each do |e|
          if e[0].length > stack.length
            stack.push(e[0].chr)
            l = "#{l}<#{$list_type[e[0].chr]}>"
          end
          l = "#{l}<li>#{e[1]}</li>"
          if e[0].length < stack.length
            top = stack.pop
            l = "#{l}</#{$list_type[top]}>"
          end
        end
        until stack.empty? do
          top = stack.pop
          l = "#{l}</#{$list_type[top]}>"
        end
        l
      end
      wiki.gsub!(DEF_LIST) do | l |
        list = l.scan(DEF_ELEMENT)
        l = '<dl>'
        list.each do |e|
          l = "#{l}<dt>#{e[0]}</dt><dd>#{e[1]}</dd>"
        end
        l = "#{l}</dl>"
        l
      end
      wiki
    end
  end
end
{'fraction_non_alphanumeric': 0.254627539503386, 'fraction_numerical': 0.006320541760722348, 'mean_word_length': 1.5442020665901264, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7347021', 'n_tokens_mistral': 897, 'n_tokens_neox': 868, 'n_words': 157}