 
     Relationship.one selector, (err, rel) =>
       if err
-          console.error err 
+          console.error err
           callback null, err
-      sel = 
+      sel =
       {
         "_id" : rel.data.targetId
       }
       JAccount.one sel, (err, acc) =>
         if err
-          console.error err 
+          console.error err
           callback null, err
-        fullName = acc.data.profile.firstName + " " 
+        fullName = acc.data.profile.firstName + " "
         fullName += acc.data.profile.lastName
         activityContent = {
           fullName : fullName
           hash : acc.data.profile.hash
           title : if model.title then model.title else model.body or ""
           body : if model.body  then model.body  else ""
-          codeSnippet : codeSnippet
+          codeSnippet : htmlEncode codeSnippet
           createdAt : formatDate(model.data?.meta?.createdAt)
           numberOfComments : comments?.length or 0
           numberOfLikes : model?.data?.meta?.likes or 0

decorateComment = (JAccount, comment, callback) ->
  createdAt = formatDate(new Date(comment.timestamp_))
  commentSummary = {body: comment.data.body, createdAt: createdAt}
  selector = 
  {
    "targetId" : comment.getId(),
    "sourceName": "JAccount"
  }
  Relationship.one selector, (err, rel) =>
    if err
      console.error err 
      callback null, err
    sel = { "_id" : rel.data.sourceId}

    JAccount.one sel, (err, acc) =>
      if err
        console.error err 
        callback null, err
      commentSummary.authorName = acc.data.profile.firstName + " " 
      commentSummary.authorName += acc.data.profile.lastName
      callback commentSummary, null

createActivityContent = (JAccount, models, comments, section, callback) ->
  model = models.first if models and Array.isArray models
  unless model 
    callback null, "JStatusUpdate cannot be found."
  statusUpdateId = model.getId()
  jAccountId = model.data.originId
  selector = 
  {
    "sourceId" : statusUpdateId,
    "as" : "author"
  }
  
  model.fetchTeaser (error, teaser)=>
    tags = []
    if teaser?.tags?

  minute = forceTwoDigits date.getMinutes()

  # What about i18n? Does GoogleBot crawl in different languages?
  months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
  monthName = months[month]
  return "#{monthName} #{day}, #{year} #{hour}:#{minute}"
