Переглянути джерело

【修复】文章内标签跳转优化

PJ568 1 рік тому
батько
коміт
38b6b8c139
3 змінених файлів з 4 додано та 5 видалено
  1. 1 1
      Cargo.toml
  2. 3 3
      index.html
  3. 0 1
      index.min.html

+ 1 - 1
Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = "markdown-html"
-version = "1.6.2"
+version = "1.6.3"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

+ 3 - 3
index.html

@@ -1,7 +1,7 @@
 <!doctype html>
 
 <html>
-<markdown-html version="1.6.2" author="PJ568" repo="https://github.com/PJ-568/markdown.html"
+<markdown-html version="1.6.3" author="PJ568" repo="https://github.com/PJ-568/markdown.html"
   license="CC BY-SA 4.0 International"></markdown-html>
 
 <head>
@@ -479,10 +479,10 @@
           darkmode.toggle();
         } else if (event.target.closest('.translate-switch')) {
           translate.changeLanguage(translate.language.getLocal());
-        } else if (event.target.closest('.outline a[href]')) {
+        } else if (event.target.closest('a[href^=#]')) {
           // 目录平滑移动
           const href = event.target.getAttribute('href');
-          if (href !== '#' && href.startsWith('#')) {
+          if (href !== '#') {
             event.preventDefault();
             const targetElement = document.querySelector(href);
             if (targetElement) {

Різницю між файлами не показано, бо вона завелика
+ 0 - 1
index.min.html


Деякі файли не було показано, через те що забагато файлів було змінено