vitepress-theme-element-plus 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,18 +40,25 @@ export function getHeaders(range: DefaultTheme.Config['outline']): MenuItem[] {
40
40
  return resolveHeaders(headers, range)
41
41
  }
42
42
 
43
- function serializeHeader(h: Element): { text: string, tags: string[] } {
44
- let text = ''
45
- const tags: string[] = []
46
- for (const node of Array.from(h.childNodes)) {
47
- if (node.nodeType === 1) {
48
- const element = node as HTMLElement
43
+ function serializeHeader(h: Element): { text: string, tags: string[] } {
44
+ let text = ''
45
+ const tags: string[] = []
46
+ for (const node of Array.from(h.childNodes)) {
47
+ if (node.nodeType === 1) {
48
+ const element = node as HTMLElement
49
49
  if (ignoreRE.test(element.className))
50
50
  continue
51
- if (element.classList.contains('el-tag') || element.classList.contains('vp-tag')) {
52
- tags.push(element.outerHTML)
53
- continue
54
- }
51
+ if (element.classList.contains('el-tag') || element.classList.contains('vp-tag')) {
52
+ const cloned = element.cloneNode(true) as HTMLElement
53
+ const transitionClassRE = /(?:^|-)enter-(?:active|from|to)$|(?:^|-)leave-(?:active|from|to)$/
54
+ for (const cls of Array.from(cloned.classList)) {
55
+ if (transitionClassRE.test(cls) || cls.startsWith('el-zoom-in-center-')) {
56
+ cloned.classList.remove(cls)
57
+ }
58
+ }
59
+ tags.push(cloned.outerHTML)
60
+ continue
61
+ }
55
62
  text += element.textContent ?? ''
56
63
  }
57
64
  else if (node.nodeType === 3) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitepress-theme-element-plus",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "description": "A VitePress theme for Element Plus",
6
6
  "author": "Hezhengxu",
7
7
  "license": "MIT",