Refactor anchor link handling and enhance scrolling functionality. Update markdown processing to support GitHub-style anchor links and improve user experience with smooth scrolling to headings. Add debugging utilities for anchor links in development.

This commit is contained in:
2025-06-21 22:12:12 +02:00
parent 1cc864e4f0
commit 69e6336d5c
5 changed files with 556 additions and 148 deletions

101
posts/anchor-test.md Normal file
View File

@@ -0,0 +1,101 @@
---
title: Anchor Link Test
date: '2025-01-20'
tags:
- test
- anchors
summary: Testing anchor link functionality
author: Test Author
---
# Anchor Link Test
This is a test page to verify that anchor links work correctly.
## Table of Contents
- [Overview](#overview)
- [Basic Headings](#basic-headings)
- [Special Characters](#special-characters)
- [Numbers and Symbols](#numbers-and-symbols)
- [Long Headings](#long-headings)
- [Nested Sections](#nested-sections)
## Overview
This section tests basic anchor linking functionality.
## Basic Headings
### Simple Heading
This is a simple heading with basic text.
### Another Heading
This is another heading to test multiple anchors.
## Special Characters
### Heading with Special Chars: @#$%^&*()
This heading contains special characters that should be properly slugified.
### Heading with Spaces and Dashes
This heading has spaces and should be converted to dashes.
### Heading_with_Underscores
This heading uses underscores instead of spaces.
## Numbers and Symbols
### Heading with Numbers 123
This heading includes numbers.
### Heading with Symbols !@#$%^&*()
This heading has various symbols.
## Long Headings
### This is a Very Long Heading That Should Still Work Properly Even When It Contains Many Words and Characters
This heading is intentionally long to test slugification with extended text.
## Nested Sections
### Level 3 Heading
This is a level 3 heading.
#### Level 4 Heading
This is a level 4 heading.
##### Level 5 Heading
This is a level 5 heading.
###### Level 6 Heading
This is a level 6 heading.
### Another Level 3
This is another level 3 heading.
## Test Links
You can test the anchor links by clicking on these:
- [Go to Overview](#overview)
- [Go to Basic Headings](#basic-headings)
- [Go to Special Characters](#special-characters)
- [Go to Numbers and Symbols](#numbers-and-symbols)
- [Go to Long Headings](#long-headings)
- [Go to Nested Sections](#nested-sections)
- [Go to Level 3 Heading](#level-3-heading)
- [Go to Level 4 Heading](#level-4-heading)
- [Go to Level 5 Heading](#level-5-heading)
- [Go to Level 6 Heading](#level-6-heading)
## Simple Test
### Test Heading
This is a simple test heading to verify anchor linking works.
- [Go to Test Heading](#test-heading)
## Conclusion
If all the links above work correctly, the anchor linking system is functioning properly!

View File

@@ -11,23 +11,16 @@ author: Rattatwinko's
* [Overview](#overview)
* [Philosophy](#philosophy)
* [Inline HTML](#html)
* [Automatic Escaping for Special Characters](#autoescape)
* [Block Elements](#block)
* [Paragraphs and Line Breaks](#p)
* [Headers](#header)
* [Blockquotes](#blockquote)
* [Lists](#list)
* [Code Blocks](#precode)
* [Horizontal Rules](#hr)
* [Span Elements](#span)
* [Links](#link)
* [Emphasis](#em)
* [Block Elements](#block-elements)
* [Paragraphs and Line Breaks](#paragraphs-and-line-breaks)
* [Headers](#headers)
* [Blockquotes](#blockquotes)
* [Lists](#lists)
* [Code Blocks](#code-blocks)
* [Span Elements](#span-elements)
* [Links](#links)
* [Emphasis](#emphasis)
* [Code](#code)
* [Images](#img)
* [Miscellaneous](#misc)
* [Backslash Escapes](#backslash)
* [Automatic Links](#autolink)
**Note:** This document is itself written using Markdown; you