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

Newlines inserted on render don't update when page width changes #487

Closed
EmmaB opened this issue Mar 8, 2023 · 2 comments
Closed

Newlines inserted on render don't update when page width changes #487

EmmaB opened this issue Mar 8, 2023 · 2 comments

Comments

@EmmaB
Copy link

EmmaB commented Mar 8, 2023

On current latest version: v3.20.5

Hello, thanks for the great library. I have an issue with the newlines inserted into the editor, at different page widths (brought about by having two collapsing sidebars). Here is the problem in pictures...

Before persisting to the database:
Screenshot 2023-03-08 at 09 17 14
Screenshot 2023-03-08 at 09 17 09
Screenshot 2023-03-08 at 09 17 02

After persisting:
Screenshot 2023-03-08 at 09 17 38
Screenshot 2023-03-08 at 09 17 33
Screenshot 2023-03-08 at 09 17 28

I've tried reloading the textarea:

          components={{
            textarea: props => {
              return (
                // @ts-ignore
                <textarea {...props} />
              )
            },
          }}

and overriding styles, and setting overflow to hidden, and highlightEnable to false, and anything else mentioned in the issues!

        <MDEditor
...
          prefixCls={"markdown-editor"}
          overflow={false}
          // style={{
          //   overflow: "hidden",
          // }}
          highlightEnable={false}

I suppose the next step is trying to strip out the newlines, but I have no idea how to distinguish between good and bad newlines... so any help would be gratefully appreciated, to avoid the newlines being inserted in the first place. Thanks!

@EmmaB
Copy link
Author

EmmaB commented Mar 8, 2023

I think this is probably something on the server side so closing this issue. If I find out what it is, I'll report back.

@EmmaB EmmaB closed this as completed Mar 8, 2023
@EmmaB
Copy link
Author

EmmaB commented Mar 8, 2023

Update: the issue was nothing to do react-md-editor! I am using the Ruby Kramdown gem to process the data in and out of the database. Turns out it has a default line_width of 72. The issue pictured was due to this, and was nothing to do with the expanding / collapsing sidebars.

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

1 participant