question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(Auto)EmbedLiveSample is not working correctly

See original GitHub issue

See also https://github.com/mdn/content/pull/10758.

It seems that if a page has a structure like this:

## A heading

{{EmbedLiveSample}}

### HTML

(the HTML code block)

### JavaScript

(the JS code block)

…then the code blocks aren’t found. But they should be, according to the spec (https://github.com/mdn/content/discussions/5803#discussioncomment-842706), because they are in the same section as the {{EmbedLiveSample}} call. Perhaps the implementation isn’t looking in subsections of the current section?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wbambergcommented, Nov 14, 2022

no page at the moment starts with a live sample in level two ## intro section.

Except for the two that are referenced in https://github.com/mdn/content/pull/10758#issue-1062998747 ?

https://developer.mozilla.org/en-US/docs/web/html/element/input/date#examples https://developer.mozilla.org/en-US/docs/web/html/element/input/month#examples

Still as I said above:

If we do still want to start using it widely, I guess in practice it would be OK to disallow the particular usage that gives rise to this bug (it’s certainly niche) as fixing it looks hard.

1reaction
OnkarRuikarcommented, Nov 14, 2022

The issue exists. Following code

---
title: Authoring MathML
slug: Web/MathML/Authoring
tags:
  - Beginner
  - MathML
  - MathML Project
---

## A heading

{{EmbedLiveSample}}

### HTML

```html
<h1>hi!</h1>
```

### CSS

```css
h1 {
  color:red;
}
```

throws error:

Error: MacroLiveSampleError within .../index.md, line 11 column 19 (unable to find any live code samples for "19" within /en-US/docs/Web/MathML/Authoring)

This is a very low severity issue as no page at the moment starts with a live sample in level two ## intro section.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Markdown] Decide how to represent live samples · Issue #3548
In this system we add the EmbedLiveSample macro to a page. ... The problem is that Markdown doesn't support id attributes or <div>...
Read more >
Where to find help if i need technical assistance for a l10n?
The problem in this case is that the first argument of EmbedLiveSample needs to be the id of the section heading of the...
Read more >
Fix HTML Video Autoplay Not Working - PQINA
You've added a video tag to your website, set the video source, but it won't autoplay. Let's fix it.
Read more >
translated-content/index.md at main
`sentences`: Automatically capitalize the first letter of sentences. ... If the **autocomplete** attribute is not specified on an textarea element, ...
Read more >
-moz-force-broken-image-icon — css | ВебДоки - WebDoky
Не стандартизовано: Це — нестандартний функціонал, і стандартизувати його ніхто не планує. Його не слід використовувати на вебсайтах у відкритому вебі, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found