mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
check_links - use devportal config dirs, handle HEAD 404 better; parse_pages - sub links in template HTML too
(cherry picked from commit 2f3c18246c3d590e85ab2af7991ce9b470340400)
This commit is contained in:
@@ -184,7 +184,7 @@ def parse_markdown(md, target=None, pages=None):
|
||||
#buttonize links ending in >
|
||||
buttonize_try_it(soup)
|
||||
|
||||
# Replace links for live site
|
||||
# Replace links for any non-default target
|
||||
if target["name"] != config["targets"][0]["name"]:
|
||||
substitute_links_for_target(soup, target)
|
||||
|
||||
@@ -375,6 +375,12 @@ def render_pages(target=None, for_pdf=False, bypass_errors=False):
|
||||
pages=pages,
|
||||
content=html_content)
|
||||
|
||||
# Experimental: replace links in full HTML, not just content
|
||||
soup = BeautifulSoup(out_html, "html.parser")
|
||||
if target["name"] != config["targets"][0]["name"]:
|
||||
substitute_links_for_target(soup, target)
|
||||
out_html = str(soup)
|
||||
|
||||
if for_pdf:
|
||||
out_path = config["temporary_files_path"]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user