Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical Scroll #131

Closed
hungdev opened this issue Aug 23, 2019 · 4 comments
Closed

Vertical Scroll #131

hungdev opened this issue Aug 23, 2019 · 4 comments

Comments

@hungdev
Copy link

hungdev commented Aug 23, 2019

@neighborhood999 thank for your lib. your library is nice.
but i dont know how to break line if the line is too long. I dont want to use horizontal scroll.

my code:

const oldCode = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.';


const newCode = 'Lorem Ipsumis simply dummytext of he printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, ut also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, cand more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.';

<ReactGhLikeDiff
            options={{
              inputFormat: 'diff',
              outputFormat: 'side-by-side',
            }}
            past={oldCode}
            current={newCode}
          />

thank you.

@neighborhood999
Copy link
Owner

I think you can write some custom CSS to break the line because this library does not focus on this problem.

@hungdev
Copy link
Author

hungdev commented Aug 24, 2019

@neighborhood999 but i dont see the className or style props to inject css in your guide

@neighborhood999
Copy link
Owner

@hungdev you may reference diff2html CSS class name and write it.

I import diff2html CSS directly:
https://github.com/neighborhood999/react-gh-like-diff/blob/master/src/index.js#L12

This issue discusses may help you: rtfpessoa/diff2html#99

@hungdev
Copy link
Author

hungdev commented Aug 24, 2019

@neighborhood999 thank you, i will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants