mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat: show heading level when mouse hovered
This commit is contained in:
@@ -684,6 +684,19 @@ export default defineComponent({
|
||||
pre > code {
|
||||
background: var(--g-color-96);
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
&:hover {
|
||||
&::after {
|
||||
content: "\0000a0\0000a0" attr(data-tag);
|
||||
color: var(--g-color-40);
|
||||
font-size: 12px;
|
||||
width: 0;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -181,6 +181,8 @@ const MarkdownItPlugin = (md: Markdown, o: any) => {
|
||||
header.attrSet('title', headTitle)
|
||||
}
|
||||
|
||||
header.attrSet('data-tag', header.tag)
|
||||
|
||||
return slf.renderToken(tokens, idx, opt)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user