mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
remove unnecessary heading-anchor
residue from when the heading text itself was a link the id is on the header tag itself, and the link is anchor-link
This commit is contained in:
parent
185769d1b9
commit
47061360da
@ -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 = $('<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(
|
||||
$('<a/>')
|
||||
.addClass('anchor-link')
|
||||
.attr('href', '#' + hash)
|
||||
|
@ -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;
|
||||
|
1
IPython/html/static/style/style.min.css
vendored
1
IPython/html/static/style/style.min.css
vendored
@ -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;}
|
||||
|
Loading…
Reference in New Issue
Block a user