Question
If you specify
%COMMENT{type="below" target="#anchorname"}%
and have
#anchorname
in your page, then the comment ("comment text here") is added on the same line, as such
#anchornamecomment text here
I have tweaked my copy of Comment plugin as follows starting at line 275 :-
(basically slotting in a newline before $output in the AFTER section and a newline after the $output in the BEFORE section)
} elsif ( $anchor ) {
# position relative to anchor
if ( $position eq "BEFORE" ) {
$text =~ s/^($anchor)/$output\n$1/m; # put newline after comment to keep anchor left justified
} else { # AFTER
$text =~ s/^($anchor)/$1\n$output/m; # put newline before comments so don't merge with anchor
}
Now, I am not entirely sure that this is completely correct in the case of Windows, Mac, Unix (EOL varies), but it works for me in Linux.
(I gather there would be some global constant which defines what a EOL is somewhere)
Also, on a slightly different tack, I think the 'COMMENT' plugin should translate HTML entity characters, particularly angle brackets, otherwise it becomes very easy to accidentally ruin a pages HTML structure by simply adding a comemnt. Also, users get awfully confused if they actually entered <some text> and it disappears in the comments!
Environment
--
LyallPearce - 11 Dec 2004
Answer
Lyall:
You probably should post this in
CommentPluginDev as this seems to be more related to how
CommentPlugin works and a mod to that code rather than a question on making TWiki work in your environment. Just a suggestion.
--
SteveRJones - 11 Dec 2004
Another way to do what you proposed in the first part of your "question" is to define a custom comment type in UserCommentsTemplate in the TWiki web. You can define the line breaks and spaces before and after the output as you see fit, without changing the plugin itself.
--
MatthewCardozo - 12 Oct 2007