Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

simondate
Copy link
Member

@StuartNicholls StuartNicholls self-requested a review February 12, 2025 14:47
@simondate
Copy link
Member Author

simondate commented Feb 12, 2025

Just updated this PR as it was still stripping the aria-hidden="true" attribute.

Note for testers - You'll need to update the conf/config.json file, to include this -

 "ckEditorHtmlSupport": {
    "allow": [
      {
        "name": "^(blockquote|ul|ol|span)$",
        "attributes": true,
        "classes": true,
        "styles": true
      },
      {
        "name": ".*",
        "classes": true,
        "styles": true
      },
      {
        "name": "^a$",
        "attributes": {
          "target": true
        }
      }
    ],
    "allowEmpty": [
      "span", 
      "i"
    ]
  },

@simondate
Copy link
Member Author

Just discovered that the any links to Glossary objects also weren't working.

The latest commit fixes this too.

allow: [{
name: "^(blockquote|ul|ol|span)$"
name: "^(a|blockquote|ul|ol|span)$",
"attributes": true,
Copy link
Member

@oliverfoster oliverfoster Mar 5, 2025

Choose a reason for hiding this comment

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

Won't this allow onclick attributes on all of the aforementioned tags? Which means that one AAT user could add JavaScript that another user could execute?

Choose a reason for hiding this comment

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

This was added to allow aria-hidden, if we think the above is a risk then we can add specific attributes. I believe like this:

attributes: { foo: 'true', bar: true }

Copy link
Member

Choose a reason for hiding this comment

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

It definitely is a risk if it allows all attributes.

Choose a reason for hiding this comment

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

@simondate , so allow, aria-hidden, aria-label?

Copy link
Member Author

@simondate simondate Mar 5, 2025

Choose a reason for hiding this comment

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

I would want data-glossaryterm included as it's the way you open glossary items within elements on the page.

If onclick is the only thing we're concerned about could we just disable that?

Copy link
Member

@oliverfoster oliverfoster Mar 5, 2025

Choose a reason for hiding this comment

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

I wouldn't go with disabling things. Something new is always added that makes denies redundant. Permissive allows are generally a better idea (as per the French vs British legal system).

How about we don't set the default config to allow/deny extra things that are specific to a vendor, but we instead just add allowEmpty and RemoveFormat to support the given use-case?

Copy link
Member Author

Choose a reason for hiding this comment

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

allowEmpty would fix the original issue, but I feel the glossary extension should be supported, considering it's a Core extension

Copy link
Member

@oliverfoster oliverfoster Mar 5, 2025

Choose a reason for hiding this comment

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

Does this work?

      {
        "name": ".*",
        "attributes": "^(id|role|aria-.+|data-.+)$",
        "classes": true,
        "styles": true
      },

In theory that should allow all aria- and data- prefixed attributes as well as role and id.

Copy link
Member

Choose a reason for hiding this comment

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

bump

@mrblonde77
Copy link

mrblonde77 commented Mar 26, 2025

Any update on this topic? We switched to the current Authoring Tool and Framework Version, and now we have problems with tables in the ckeditor. I assume that it is related to this problem: CKEditor toolbar element 'RemoveFormat' not loaded" #2815

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.

4 participants