Nested Comments

Posted by ErichSteinboeck on 21 Mar 2009 11:48, last edited by GoVegan on 09 May 2010 05:55

Tags: code comment nested

rating: +4+x

When editing Wikidot pages it is sometimes convenient to remove parts of a page by commenting it (i. e. surrounding it with Wikidot comment tags [!-- and --]) instead of deleting it.

Commenting a part of a page with Wikidot comments only works as long as the part to be commented does not itself contain comments. Wikidot comments do not support nested comments — the first end comment tag (--]) that's inside the part to be commented would prematurely end the surrounding comment.

Here is a way how to comment a part of page with almost any1 content.

How it Works

Instead of using simple Wikidot comment tags ([!-- and --]) use

as a comment start

[!--
[[code]]

and as a comment end

[[/code]]
--]

Examples

What you type … What you get …
Code before commented section
[!--
[[code]]
A section of ``code'' containing @@tags@@,
//formatting// and a [!-- nested --] comment
[[/code]]
--]
Code after commented section
Code before commented section
Code after commented section

Backlinks

Author

ErichSteinboeckErichSteinboeck. Please visit his/her userPage.


Related articles

Comments

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.