code: def list_to_markdown_representation(
      tokens: List[str],
      masks: List[bool],
      pad_token: int,
      num_chars: int = 65,
  ):
      """
      Creates a markdown representation string from a list of tokens,
      with HTML line breaks after 'num_chars' characters.
      Masked tokens will be emphasized in HTML representation.
  
      """
      x = []
      sublist: List[str] = []
      raw_sublist: List[str] = []
      for token, mask in zip(tokens, masks):
          if len(token) + len(", ".join(raw_sublist)) > num_chars:
              x.append(", ".join(sublist))
              sublist = []
              raw_sublist = []
  
          raw_sublist.append(token)
          token_formatted = html.escape(token)
          if mask:
              token_formatted = f"""***{token_formatted}***"""
          elif token == pad_token:
              token_formatted = f"""<span style="color: rgba(70, 70, 70, 0.5);">{
              token_formatted
              }</span>"""
          sublist.append(token_formatted)
  
      if sublist:  # add any remaining items in sublist
          x.append(", ".join(sublist))
  
      list_representation = "\n[" + "<br />".join(x) + "]\n"
      return list_representation
  
file_path: h2o-llmstudio/llm_studio/src/utils/plot_utils.py
imports: import html
  import re
  from dataclasses import dataclass
  from typing import List
label_desc: Use image node_id 4 for calling a global function with example usage: list_to_markdown_representation(tokens, masks, pad_token, num_chars) and returns: list_representation