       ## (This would just be to get its title, so maybe not worth it.)
       msg = Messages.findOne id
       if msg?.title
-        html = """<a title="#{msg.title.replace(/&/g, '&amp;').replace(/"/g, '&quot;')}"" href=#{html[html.length-1]}"""
+        html = """<a title="#{escapeForQuotedHTML msg.title}" href=#{html[html.length-1]}"""
       html + urlFor('message',
         group: msg?.group or wildGroup
         message: id

      format: format
      active: if Template.currentData()?.format == format then 'active' else ''
      capitalized: capitalize format

## Finds all $...$ and $$...$$ blocks, where ... properly deals with balancing
## braces (e.g. $\hbox{$x$}$) and escaped dollar signs (\$ doesn't count as $),


postprocessLinks = (text) ->
  text.replace urlRe, (match, offset, string) ->
    #console.log string, offset, inTag string, offset
    if inTag string, offset
      match
    else
