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

Conditionnaly include highlight JS #227

Open
rgaudin opened this issue Jul 5, 2021 · 10 comments
Open

Conditionnaly include highlight JS #227

rgaudin opened this issue Jul 5, 2021 · 10 comments
Milestone

Comments

@rgaudin
Copy link
Member

rgaudin commented Jul 5, 2021

Currently, we include highlight JS (and the stack.js stacks that's required to configure it) for all domains. On SE, this is only included for a number of domains.

We should make a request to the homepage of the online domain to find out if it should be enabled or not.

@yekanchi
Copy link

seems like this is not working anymore. no code is highlighted.

@kelson42
Copy link
Contributor

kelson42 commented Dec 25, 2022

@yekanchi You have a precise example in mind on a recent ZIM file?

@yekanchi
Copy link

@yekanchi You have a precise example in mind on a recent ZIM file?

As I tested locally and it's the same on the library.kiwix.org, the code fragments of the questions and answers are not highlighted.

@kelson42
Copy link
Contributor

@yekanchi Which URL for example?

@kelson42 kelson42 reopened this Dec 26, 2022
@kelson42 kelson42 added this to the 2.1.0 milestone Dec 26, 2022
@kelson42
Copy link
Contributor

@rgaudin
Copy link
Member Author

rgaudin commented Dec 26, 2022

Indeed the method used to detect whether a stackoverflow domain uses highlighting or not doesn't work anymore. I'll look for an alternative but maybe it's easier and more future-proof to just enable it unconditionally.

The other conditional feature (mathjax) still works though.

@kelson42
Copy link
Contributor

@rgaudin Or create an automated test to secure it works fine still.

@rgaudin
Copy link
Member Author

rgaudin commented Dec 26, 2022

@rgaudin Or create an automated test to secure it works fine still.

Not quite adapted in this case I think.

We're looking on online source for a clue informing whether highlight was loaded or not (a CSS class). Testing this would mean recording which one is expected to have it, defeating that dynamic behavior. Or we'd do it only on some and not all which would be hazardous given the large number of SE domains.

Also, what happened is a code change online, yet we had no update of the code base for a long time. An action would only break on code change. Or it would have to be scheduled periodic check, which we don't really need otherwise.

I think strengthening the detection by looking for a better source of information is more important but it's not exclusive and a test would help.

@stale
Copy link

stale bot commented May 26, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label May 26, 2023
@kelson42 kelson42 modified the milestones: 2.1.0, 2.2.0 Oct 29, 2023
@stale stale bot removed stale labels Oct 29, 2023
@benoit74 benoit74 modified the milestones: 2.2.0, 2.3.0 Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants