Permalink
Browse files

fixes #22, the "regarding" text of a comment now preserves the capita…

…lization and punctuation of the original
  • Loading branch information...
1 parent b7c2b8b commit 0abd2b442e8e22ab9d38ddf06f98b184821af9a1 @bennage committed Mar 30, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 public/javascripts/client.js
  2. +2 −2 views/index.jade
@@ -182,11 +182,11 @@
function get_regarding_text(el) {
- return el.is('.img') ? el.find('img').attr('src') : el.text().toLowerCase().replace(/[^a-z0-9]+/g, '');
+ return el.is('.img') ? el.find('img').attr('src') : el.text();
}
function hash_content(el) {
- var content = get_regarding_text(el);
+ var content = get_regarding_text(el).toLowerCase().replace(/[^a-z0-9]+/g, '');
return md5(content);
}
View
@@ -1,10 +1,10 @@
script#tmpl-comment(type='text/html')
- .comment(data-comment-id='{{hash}}', class='{{#handled}}handled{{/handled}}')
+ .comment(data-comment-id='{{hash}}', class='{{#handled}}handled{{/handled}}', title='{{regarding}}')
.author
img(src='{{author_avatar_url}}', title='{{author_name}}')
span.login(title='{{author_name}}') {{author_name}}
span.timestamp(title='{{when}}') {{timestampFormatted}}
- p.body(title='{{regarding}}') {{body}}
+ p.body {{body}}
- if (user && user.__pundit_role__ === 'admin')
.commands
{{^handled}}

0 comments on commit 0abd2b4

Please sign in to comment.