         #        cm   : cm
         #    return false
 
-        output.find(".sagews-output-messages").click () =>
+        output.find(".sagews-output-messages").click (e) =>
+            t = $(e.target)
+            if t.attr('href')?
+                return
             @edit_cell
                 line : mark.find().from.line - 1
                 cm   : cm

            j = input.indexOf(")")
            if j < i and j != -1
                i = j
            html_input = to_html(input.slice(i+1).trim())
            top_input = input.slice(0,i+1)
            div.addClass("sagews-output-html")
            div.html(html_input)
            last_html = html_input
            ignore_changes = false


        else if input.slice(0,3) == '%md'
            # a markdown editor
            editor = 'md'
            to_html   = (code) -> misc_page.markdown_to_html(code).s.trim()
            from_html = to_markdown
        else
            editor = undefined
