Skip to content

Commit e324d5e

Browse files
committed
fix: update tags plugin
1 parent e07ea1b commit e324d5e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/lcp/68.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
comments: true
3+
difficulty: 中等
4+
edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2068.%20%E7%BE%8E%E8%A7%82%E7%9A%84%E8%8A%B1%E6%9D%9F/README.md
5+
tags:
6+
- 数组
7+
- 滑动窗口
8+
---
9+
110
# [LCP 68. 美观的花束](https://leetcode.cn/problems/1GxJYY)
211

312
## 题目描述

hooks/tags.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import re
2+
13
from bs4 import BeautifulSoup
24

35

@@ -15,7 +17,7 @@ def on_page_content(html, page, config, files):
1517
ul_tags = soup.find_all("ul")
1618
for ul_tag in ul_tags:
1719
li_tags = ul_tag.find_all("li")
18-
li_tags.sort(key=lambda x: int(x.text.split(".")[0].strip()))
20+
li_tags.sort(key=lambda x: int(re.search(r"\d+", x.text).group()))
1921
ul_tag.clear()
2022
for li_tag in li_tags:
2123
ul_tag.append(li_tag)

0 commit comments

Comments
 (0)