From ca878abb17008a3b4a1da5d9c24a5f29c24e1313 Mon Sep 17 00:00:00 2001 From: moozzi Date: Sat, 16 May 2026 19:05:35 +0200 Subject: [PATCH] Fix help page navigation --- app/controllers/help_controller.rb | 2 +- app/javascript/controllers/help_outline_controller.js | 2 +- app/views/help/pages/search.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 19ff916..ea9be0a 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -39,7 +39,7 @@ def extract_outline(text) if line =~ /^(\#{2,3})\s+(.+)$/ level = $1.length title = $2.strip - id = title.downcase.gsub(/[^a-z0-9\s-]/, " ").gsub(/\s+/, "-") + id = title.downcase.gsub(/'/, "").gsub(/[^\w\s-]/, "-").gsub(/[\s-]+/, "-").gsub(/^-|-$/, "") headings << { level: level, title: title, id: id } end end diff --git a/app/javascript/controllers/help_outline_controller.js b/app/javascript/controllers/help_outline_controller.js index 1558214..15f589c 100644 --- a/app/javascript/controllers/help_outline_controller.js +++ b/app/javascript/controllers/help_outline_controller.js @@ -7,7 +7,7 @@ export default class extends Controller { this.observer = new IntersectionObserver( this.onIntersect.bind(this), { - rootMargin: "0px 0px -80% 0px", + rootMargin: "0px 0px -90% 0px", threshold: 0 } ) diff --git a/app/views/help/pages/search.md b/app/views/help/pages/search.md index 7ddd417..d00b663 100644 --- a/app/views/help/pages/search.md +++ b/app/views/help/pages/search.md @@ -327,7 +327,7 @@ from:committer[last_before:1m] -has:contributor # Inactive committers (from:alvaro[body:patch] OR has:patch[from:alvaro]) first_after:1m ``` -### Negation +### Selectors negation You can negate selectors with dependent conditions: