Skip to content

Does not highlight text in ::before and ::after css pseudo-elements. #47

Open

Description

@wagbame

Describe the bug
When a text is in a ::before or ::after css pseudo-element it doesn't get highlighted.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Open https://www.w3schools.com/cssref/tryit.php?filename=trycss_sel_before
  2. Highlight the word Read.
  3. The problem is that only the left Read is highlighted.

Expected behavior
All 3 Read is highlighted.

Device info:

  • operating system: Windows 10
  • Browser and version: Firefox 138.0.4
  • Auto Highlight version: 5.3

Additional info
I don't know if this information is helpful, but in Firefox the ability to search/highlight in ::before and ::after pseudo-elements with the built-in ctrl+f search was adden in version 77. This is the bugzilla link: https://bugzilla.mozilla.org/show_bug.cgi?id=1627643 . Hope this helps. :)

Activity

  1. added
    bug
    on May 25, 2025
  2. Juraj-Masiar commented on May 25, 2025

    @Juraj-Masiar
    Member

    Hello,
    Sadly, this is currently absolutely impossible :).
    The highlighter works by inserting a new HTML elements (styled with color) to the page, replacing the text occurrences.
    But before/after are pseudo elements, so they technically not even in the HTML, they are in the CSS, so I can't imagine how it could ever work.
    Firefox search highlighter works totally differently with direct access to all aspects of the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions