diff --git a/IPython/html/static/notebook/js/textcell.js b/IPython/html/static/notebook/js/textcell.js
index 7c519f4..c9ed7c3 100644
--- a/IPython/html/static/notebook/js/textcell.js
+++ b/IPython/html/static/notebook/js/textcell.js
@@ -522,17 +522,10 @@ var IPython = (function (IPython) {
text = IPython.mathjaxutils.remove_math(text);
var html = marked.parser(marked.lexer(text));
var h = $(IPython.mathjaxutils.replace_math(html));
- // move the markdown-rendered html down one level,
- // into an anchor tag for linking
- html = h.html();
- var hash = h.text().replace(/ /g, '_');
- h.empty();
- var a = $('')
- .addClass('heading-anchor')
- .html(html)
- .attr('id', hash);
- // and append two anchors (one with the text, one clickable)
- h.append(a).append(
+ // add id and linkback anchor
+ var hash = h.text().replace(/ /g, '-');
+ h.attr('id', hash);
+ h.append(
$('')
.addClass('anchor-link')
.attr('href', '#' + hash)
diff --git a/IPython/html/static/notebook/less/textcell.less b/IPython/html/static/notebook/less/textcell.less
index e104e9c..67382b4 100644
--- a/IPython/html/static/notebook/less/textcell.less
+++ b/IPython/html/static/notebook/less/textcell.less
@@ -19,11 +19,6 @@ div.text_cell_render {
color: @textColor;
}
-a.heading-anchor {
- text-decoration: none;
- color: inherit;
-}
-
a.anchor-link:link {
text-decoration: none;
padding: 0px 20px;
diff --git a/IPython/html/static/style/style.min.css b/IPython/html/static/style/style.min.css
index e2489b0..d69c132 100644
--- a/IPython/html/static/style/style.min.css
+++ b/IPython/html/static/style/style.min.css
@@ -1551,7 +1551,6 @@ span#checkpoint_status,span#autosave_status{font-size:small;}
@media (max-width:767px){span#save_widget{font-size:small;} span#checkpoint_status,span#autosave_status{font-size:x-small;}}@media (max-width:767px){span#checkpoint_status,span#autosave_status{display:none;}}@media (min-width:768px) and (max-width:979px){span#checkpoint_status{display:none;} span#autosave_status{font-size:x-small;}}div.text_cell{padding:5px 5px 5px 5px;}
div.text_cell_input{color:#000000;border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;}
div.text_cell_render{outline:none;resize:none;width:inherit;border-style:none;padding:5px;color:#000000;}
-a.heading-anchor{text-decoration:none;color:inherit;}
a.anchor-link:link{text-decoration:none;padding:0px 20px;visibility:hidden;}
h1:hover .anchor-link,h2:hover .anchor-link,h3:hover .anchor-link,h4:hover .anchor-link,h5:hover .anchor-link,h6:hover .anchor-link{visibility:visible;}
.toolbar{padding:0px 10px;margin-top:-5px;}.toolbar select,.toolbar label{width:auto;height:26px;vertical-align:middle;margin-right:2px;margin-bottom:0px;display:inline;font-size:92%;margin-left:0.3em;margin-right:0.3em;padding:0px;padding-top:3px;}