diff --git a/src/core/courses/providers/course-link-handler.ts b/src/core/courses/providers/course-link-handler.ts index 1720cb9b6..f346f80c2 100644 --- a/src/core/courses/providers/course-link-handler.ts +++ b/src/core/courses/providers/course-link-handler.ts @@ -58,6 +58,14 @@ export class CoreCoursesCourseLinkHandler extends CoreContentLinksHandlerBase { sectionId: sectionId || null }; + if (!sectionId && !sectionNumber) { + // Check if the URL has a hash to navigate to the section. + const matches = url.match(/#section-(\d+)/); + if (matches && matches[1]) { + sectionNumber = parseInt(matches[1], 10); + } + } + if (!isNaN(sectionNumber)) { pageParams.sectionNumber = sectionNumber; }