feat: show heading level when mouse hovered

This commit is contained in:
purocean
2022-05-27 21:59:27 +08:00
parent 4cfd1acf0f
commit c7764efff6
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -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;
}
}
}
}
}
+2
View File
@@ -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)
}