Answers.Body: <p>The <a href="https://github.com/craftcms/redactor#redactor-configs" rel="nofollow noreferrer">redactor configs</a> are stored inside the <code>config/redactor</code> directory.</p>
  <p>Make sure you're editing the right config that your field uses (eg Standard) and add:</p>
  <pre><code>  &quot;minHeight&quot;:&quot;500px&quot;,
  </code></pre>
  <p>... to that file. The configs use JSON so when you see a Redactor configuration, that's how Craft is going to initialize it.</p>
  <p>To answer your other question, Redactor is not really designed as a code editor—it's really for end users editing text in a WYSIWYG fashion.</p>
  <p>I was able to get Redactor to keep line breaks in tact and keep comments using something like:</p>
  <pre><code>  &quot;cleanOnEnter&quot;: false,
    &quot;removeComments&quot;: false
  </code></pre>
  <p>You might also want to turn off HTML purifier (or modify its own config).</p>
  <p>FWIW it's probably much easier to use a dedicated field type for editing code, such as the <a href="https://plugins.craftcms.com/code-mirror" rel="nofollow noreferrer">CodeMirror</a> plugin.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-30T01:22:54.013Z
Answers.Text: The min-height worked, thank you. I have the HTML purifier off but it still removed line breaks after adding those other two lines. That's okay though, I'm going to check out the CodeMirror plugin.  Thanks!
Answers.UserDisplayName: Jake1293
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-29T18:26:58.637Z
Answers.LastActivityDate: 2020-06-29T18:26:58.637Z
Answers.UserDisplayName: RitterKnight
Body: <p>I'm looking to set a min height on the redactor text area.  The <a href="https://imperavi.com/redactor/docs/settings/height-and-width/" rel="nofollow noreferrer">vendor site</a> shows how it can be done, but doesn't specify where to add this code snippet.</p>
  <pre><code>$R('#content', {
    minHeight: '500px'
  });
  </code></pre>
  <p>I added that to the redactor.js file in the vendor/craftcms/redactor/lib/redactor folder, but it didn't work. Can someone point me in the right direction? I'm trying to avoid installing additional plugins like Control Panel CSS just to do that one thing.</p>
  <p>Additionally, is there a way to preserve line breaks in the text area? I work only in the code view mode and after every save, line breaks disappear. I did a search and found some pages on Github that talk about the issue, but I couldn't find a resolution.</p>
  
Tags: <redactor><css>
Title: Redactor: Set a min height and preserve line breaks
ThreadText: # Redactor: Set a min height and preserve line breaks
  
  (Asked by: username_0 on 2020-06-28)
  
  I'm looking to set a min height on the redactor text area. The [vendor site](https://imperavi.com/redactor/docs/settings/height-and-width/) shows how it can be done, but doesn't specify where to add this code snippet.
  
  ```
  $R('#content', {
    minHeight: '500px'
  });
  
  ```
  
  I added that to the redactor.js file in the vendor/craftcms/redactor/lib/redactor folder, but it didn't work. Can someone point me in the right direction? I'm trying to avoid installing additional plugins like Control Panel CSS just to do that one thing.
  
  Additionally, is there a way to preserve line breaks in the text area? I work only in the code view mode and after every save, line breaks disappear. I did a search and found some pages on Github that talk about the issue, but I couldn't find a resolution.
  
  **Tags:** redactor, css
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-29. Score: 3 | Accepted answer
  
  The [redactor configs](https://github.com/craftcms/redactor#redactor-configs) are stored inside the `config/redactor` directory.
  
  Make sure you're editing the right config that your field uses (eg Standard) and add:
  
  ```
    "minHeight":"500px",
  
  ```
  
  ... to that file. The configs use JSON so when you see a Redactor configuration, that's how Craft is going to initialize it.
  
  To answer your other question, Redactor is not really designed as a code editor—it's really for end users editing text in a WYSIWYG fashion.
  
  I was able to get Redactor to keep line breaks in tact and keep comments using something like:
  
  ```
    "cleanOnEnter": false,
    "removeComments": false
  
  ```
  
  You might also want to turn off HTML purifier (or modify its own config).
  
  FWIW it's probably much easier to use a dedicated field type for editing code, such as the [CodeMirror](https://plugins.craftcms.com/code-mirror) plugin.
  
  > **Comments:**
  > **username_0**: The min-height worked, thank you. I have the HTML purifier off but it still removed line breaks after adding those other two lines. That's okay though, I'm going to check out the CodeMirror plugin.  Thanks!  
  
  ---
  
  