[FR] Fix literal <i> and <code> tags showing up in French headings - #1294
Open
IROFI wants to merge 11 commits into
Open
[FR] Fix literal <i> and <code> tags showing up in French headings#1294IROFI wants to merge 11 commits into
IROFI wants to merge 11 commits into
Conversation
doc-builder flattens heading text to plain text: inline HTML is escaped, so `<i>transformers</i>` was displayed verbatim on the website and leaked "i" into the generated heading anchors. Italics are not available in headings at all (markdown emphasis is dropped there as well, and it even leaves a stray space around the emphasised words), so the tags are removed and only the words are kept. `<i>` in body text, blockquotes and quiz answers renders correctly and is left untouched.
Same as the previous commit: heading text is rendered as plain text, so the `<i>` tags were shown verbatim.
Same as the previous commits: heading text is rendered as plain text, so the `<i>` tags were shown verbatim.
Same as the previous commits: heading text is rendered as plain text, so the `<i>` tags were shown verbatim.
Same as the previous commits: heading text is rendered as plain text, so the `<i>` tags were shown verbatim.
Same as the previous commits: heading text is rendered as plain text, so the `<i>` tags were shown verbatim. This is the most affected chapter: 7 of the 10 questions of the end-of-chapter quiz displayed the raw tags in their title.
Same as the previous commits: heading text is rendered as plain text, so the `<i>` tags were shown verbatim.
Same as the previous commits: heading text is rendered as plain text, so the `<i>` tags were shown verbatim.
Same as the previous commits: heading text is rendered as plain text, so the `<i>` tags were shown verbatim.
Last occurrence: same rendering issue on the "Live sessions and workshops" page.
Same root cause as the <i> tags: doc-builder flattens heading text to plain text, so `<code>train_new_from_iterator()</code>` was displayed verbatim in the quiz question titles. The English source uses backticks in these exact four headings, and 34 other French headings already do, so this restores both parity and consistency.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Author
|
@lewtun @stevhliu for review, and @lbourdois as the maintainer of the French translation — a native-speaker check on the affected headings would be welcome. Only headings are touched (114 of them): Note: the preview link above currently returns a 404 for me, so the rendering evidence in the description comes from a local |
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.
Problem
On the French pages, inline HTML shows up verbatim in headings. For example, chapter 6's end-of-chapter quiz displays
7 of that quiz's 10 question titles were affected. The tags also leak into the generated anchors:
#4-comment-le-pipeline-token-classification-gère-t-il-les-entités-qui-sétendent-sur-plusieurs-i-tokens-i-.Cause
doc-builderflattens heading text to plain text (it needs it for the sidebar, the table of contents and the anchors). Inline HTML is escaped there, so<i>and<code>are rendered as literal text.Italics are simply not available in headings: markdown emphasis is dropped too, and it leaves a stray space next to punctuation — still visible today on headings this PR does not touch, e.g.
instruction ( prompt ) ?infr/chapter1/10.Fix
<i>x</i>→xin headings: the words are kept and the tags dropped, since no emphasis can render there anyway.<code>x</code>→`x`in headings: the English source uses backticks in these exact 4 headings, and 34 other French headings already do.<i>in body text, tip boxes and quiz answers renders correctly and is left untouched (251 occurrences).114 headings across 50 files. No wording changed, no line added or removed.
Verification
Built
chapters/frlocally withdoc-builder build --htmland compared againstmain:<i>italics in the built HTMLmake qualityreports the same result asmain(pre-existing failures, from a newerblackthan the one pinned in CI).