diff --git a/README.md b/README.md index 3fb7c91b..ff292cad 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ class Diff extends PureComponent { |newValue |`string` |`''` |New value as string. | |splitView |`boolean` |`true` |Switch between `unified` and `split` view. | |disableWordDiff |`boolean` |`false` |Show and hide word diff in a diff line. | +|useCharDiff |`boolean` |`true` |Use char-based diff by default. | |hideLineNumbers |`boolean` |`false` |Show and hide line numbers. | |renderContent |`function` |`undefined` |Render Prop API to render code in the diff viewer. Helpful for [syntax highlighting](#syntax-highlighting) | |onLineNumberClick |`function` |`undefined` |Event handler for line number click. `(lineId: string) => void` | diff --git a/examples/src/index.tsx b/examples/src/index.tsx index 56ae650e..65284f7a 100644 --- a/examples/src/index.tsx +++ b/examples/src/index.tsx @@ -19,6 +19,7 @@ interface ExampleState { highlightLine?: string[]; language?: string; enableSyntaxHighlighting?: boolean; + useCharDiff?: boolean; } const P = (window as any).Prism; @@ -31,6 +32,7 @@ class Example extends React.Component<{}, ExampleState> { highlightLine: [], language: 'javascript', enableSyntaxHighlighting: true, + useCharDiff: true, }; } @@ -200,6 +202,33 @@ class Example extends React.Component<{}, ExampleState> { } /> +
+ Char / word diffs: + + + +
+
+ +