Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/MermaidParserFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public function parse(array $params)
'div',
[
'class' => 'mermaid-dots',
]
],
"Loading Mermaid graphics... (JavaScript required)"
Copy link

Choose a reason for hiding this comment

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

I believe one should at least use <noscript> tags.

Example:

Html::rawElement(
    'div',
    [
        'class' => 'mermaid-dots',
    ],
    Html::element( 'p', [], "Loading Mermaid graphics..." )
        .Html::element( 'noscript', [], "JavaScript is required to display this diagram. Please enable." )
)

(pseudocode, untested)

In general, such messages should use the MediaWiki I18N mechanism, so it can be displayed in the users language.

OT: For better WCAG compliance one could add dedicated attributes to the container <div>, like role="region", aria-busy="true" and aria-live="polite". This would also require some JavaScript that changes aria-busy and maybe adds an aria-label. In addition one should provide the "raw data" in such cases. But all this is clearly out of scope for this particular change.

Copy link
Member

Choose a reason for hiding this comment

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

Thx @osnard for your feedback!

)
);
}
Expand Down