diff --git a/assets/javascripts/views/content/content.js b/assets/javascripts/views/content/content.js index 3e5ddaf20b..e654d33ee3 100644 --- a/assets/javascripts/views/content/content.js +++ b/assets/javascripts/views/content/content.js @@ -150,8 +150,12 @@ app.views.Content = class Content extends app.View { beforeRoute(context) { this.cacheScrollPosition(); - // If scroll position wasn't cached from an earlier visit, scroll to top. - if (!this.scrollMap[context.state.id]) { + /* + * If scroll position wasn't cached from an earlier visit: + * - let the anchor (if there is one) set position, or + * - scroll to top. + */ + if (!this.scrollMap[context.state.id] && !context.hash) { this.scrollToTop(); } diff --git a/lib/docs/filters/nim/clean_html.rb b/lib/docs/filters/nim/clean_html.rb index 89b638fe6d..66dfe270d7 100644 --- a/lib/docs/filters/nim/clean_html.rb +++ b/lib/docs/filters/nim/clean_html.rb @@ -58,6 +58,11 @@ def call css('a', 'dl', 'table', 'code').remove_attr('class') css('table').remove_attr('border') + # Remove Source/Edit links. + css('dd > a').each do |node| + node.remove if node.inner_html == 'Source' || node.inner_html == 'Edit' + end + doc end end