Repository navigation
Docu: cleanUpMarkdown.sh turned closing code fences into opening ones - #370
Open
tombouctou wants to merge 1 commit into
Open
tombouctou wants to merge 1 commit into
tombouctou wants to merge 1 commit into
Conversation
…ning ones
The rule that labels code cells as Mathematica,
sed -z 's|\n\n```\n|\n\n```mathematica\n|g'
also matched a closing fence that follows an empty line (a cell ending in
a blank line), so the cell was closed by "```mathematica" - which opens a
new block instead. pandoc then renders the cell as a paragraph of raw text
("```mathematica FCCompareResults[...]", e.g. at the bottom of
QED/TwoLoops/Renormalization-LeAle on the website) or swallows the output
after it into the code block (TID, UnDeclareNonCommutative).
The rule is replaced by an awk pass that tracks whether it is inside a cell
and labels only opening fences (still only after an empty line, as before),
and the 56 Markdown files already affected (14 in Documentation/Markdown,
42 examples) get their closing fence back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation/Scripts/cleanUpMarkdown.shlabels code cells as Mathematica withThe pattern is meant for opening fences, but it also matches a closing fence that follows an empty line, i.e. a cell whose last line is blank. Such a cell is then "closed" by ````mathematica`, which opens a new block instead. pandoc renders the cell as a paragraph of raw text (see the bottom of QED/TwoLoops/Renormalization-LeAle: "```mathematica FCCompareResults[leptonSE$RenConstants2L, …"), or, in TID and UnDeclareNonCommutative, pulls the output that follows into the code block.
Changes
cleanUpMarkdown.sh: thesed -zrule is replaced by an awk pass that tracks whether it is inside a cell and labels only opening fences. As before, it does so only for a bare ````` after an empty line. Closing fences are left alone.Verification
generateHTML.sh's pandoc command (template + md2html.lua) gives a proper code block where the website currently shows raw text.The same fix for
hotfix-stable(54 files there) is a separate PR, so the stable manual can be regenerated too.The website side, where the already generated HTML of 76 pages is fixed, is FeynCalc/feyncalc.github.io#28.
🤖 Generated with Claude Code