Turning off Convert Breaks Temporarily in an Entry
Question
I need to insert some Javascript (or code samples, or a blockquote) in an entry, but the Convert Breaks Formatting option is causing a problem. I don't want to turn off the Formatting option entirely for the entry; is there a way to avoid the Convert Breaks Formatting from being applied to certain parts of the Entry Body?
Answer
Movable Type temporarily turns off Convert Breaks Formatting when it encounters certains tags in the Entry Body:
- h1, h2, h3, h4, h5, h6
- table
- ol, dl, ul
- menu
- dir
- p
- pre
- center
- form, fieldset, select
- blockquote
- address
- div
- hr
So, try using a tag like <center> or <div> before and after your script code:
<center><script language="JavaScript">
(script code here)
</script></center>
Note that Convert Breaks Formatting will switch back on if a full blank line is encountered, even if it's before the closing "protected" tag, so make sure your script does not contain any empty lines.
When using this method to avoid automatic Convert Breaks Formatting, you'll need to insert your own <p> and <br /> tags within the protected area if desired.


