Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Commit

Permalink
trim comments
Browse files Browse the repository at this point in the history
  • Loading branch information
theopolisme committed Nov 8, 2013
1 parent 4e39dd3 commit 4217c2d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/submissions.js
Expand Up @@ -1613,10 +1613,11 @@ function afcHelper_page_creator(title) {
} }


function afcHelper_addcomment(comment) { function afcHelper_addcomment(comment) {
if (comment == "") var trimmed_comment = $.trim(comment);
return ""; if (trimmed_comment !== "")
return "\{\{afc comment|1=" + trimmed_comment + " \~\~\~\~\}\}";
else else
return "\{\{afc comment|1=" + comment + " \~\~\~\~\}\}"; return "";
} }


function afcHelper_underreview() { function afcHelper_underreview() {
Expand Down

2 comments on commit 4217c2d

@wikipedia-mabdul
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't that be done in ffu.js, too?

https://github.com/WPAFC/afch/blob/develop/src/ffu.js#L367

} else if (sub_m.action == 'comment') {
       if ((sub_m.prefmtcomment != '') && (sub_m.prefmtcomment != 'custom')) {
              if (sub_m.comment == '') text += '\n:\{\{subst:ffu|' + sub_m.prefmtcomment + '\}\} \~\~\~\~\n';
              else text += '\n:\{\{subst:ffu|' + sub_m.prefmtcomment + '\}\} ' + sub_m.comment + ' \~\~\~\~\n';
} else if (sub_m.comment != '') {
       text += '\n:\{\{subst:ffu|c\}\} ' + sub_m.comment + ' \~\~\~\~\n';

@theopolisme
Copy link
Contributor Author

@theopolisme theopolisme commented on 4217c2d Nov 10, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.