Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A a11yproject.com
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 40
    • Issues 40
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The A11Y Project
  • a11yproject.com
  • Merge requests
  • !1048

Remove markdownItAnchor

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/yatil/patch-1 into main 4 years ago
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: yatil

Rationale: markdownItAnchor adds links with the hash symbol (#) to the headings of any page but those links are marked aria-hidden="true" which produces empty links that can be reached by keyboard. It is confusing for users of assistive technology.

In an attempt to fix it one could add tabindex="-1" to those links, making them unavailable for keyboard users. But that would also be an issue.

I think the optimal solution is having a switch to turn those links on and adding an aria-label that says “Direct link to [this section] of the page”, with [this section] replaced by the name of the section.

Until a better solution exists I would remove the functionality as a whole.

Compare
  • main (base)

and
  • latest version
    9481cf0a
    1 commit, 2 years ago

1 file
+ 1
- 9

    Preferences

    File browser
    Compare changes
.eleventy.js
+ 1
- 9
  • View file @ 9481cf0a

  • Edit in single-file editor

  • Open in Web IDE


@@ -81,21 +81,13 @@ module.exports = function (eleventyConfig) {
/* Markdown Plugins */
let markdownIt = require("markdown-it");
let markdownItAnchor = require("markdown-it-anchor");
let options = {
html: true,
breaks: true,
linkify: true
};
let opts = {
permalink: true,
permalinkClass: "direct-link",
permalinkSymbol: "#"
};
eleventyConfig.setLibrary("md", markdownIt(options)
.use(markdownItAnchor, opts)
);
eleventyConfig.setLibrary("md", markdownIt(options));
eleventyConfig.addTransform("htmlmin", function (content, outputPath) {
if (
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
2
2 participants
Administrator
Byte Blaze
Reference: a11yproject/a11yproject.com!1048
Source branch: github/fork/yatil/patch-1

Menu

Explore Projects Groups Snippets