This has the side-effect that Ikiwiki's default style.css gives the text
box 100% width.
my @buttons = (POST_COMMENT, PREVIEW, CANCEL);
my $form = CGI::FormBuilder->new(
my @buttons = (POST_COMMENT, PREVIEW, CANCEL);
my $form = CGI::FormBuilder->new(
- fields => [qw{do sid page subject body type}],
+ fields => [qw{do sid page subject editcontent type}],
charset => 'utf-8',
method => 'POST',
charset => 'utf-8',
method => 'POST',
- required => [qw{body}],
+ required => [qw{editcontent}],
javascript => 0,
params => $cgi,
action => $config{cgiurl},
javascript => 0,
params => $cgi,
action => $config{cgiurl},
force => 1);
$form->field(name => 'page', type => 'hidden');
$form->field(name => 'subject', type => 'text', size => 72);
force => 1);
$form->field(name => 'page', type => 'hidden');
$form->field(name => 'subject', type => 'text', size => 72);
- $form->field(name => 'body', type => 'textarea', rows => 10);
+ $form->field(name => 'editcontent', type => 'textarea', rows => 10);
$form->field(name => "type", value => $type, force => 1,
type => 'select', options => \@page_types);
$form->field(name => "type", value => $type, force => 1,
type => 'select', options => \@page_types);
my ($authorurl, $author) = linkuser(getcgiuser($session));
my ($authorurl, $author) = linkuser(getcgiuser($session));
- my $body = $form->field('body') || '';
- $body =~ s/\r\n/\n/g;
- $body =~ s/\r/\n/g;
+ my $editcontent = $form->field('editcontent') || '';
+ $editcontent =~ s/\r\n/\n/g;
+ $editcontent =~ s/\r/\n/g;
# FIXME: check that the wiki is locked right now, because
# if it's not, there are mad race conditions!
# FIXME: check that the wiki is locked right now, because
# if it's not, there are mad race conditions!
my $anchor = "${comments_pagename}${i}";
my $anchor = "${comments_pagename}${i}";
+ $editcontent =~ s/"/\\"/g;
my $content = "[[!comment format=$type\n";
# FIXME: handling of double quotes probably wrong?
my $content = "[[!comment format=$type\n";
# FIXME: handling of double quotes probably wrong?
$content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n";
$content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n";
- $content .= " content=\"\"\"\n$body\n\"\"\"]]\n";
+ $content .= " content=\"\"\"\n$editcontent\n\"\"\"]]\n";
# This is essentially a simplified version of editpage:
# - the user does not control the page that's created, only the parent
# This is essentially a simplified version of editpage:
# - the user does not control the page that's created, only the parent
<TMPL_VAR FIELD-SID>
<TMPL_VAR FIELD-PAGE>
Subject: <TMPL_VAR FIELD-SUBJECT><br />
<TMPL_VAR FIELD-SID>
<TMPL_VAR FIELD-PAGE>
Subject: <TMPL_VAR FIELD-SUBJECT><br />
-<TMPL_VAR FIELD-BODY><br />
+<TMPL_VAR FIELD-EDITCONTENT><br />
Page type: <TMPL_VAR FIELD-TYPE><br />
<TMPL_VAR FORM-SUBMIT><br />
<TMPL_VAR HELPONFORMATTINGLINK><br />
Page type: <TMPL_VAR FIELD-TYPE><br />
<TMPL_VAR FORM-SUBMIT><br />
<TMPL_VAR HELPONFORMATTINGLINK><br />