gmic icon indicating copy to clipboard operation
gmic copied to clipboard

gmd2html doesn't use standard DOM structure (HTML heading elements)

Open ferdnyc opened this issue 1 year ago • 5 comments

If the following .gmd source is run through gmd2html:

# 1. Section title
## 1.1. Sub-section title
### 1.1.1. Sub-sub-section title
#### 1.1.1.1. Sub-sub-sub-section title

The resulting HTML source will be (wrapped for readability):

<a name="_1_section_title"></a>
<div class="gmd_section">1. Section title</div>
<a name="_1_1_sub_section_title"></a>
<div class="gmd_subsection">1.1. Sub-section title</div>
<a name="_1_1_1_sub_sub_section_title"></a>
<div class="gmd_subsubsection">1.1.1. Sub-sub-section title</div>
<a name="_1_1_1_1_sub_sub_sub_section_title"></a>
<div class="gmd_subsubsubsection">1.1.1.1. Sub-sub-sub-section title</div>

The use of semantic structural elements, including headings to label sections of a document, has accessibility implications and is one of the WCAG Success Criteria for accessible web content. All users, but especially those using assistive technologies, use headings to navigate page content. From the point of view of a screen reader or other assistive device, a styled <div> that looks like a heading is not remotely the same thing as a recognized HTML heading element (<h1> through <h6>).

From the first link above (WebAIM: Semantic Structure):

Implementing Headings

Headings must use heading tags.

Screen readers and assistive technologies rely on heading tags (<h1> - <h6>) to identify headings. Text that is merely large, bold, or emphasized is not interpreted as a heading unless the <h1> - <h6> markup is used.

Use headings only when they represent following content.

To highlight or emphasize text that is not a heading, use styles—not heading tags—to achieve visual results.

ferdnyc avatar Apr 04 '24 13:04 ferdnyc

Hello. This commit should help : https://github.com/GreycLab/gmic/commit/d8e1ae2e1f21a34435073c28b620efd535be8ed4 I'm currently uploading the reference pages with this fix applied.

dtschump avatar May 03 '24 19:05 dtschump

@dtschump Agreed, that looks great. Thanks!

ferdnyc avatar May 03 '24 20:05 ferdnyc

(One suggestion, though — I noticed there's a <div class=\"section_title\"><a href=\"index.html\"><p>Reference</p></a></div> at the top of the pages — it might make sense to make that the <h1> element, and drop the others to <h2>-<h5>.)

ferdnyc avatar May 03 '24 20:05 ferdnyc

https://github.com/GreycLab/gmic/commit/4b738a9e23c6fd72a87c5f6a7307a6f914ff9a69

I won't be able to update reference pages before next monday though.

dtschump avatar May 03 '24 20:05 dtschump

@dtschump

I won't be able to update reference pages before next monday though.

As we like to say at Wikipedia, There is no deadline.

ferdnyc avatar May 03 '24 20:05 ferdnyc

I think this issue has been solved and can be closed.

dtschump avatar Jul 09 '24 12:07 dtschump