markPlaceHolders()

in src/executable-code/executable-fragment.js [260:281]


  markPlaceHolders() {
    let taskRanges = this.getTaskRanges();
    this.codemirror.setValue(
      this.codemirror
        .getValue()
        .replace(new RegExp(escapeRegExp(MARK_PLACEHOLDER_OPEN), 'g'), '')
        .replace(new RegExp(escapeRegExp(MARK_PLACEHOLDER_CLOSE), 'g'), ''),
    );

    taskRanges.forEach((task) => {
      this.codemirror.markText(
        { line: task.line, ch: task.ch },
        { line: task.line, ch: task.ch + task.length },
        {
          className: SELECTORS.MARK_PLACEHOLDER,
          startStyle: SELECTORS.MARK_PLACEHOLDER_START,
          endStyle: SELECTORS.MARK_PLACEHOLDER_END,
          handleMouseEvents: true,
        },
      );
    });
  }