Closed StanlieK closed 6 months ago
This PR will add read-only functionality to diff mode.
You can enable the read-only mode for the diff viewer in two ways:
readOnly
MDXEditor
readOnlyDiff
diffSourcePlugin
For example, the code below will display the differences but prevent code editing in diff view:
<MDXEditor markdown={'hello world'} plugins={[ diffSourcePlugin({ diffMarkdown: 'An older version', viewMode: 'diff', readOnlyDiff: true }) ]} />
And this code will prevent any code changes in any mode:
<MDXEditor markdown={'hello world'} readOnly={true} plugins={[ diffSourcePlugin({ diffMarkdown: 'An older version', viewMode: 'diff' }) ]} />
:tada: This PR is included in version 2.11.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This PR will add read-only functionality to diff mode.
You can enable the read-only mode for the diff viewer in two ways:
readOnly
flag on theMDXEditor
- this makes the entire editor read-only, including both the source and rich-text modes.readOnlyDiff
flag on thediffSourcePlugin
- this makes only the diff mode read-only.For example, the code below will display the differences but prevent code editing in diff view:
And this code will prevent any code changes in any mode: