Skip to content

tabpane Shortcode ID Conflict with readfile Shortcode #2308

@samiahmedsiddiqui

Description

@samiahmedsiddiqui

Environment

  • Version of Docsy you are using: 0.12.0
  • How are you using Docsy? As a: Hugo module
  • Version of Hugo you are using (output of hugo version): 0.148.2
  • OS: macOS

Problem

I have encountered an HTML ID conflict when using the tabpane shortcode within a file that is included by the readfile shortcode.

The issue occurs because the readfile shortcode renders content that contains its own tabpane shortcode, but it generates the same HTML IDs as the tabpane shortcode used in the original content file. This creates duplicate IDs on the page, causing the tabs within the included content to become non-functional.

Example scenario:

  • A main content file contains a tabpane shortcode.
  • Later in the same file, a readfile shortcode is used to include a second file.
  • This included file also contains a tabpane shortcode.

The resulting HTML has two sets of tabs with identical HTML IDs, which prevents the second set of tabs from working correctly.

The expected behavior is for the shortcodes to generate unique IDs, perhaps by adding a random suffix or a contextual prefix, to prevent these conflicts. This would ensure that all tabs on the page function as intended, regardless of how they are nested or included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions