Skip to content

Commit

Permalink
feat: support highlight block
Browse files Browse the repository at this point in the history
  • Loading branch information
DeppWang committed Jun 12, 2024
1 parent 0cc7cb4 commit 6d39e75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/covert.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ def convert_text_func(self, content) -> str:
one_five_contents = content.get("5")
if one_five_contents:
for one_five_content in one_five_contents:
# 3 高亮块
three_content = one_five_content.get("3")
# 包含 6 和 7
two_five_contents = one_five_content.get("5")
# 文本类型
Expand All @@ -236,6 +238,10 @@ def convert_text_func(self, content) -> str:
text = f"[{source_text}]({hf})"
else:
text = ""
# 如果是高亮块
elif three_content and two_five_contents:
source_text = self._get_common_text(one_five_content)
text = "```\r\n{text}\r\n```".format(text=source_text)
else:
text = ""
if text:
Expand Down

0 comments on commit 6d39e75

Please sign in to comment.