How to use the react-diff-view.markCharacterEdits function in react-diff-view

To help you get started, we’ve selected a few react-diff-view examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github theforeman / foreman / webpack / assets / javascripts / react_app / components / DiffView / DiffView.js View on Github external
const DiffView = ({ oldText, newText, viewType, patch }) => {
  const markEdits = markCharacterEdits({
    threshold: 30,
    markLongDistanceDiff: true,
  });

  // old,new Text
  if (patch === '') {
    const gitDiff = getDiff(oldText, newText);
    const files = parseDiff(gitDiff);
    const hunk = files[0].hunks;

    return (
      hunk && 
    );
  }
  // Patch
  const files = parseDiff(