<commit_before>createEditor = (textarea) ->
  id = textarea.attr('id')

  textarea.hide()
  textarea.data('editor', true)

  textarea.after($("""
    <div class="editor-wrap"><pre id='#{ id }_editor'></pre></div>
  """))

  editor = ace.edit("#{ id }_editor")
  editor.getSession().setValue(textarea.text())
  editor.getSession().setMode('ace/mode/yaml')
  editor.setTheme('ace/theme/github')
  editor.setHighlightActiveLine(false)
  editor.setShowPrintMargin(false)

  editor.on 'change', ->
    textarea.text(editor.getSession().getValue())

$(document).on "page:change", ->
  textarea = $('textarea.topology-graph')
  if textarea.length and ! textarea.data('editor')
    createEditor(textarea)<commit_msg>Adding a yellow underline when editing the topology lines<commit_after>createEditor = (textarea) ->
  id = textarea.attr('id')

  textarea.hide()
  textarea.data('editor', true)

  textarea.after($("""
    <div class="editor-wrap"><pre id='#{ id }_editor'></pre></div>
  """))

  editor = ace.edit("#{ id }_editor")
  editor.getSession().setValue(textarea.text())
  editor.getSession().setMode('ace/mode/yaml')
  editor.setTheme('ace/theme/github')
  editor.setHighlightActiveLine(false)
  editor.setShowPrintMargin(false)

  editor.on 'change', ->
    textarea.text(editor.getSession().getValue())
    $("a[href='#topology']").addClass("editing");

$(document).on "page:change", ->
  textarea = $('textarea.topology-graph')
  if textarea.length and ! textarea.data('editor')
    createEditor(textarea)
{'fraction_non_alphanumeric': 0.19403973509933775, 'fraction_numerical': 0.0, 'mean_word_length': 4.972332015810276, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '6527003', 'n_tokens_mistral': 510, 'n_tokens_neox': 478, 'n_words': 76}