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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using <mark> tags in the <Highlight> element? #4

Open
Querela opened this issue Dec 21, 2024 · 2 comments
Open

Using <mark> tags in the <Highlight> element? #4

Querela opened this issue Dec 21, 2024 · 2 comments

Comments

@Querela
Copy link

Querela commented Dec 21, 2024

Hi, thank you, this works really well. I still need to be a bit of tweaking for performance (maybe some debouncing on the filter input) but looks good so far.

While checking the highlighting, I found that it generates <span> tags. Is there any way or some easy way to be able to specify what HTML tag I can use in the react <Highlight/> element? I would like to use the <mark> element. In react-bootstrap there was an as= attribute but the logic might be a bit complicated to integrate here?

I know that I can probably do everything by specifying the classname / style if I just want to change the styling but I was thinking about the semantics of using the <mark> tag. Alternatively, I could probably also just duplicate the <Highlight/> component code a bit.

@radex
Copy link
Collaborator

radex commented Dec 21, 2024

Not at this time, but this seems like an easy improvement - PRs are welcome

@Querela
Copy link
Author

Querela commented Jan 2, 2025

Ok. I will see what I can do. :-)

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

No branches or pull requests

2 participants