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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user