fix(tech): preserve h1 elements — do not strip first heading

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 00:02:02 +09:00
parent 1bfad8332c
commit f7d84b4f0f
3 changed files with 6 additions and 9 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import frontmatter
import mwclient
sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent))
from lib.wiki import AUTO_BANNER_PREFIX, connect_wiki, markdown_to_wikitext, strip_first_h1
from lib.wiki import AUTO_BANNER_PREFIX, connect_wiki, markdown_to_wikitext
def validate(fm: dict, path: Path) -> None:
@@ -56,7 +56,7 @@ def publish_one(abs_path: Path, source_dir: Path, post, site: mwclient.Site, sou
fm = post.metadata
title = str(fm["title"])
body_wikitext = markdown_to_wikitext(strip_first_h1(post.content))
body_wikitext = markdown_to_wikitext(post.content)
source_url = f"{gitea_repo_url}/src/commit/{source_ref}/{rel}"
page_content = build_wikitext(fm, body_wikitext, source_url, source_ref)