Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix The HTML <Meter> element example #34413 #34429

Merged
merged 10 commits into from
Jul 11, 2024

Conversation

Ashish-CodeJourney
Copy link
Contributor

@Ashish-CodeJourney Ashish-CodeJourney commented Jun 26, 2024

Description

Fix the HTML example for the <meter> element to correctly display the text after the meter.

Motivation

The current example didn't render as intended, potentially confusing readers about the proper usage of the <meter> element. This change provides a more accurate and helpful example.

Additional details

The issue was observed in Google Chrome. The current HTML:

<p>
  Battery level: <meter min="0" max="100" value="75">75%</meter>
</p>

should be changed to:

<p>
  Battery level: <meter min="0" max="100" value="75"></meter> 75%
</p>

This change is consistent with clearer rendering and better aligns with usage expectations.

Related issues and pull requests

Fixes #34413

@Ashish-CodeJourney Ashish-CodeJourney requested a review from a team as a code owner June 26, 2024 14:02
@Ashish-CodeJourney Ashish-CodeJourney requested review from estelle and removed request for a team June 26, 2024 14:02
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed labels Jun 26, 2024
Copy link
Contributor

github-actions bot commented Jun 26, 2024

Preview URLs

(comment last updated: 2024-07-11 05:31:20)

@Josh-Cena
Copy link
Member

This is not what #34413 (comment) said should be done, but I'll let @estelle decide.

@@ -42,7 +42,7 @@ This element includes the [global attributes](/en-US/docs/Web/HTML/Global_attrib

```html
<p>
Heat the oven to <meter min="200" max="500" value="350">350 degrees</meter>.
Heat the oven to <meter min="200" max="500" value="350"></meter> 350 degrees.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original was intended. The text between the opening and closing tag was put in there for browsers that did not support the <meter> element . Now that <meter> is supported everywhere, the text can be removed.

The text should not be put after the element as the meter value may change, and the text has no way of being updated to reflect any change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @Josh-Cena wrote in the issue, a good solution would be to either replace the example with a useful one or to add within the example description that the text is meant as a fallback text for (a) screen readers (b) browsers that don't support meter bars (c) any other cases when the bar doesn't show.

Copy link
Contributor Author

@Ashish-CodeJourney Ashish-CodeJourney Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle @Josh-Cena if you can just review new example, i guess this makes much more sense
and the linter is failing again

Refined examples for the `<meter>` element to offer more practical use cases:
- Updated the simple example to showcase a battery level meter.
- Revised the high and low range example to demonstrate a student's exam score meter.

Included corresponding screenshots for the new examples to enhance clarity and understanding.
@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Jun 27, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Titles and links on MDN are sentence case, per the MDN writing style guidelines.

Also, meter is well supported. Instead of updating the images, which was done for when meter did not have full support, let's use live examples instead.

files/en-us/web/html/element/meter/index.md Outdated Show resolved Hide resolved
files/en-us/web/html/element/meter/index.md Show resolved Hide resolved
Ashish-CodeJourney and others added 2 commits July 8, 2024 10:07
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
the meter element is supported everywhere, so screenshots are no longer needed
@Ashish-CodeJourney
Copy link
Contributor Author

@estelle thanks for cooperation
i am occupied with some urgent work load thats why i was nopt to fix that

@estelle
Copy link
Member

estelle commented Jul 11, 2024

@estelle thanks for cooperation i am occupied with some urgent work load thats why i was nopt to fix that

I hope everything is ok.
if you merge Ashish-CodeJourney#3, it will update this PR and make this one mergeable

@Ashish-CodeJourney
Copy link
Contributor Author

@estelle thanks for cooperation i am occupied with some urgent work load thats why i was nopt to fix that

I hope everything is ok. if you merge Ashish-CodeJourney#3, it will update this PR and make this one mergeable

Done, Thanks :)

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

@estelle estelle merged commit cbbbca4 into mdn:main Jul 11, 2024
8 checks passed
evelinabe pushed a commit to evelinabe/mdn-content that referenced this pull request Jul 12, 2024
* Fix The HTML `<Meter>` element example

* Update `<meter>` element examples for realism and clarity

Refined examples for the `<meter>` element to offer more practical use cases:
- Updated the simple example to showcase a battery level meter.
- Revised the high and low range example to demonstrate a student's exam score meter.

Included corresponding screenshots for the new examples to enhance clarity and understanding.

* Update files/en-us/web/html/element/meter/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/html/element/meter/index.md

Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>

* removing images

the meter element is supported everywhere, so screenshots are no longer needed

* fix lint issue

* delete images

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
@Ashish-CodeJourney Ashish-CodeJourney deleted the feature/34413 branch July 13, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed
3 participants