INNER CODE UNIT · JavaScript

highlightRanges

DavidAnson/markdownlint · demo/default.js:95

  function highlightRanges(results, className) {
    for (const result of results) {
      const { errorRange, lineNumber } = result;
      const line = document.getElementById(`l${lineNumber}`);
      line.classList.add(className);
      if (errorRange) {
        const [ col, len ] = errorRange;
        for (let i = 0; i < len; i++) {
          var char = document.getElementById(`l${lineNumber}c${col + i}`);
          char.classList.add(className);
        }
      }
    }
  }

  // Handle input
  function onMarkdownInput() {
    // Markdown

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…