Item13905: I'd like a way to make FW-level comments in topics.

pencil
Priority: Enhancement
Current State: Waiting for Release
Released In: 2.2.0
Target Release: minor
Applies To: Engine
Component: FoswikiRender
Branches: Item13905 master Item14288 Item14380 Item14537
Reported By: RichMorin
Waiting For:
Last Change By: CrawfordCurrie
AFAICT, Foswiki has no direct support for comments. I can use HTML comments (e.g., <!-- ... -->), but these don't always have the desired semantics. So, I'd like a way to make Foswiki-level comments in topics.

Motivation

When splitting up a topic into two or more pages, I'd like a convenient way to disable variable settings (to see which ones are needed in which of the new pages). I can do this by (say) changing all of the "Set" keywords to "xSet", but this is inconvenient.

Alternatively, I may have text that I want to hide from external users. I could keep this in a separate (local) file, but that seems inconvenient.

Syntax

I don't care much about inline comments, though they might be handy on occasion. Mostly, I want syntax for block-mode comments, eg:

<comment>
... This text will be _completely_ ignored. ...
</comment>

Semantics

The comment text should not be present in the transmitted HTML. So, for example, it should not be accessible via "View Source", etc.

Foswiki syntax within the comment text should not be processed at all. This includes, but is not limited to, variable settings.

-- RichMorin - 27 Dec 2015

Templates already support a comment syntax (viz. %{ ... comment ... }% i.e. a "NULL macro") and it would have been easy to support this in topic content as well. My original proposal to do this was rejected because there may be existing content which contains these strings, which would be banjaxed.

I think this concern should be ignored (or perhaps comment support could be configure-conditional) and would be happy to see this syntax revivified.

See ImproveSupportForComments for the proposal.

-- Main.CrawfordCurrie - 29 Dec 2015 - 09:26

It appears that Crawford's proposed syntax supports both block and inline comments. If so, I would be fine with it. My only (small) concern is that a page could be broken by the presence of unbalanced comment syntax. (So, be careful in using it.)

-- RichMorin - 08 Jan 2016

Marked this task for 2.2, so we don't loose track of it.

-- GeorgeClark - 02 Feb 2017

Waiting for merge from branch Item13905

-- Main.CrawfordCurrie - 20 Feb 2017 - 20:23

Merged to master.

Note that this breaks the CommentPlugin and Register tests, the DisableETOC setting needs to be disabled. .... gawd I hate double negatives.

-- GeorgeClark - 02 May 2017
 
Topic revision: r15 - 31 Jan 2018, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy