cc – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix tip)
m (Fix example)
Line 78: Line 78:
<pre><code>{{cc|
<pre><code>{{cc|
this
this
code
code<br>
 
is
is
wonderful
wonderful

Revision as of 00:56, 30 November 2020

Displays a code comment.

Usage

  • There is an issue with multiline comments in space-triggered code blocks (see below). Use <code> tags instead for multiline comments.
  • There is also an issue where leaving a blank line would break the code block (even in <code> tags - use <br> instead)

spaced

/*

test1
test2
test3
*/

spaced + line return

/*

test1
test2
test3
*/

code tag /* test1 test2 test3 */

code tag + line return /* test1 test2

test3 */

{{cc|message}}

  • message: comment to display
Examples
Code Result
{{cc}} // -no comment defined-
{{cc|this code is wonderful}} // this code is wonderful
<code>{{cc|this
code
is
wonderful}}</code>
/*

this code is wonderful */

<code>{{cc|
this
code<br>
is
wonderful

}}</code>
/*

this code

is wonderful */

Source

<span style="color: #00F; font-style: italic"><nowiki>//</nowiki>&nbsp;{{Trim|{{{1|-no comment defined-}}}}}</span>

See also