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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ER and Sequence Chart Accessibility #2832

Merged
merged 2 commits into from Mar 31, 2022
Merged

ER and Sequence Chart Accessibility #2832

merged 2 commits into from Mar 31, 2022

Conversation

gwincr11
Copy link
Contributor

馃搼 Summary

This adds titles to ER documents and Sequence documents. There is a weird thing with the sequenceDiagram.spec.js where the element passed in as the diagram seems to be a stub? So I just ensure that the element passed to the accessibility function will respond to insert.

馃搹 Design Decisions

Following the already set pattern for adding accessibility to charts, setup in #2732

馃搵 Tasks

Make sure you

  • 馃摉 have read the contribution guidelines
  • 馃捇 have added unit/e2e tests (if appropriate)
  • 馃敄 targeted develop branch

@gwincr11 gwincr11 mentioned this pull request Mar 17, 2022
9 tasks
@knsv
Copy link
Collaborator

knsv commented Mar 24, 2022

Good stuff!

We really appreciate efforts towards accessibility and want to merge this ... but... there were a couple of things that needs to be adjusted for us to be able to go forward.

The first one is that we need to sanitise the data coming in for the titles to be sure there are no harmfull data in there. You can look at usage of the sanitizeText function in sequenceDb.

The second issue is that the syntax for the title in sequence diagrams are updated. I agree that it is more consistent without the ":" but we have existing diagrams out there, using the old syntax. These diagrams would break from this PR and annoying as it is we take backwards compatibility in diagrams seriously.

This what I am referring to:
image

and this

image

So if you can fix those things I will be happy to proceed.

@@ -56,7 +56,9 @@
"note" return 'note';
"activate" { this.begin('ID'); return 'activate'; }
"deactivate" { this.begin('ID'); return 'deactivate'; }
"title" return 'title';
"title"\s[^#\n;]+ return 'title';
"title:"\s[^#\n;]+ return 'legacy_title';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@knsv I added support for the new and the old style title. I think that it would be good to have a consistent dsl. Is this approach ok?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That is perfect, thanks!

@@ -122,9 +122,6 @@ export const getActorKeys = function () {
export const getTitle = function () {
return title;
};
export const getTitleWrapped = function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think we need this title wrapped logic any more?

@knsv knsv merged commit 4487754 into mermaid-js:develop Mar 31, 2022
@gwincr11 gwincr11 deleted the cg-accessibility branch March 31, 2022 19:19
@knsv knsv mentioned this pull request May 6, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants