Today's lesson is about the CODE style tag.
Here is a line of code
If you start your post in Normal style and then convert a block of text to Code style will strip out any empty, blank lines. So this:
Here are a couple of lines of code
here is the second line
Becomes this:
Here is a couple of lines of code
see here is the second line
However, if you have a space on the empty line, the blank formatting is kept:
Here is the first line of code
Here is the second line
If you start a code block, and then paste in the code, the blank lines are retained as well, but don't try and re-edit it.
#!/bin/bash if [ -f "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Enabled.plist" ] ; then VERSION=$( defaults read "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Enabled.plist" CFBundleVersion ) else VERSION="Not installed." fi echo "$VERSION"
Adding new lines will break up the code blocks.
#!/bin/bash if [ -f "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Enabled.plist" ] ; then VERSION=$( defaults read "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Enabled.plist" CFBundleVersion ) else VERSION="Not installed." fi
echo "$VERSION"
To avoid breaking the code into separate blocks, select the whole block, change it back to the Normal Style, then edit it. When you have it edited, select the whole block and convert it back to Code.
Notice also that you can have several nested layers of code blocks:
Outer code blockInner code blockOuter codeInner Inner code
Comments