浏览代码

Merge pull request #720 from Scheirle/pcs_fix_719

[pelican_comment_system] Fix mailto link: use '\r\n' instead of '\n'
Justin Mayer 8 年之前
父节点
当前提交
3b8055cbae
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      pelican_comment_system/theme/static/js/comments.js

+ 2 - 2
pelican_comment_system/theme/static/js/comments.js

@@ -35,7 +35,7 @@ var CommentSystem = {
 			return (norm < 10 ? '0' : '') + norm;
 		};
 		var body = ''
-		+ 'Hey,\nI posted a new comment on ' + document.URL + '\n\nGreetings ' + $("#pcs-comment-form-input-name").val() + '\n\n\n'
+			+ 'Hey,\nI posted a new comment on ' + document.URL + '\n\nGreetings ' + $("#pcs-comment-form-input-name").val() + '\n\n\n'
 			+ 'Raw comment data:\n'
 			+ '----------------------------------------\n'
 			+ 'email: \n' // just that I don't forget to write it down
@@ -69,7 +69,7 @@ var CommentSystem = {
 		var link = 'mailto:' + this.email_user + '@' + this.email_domain + '?subject='
 			+ encodeURIComponent(subject)
 			+ "&body="
-			+ encodeURIComponent(body);
+			+ encodeURIComponent(body.replace(/\r?\n/g, "\r\n"));
 		console.log(link)
 		return link;
 	}