Explorar o código

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

PJ568 hai 1 ano
pai
achega
38b6b8c139
Modificáronse 3 ficheiros con 4 adicións e 5 borrados
  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]
 [package]
 name = "markdown-html"
 name = "markdown-html"
-version = "1.6.2"
+version = "1.6.3"
 edition = "2021"
 edition = "2021"
 
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 # 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>
 <!doctype html>
 
 
 <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>
   license="CC BY-SA 4.0 International"></markdown-html>
 
 
 <head>
 <head>
@@ -479,10 +479,10 @@
           darkmode.toggle();
           darkmode.toggle();
         } else if (event.target.closest('.translate-switch')) {
         } else if (event.target.closest('.translate-switch')) {
           translate.changeLanguage(translate.language.getLocal());
           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');
           const href = event.target.getAttribute('href');
-          if (href !== '#' && href.startsWith('#')) {
+          if (href !== '#') {
             event.preventDefault();
             event.preventDefault();
             const targetElement = document.querySelector(href);
             const targetElement = document.querySelector(href);
             if (targetElement) {
             if (targetElement) {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1
index.min.html


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio