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.
This is part of #5865.
On MDN, live samples (the
EmbedLiveSample
macro) are passed an ID that Yari uses to find the code to include in the sample. These IDs typically (almost always, in Markdown-land) refer to headings.In HTML, we can have explicit
id
attributes for headings, that can differ from the ID that would be auto-generated from the heading's text. Live samples can then use these "custom" IDs to refer to the scope where Yari can find the code.In Markdown we can't do that - IDs are always generated from the heading text. So if a live sample in the old HTML system was using a custom ID, this will cause an error when we convert to Markdown.
I've checked through the CSS docs to find pages where this was happening - effectively where a live sample was using an ID that differed from the one that would be generated by Yari's
slugify
function. In this PR I've fixed all the macro calls to use the auto-generated form.To make it easier to check that this is working, I've deleted the explicit
id
attribute in all affected files, so allEmbedLiveSample
calls will need to use an ID that matches the generated one. Note that in some cases here the macro was already using that form, so I just deleted theid
in the heading. In other cases I've correspondingly adjusted the macro argument.