Closed Bug 1484594 Opened 6 years ago Closed 6 years ago

The id attribute is overwritten automatically with its textContent when it is specified as EmbedLiveSample's parameter.

Categories

(developer.mozilla.org Graveyard :: Localization, enhancement)

All
Other
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: toumin.m7, Unassigned)

Details

(Whiteboard: [specification][type:bug])

What did you do?
================
I changed the textContent of the element that is specified as EmbedLiveSample's parameter.

e.g.
Before (English): <h2 id="Examples">Examples</h2>
After (Japanese): <h2 id="Examples">例</h2>

What happened?
==============
When I published, the id attribute was overwritten automatically with its textContent.

e.g.
Before publish: <h2 id="Examples">例</h2>
After publish: <h2 id="例">例</h2>

So I had to change EmbedLiveSample's parameter.

e.g.
Before: {{EmbedLiveSample("Examples")}}
After: {{EmbedLiveSample("例")}}

What should have happened?
==========================
It should not be overwritten.

Is there anything else we should know?
======================================
Hey toumim, thanks for reporting. Yeah, the behaviour works as designed for article edits, but has this unfortunate side effect for live samples. Since live samples are not the future of MDN, it's unlikely that we'll ever get around to fix this.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
(In reply to Kadir Topal [:atopal] from comment #1)

I got it.
Next when I localize, I will equalize id attribute, its textContent and EmbedLiveSample's parameter in advance.
Thank you.
(In reply to Kadir Topal [:atopal] from comment #1)
> Since live samples are not the future of MDN, it's unlikely that we'll ever get
> around to fix this.

I guess you mean "interactive examples" are the future of MDN, not live examples.

If we'll use only interactive example for new sample code, it's reasonable to make request for live examples wontfix. But follwoing documents say that we'll continue to use live examples for some (many?) cases:


https://developer.mozilla.org/en-US/docs/MDN/Contribute/Structures/Code_examples
> The new interactive examples are great as readers can modify values on the fly
> — this is very valuable for learning. However, they are more complex to set up
> than the other forms, with more limitations, and are intended for specific purposes.

As Toumin said, we'll share (add FAQ to our MDN how-to docs) about current limitation of live examples to Japanese localization members. But if MDN continue to use live examples as written in the Code_examples page, I think this bug should be kept as OPEN (otherwise, need update the Code_examples page).
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.