调试
This commit is contained in:
@@ -1,6 +1,24 @@
|
||||
// 在 src/index.scss 中引入 GitHub Markdown 主题
|
||||
@import "github-markdown-css/github-markdown.css";
|
||||
|
||||
|
||||
// marktext的换行处理
|
||||
.markdown-body p,
|
||||
.markdown-body blockquote,
|
||||
.markdown-body ul,
|
||||
.markdown-body ol,
|
||||
.markdown-body dl,
|
||||
.markdown-body table,
|
||||
.markdown-body pre,
|
||||
.markdown-body details {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.markdown-body li>p {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
|
||||
.book_header_div {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
@@ -34,8 +52,6 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #69b1ff;
|
||||
|
||||
|
||||
}
|
||||
.book_header_right {
|
||||
width: 100px;
|
||||
@@ -45,10 +61,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #69b1ff;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.Book {
|
||||
padding: 40px;
|
||||
@@ -71,13 +84,12 @@
|
||||
|
||||
// background-color: aqua;
|
||||
.at-list__item-container {
|
||||
.at-list__item-content {}
|
||||
.at-list__item-content {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1536px) {
|
||||
|
||||
@@ -70,7 +70,9 @@ const Book = () => {
|
||||
const handleJump = (text) => {
|
||||
const h1Elements = contentRef.current.querySelectorAll("h1");
|
||||
for (let h1 of h1Elements) {
|
||||
if (h1.textContent === text) {
|
||||
if (h1.textContent.trim() === text.trim()) {
|
||||
console.log("Current h1 text:", h1.textContent); // 输出每个 h1 的文本
|
||||
// if (h1.textContent === text) {
|
||||
h1.scrollIntoView({ behavior: "smooth" });
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user