How to use the react-diff-view.tokenize 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 mozilla-releng / balrog / ui / src / components / DiffRule / tokenize.js View on Github external
export default hunks => {
  if (!hunks) {
    return undefined;
  }

  const options = {
    highlight: false,
    enhancers: [markEdits(hunks, { type: 'line' })],
  };

  try {
    return tokenize(hunks, options);
  } catch (ex) {
    return undefined;
  }
};
github react-native-community / upgrade-helper / src / components / common / Diff / Diff.js View on Github external
{hunks => {
            const options = {
              enhancers: [markEdits(hunks)]
            }

            const tokens = tokenize(hunks, options)

            return hunks.map(hunk => [
              
                {hunk.content}
              ,
              
            ])
          }}