diff --git a/baked.md b/baked.md index acaa6fd..257489a 100644 --- a/baked.md +++ b/baked.md @@ -26,7 +26,7 @@ Released under the Creative Commons Attribution 4.0 license, known as CC BY 4.0. -Version captured at 2024-01-17 14:20:55 UTC+1300 +Version captured at 2024-01-18 10:41:42 UTC+1300 # book6: A Collaborative IPv6 Book. book6 logo @@ -5241,9 +5241,9 @@ the file names. So here is the template for the list of sections after inserting links: ``` - ## [First Section](#first-section) - ## [Section Template](#section-template) - ## [Last Section](#last-section) + ## [First Section](First%20Section.md) + ## [Section Template](Section%20Template.md) + ## [Last Section](Last%20Section.md) ``` That's a bit complicated, and since file names are case-sensitive, @@ -5333,7 +5333,7 @@ using the `mdformat` tool. Web references can be done in basic markdown form, i.e.: ``` - [text](#url) to refer to any valid URL + [text](URL) to refer to any valid URL ``` but a feature adapted from kramdown is also available, e.g. diff --git a/utilities/bakeBook.py b/utilities/bakeBook.py index 7a3dcdf..3a1aaab 100644 --- a/utilities/bakeBook.py +++ b/utilities/bakeBook.py @@ -7,7 +7,7 @@ # Version: 2024-01-17 - case error in index citations # - fixed missing special cases for citations # - replace blobs with pilcrows for latex - +# Version: 2024-01-18 - skip code blocks when fixing citations ######################################################## # Copyright (C) 2022-2023 Brian E. Carpenter. @@ -117,10 +117,22 @@ def uncase(l): def fix_section(raw): """Change citations throughout a section""" new = [] + skipping = False for line in raw: #latex doesn't like the blob character if '●' in line: - line=line.replace('●','¶') + line=line.replace('●','¶') + if line.startswith("```") or line.startswith("~~~"): + if skipping: + #already in a code block, back to normal processing + skipping = False + else: + #entering a code block + skipping = True + if skipping: + #skip processing to avoid damaging example citations + new.append(line) + continue if "](" in line: outline = "" while "](" in line: