Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.31k stars 308 forks source link

Side-by-side preview pane rendering with the incorrect height #583

Open RaceProUK opened 4 months ago

RaceProUK commented 4 months ago

Describe the bug When using a maximum height in units other than pixels, the side-by-side preview pane is rendered incorrectly, typically ending up much shorter than it should be.

To Reproduce Steps to reproduce the behavior:

  1. Set maxHeight to a non-pixel value e.g. 40rem
  2. Enable side-by-side without fullscreen

Expected behavior The preview pane should be the same height as the editor pane.

Version information

Additional context This issue doesn't occur when using fullscreen mode.

The trigger appears to be https://github.com/Ionaru/easy-markdown-editor/blob/master/src/js/easymde.js#L2555, as it's the only place where options.maxHeight is wrapped in parseInt(), causing the unit to be discarded.