From d46606a48bfc15802b28639c945c5f13ceec2eee Mon Sep 17 00:00:00 2001 From: "Jessica B. Hamrick" Date: Tue, 16 Sep 2014 00:05:14 -0700 Subject: [PATCH] Trim anchor link in heading cells, fixes #6324 --- IPython/html/static/notebook/js/textcell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPython/html/static/notebook/js/textcell.js b/IPython/html/static/notebook/js/textcell.js index ec0b534f9..4264ebf35 100644 --- a/IPython/html/static/notebook/js/textcell.js +++ b/IPython/html/static/notebook/js/textcell.js @@ -418,7 +418,7 @@ define([ html = security.sanitize_html(html); var h = $($.parseHTML(html)); // add id and linkback anchor - var hash = h.text().replace(/ /g, '-'); + var hash = h.text().trim().replace(/ /g, '-'); h.attr('id', hash); h.append( $('')