--- a/Allura/allura/templates/repo/file.html
+++ b/Allura/allura/templates/repo/file.html
@@ -21,10 +21,15 @@
 {% block extra_js %}
 {{ super() }}
 <script type="text/javascript">(function() {
-  var hash = window.location.hash.substring(1);
-  if (hash != '' && hash.substring(0, 1) == 'l' && !isNaN(hash.substring(1))) {
-    $('#' + hash).css('background-color', '#ffff99');
-  }
+  $(window).bind('hashchange', function(e) {
+    var hash = window.location.hash.substring(1);
+	if ('originalEvent' in e && 'oldURL' in e.originalEvent) {
+      $('#' + e.originalEvent.oldURL.split('#')[1]).css('background-color', 'transparent');
+	}
+    if (hash != '' && hash.substring(0, 1) == 'l' && !isNaN(hash.substring(1))) {
+      $('#' + hash).css('background-color', '#ffff99');
+    }
+  }).trigger('hashchange');
 
   $('.code_block').each(function(index, element) {
     $(element).bind('click', function() {
@@ -69,7 +74,7 @@
     <div class="clip grid-19">
       <h3><span class="ico-l"><b data-icon="{{g.icons['table'].char}}" class="ico {{g.icons['table'].css}}"></b> {{h.really_unicode(blob.name)}}</span></h3>
       {% if blob.has_pypeline_view %}
-        {{h.render_any_markup(blob.name, blob.text, True)}}
+        {{h.render_any_markup(blob.name, blob.text, code_mode=True)}}
       {% else %}
         {{g.highlight(blob.text, filename=blob.name)}}
       {% endif %}