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

Code highlighting is not working #16

Open
jaydeepw opened this issue Nov 14, 2024 · 7 comments
Open

Code highlighting is not working #16

jaydeepw opened this issue Nov 14, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@jaydeepw
Copy link

Describe the bug
A clear and concise description of what the bug is.
When I install the dependencies successuflly and run npm run dev,
the web app pops up in the browser successfully.

But when I goto http://localhost:3001/posts/markdown-reference
I dont see correct highlighting of the code that is present in the mardown.

Check images attached

To Reproduce
Steps to reproduce the behavior:

  1. Run npm run dev
  2. Go to /posts/markdown-reference
  3. Scroll down to the header named JSX or HTML
  4. The code sample is not highlighted

Expected behavior
In step no. 4 above, the code sample should be highlighted.

Screenshots
Screenshot 2024-11-14 at 11 12 36 AM

Desktop (please complete the following information):

  • OS: Mac OS Sonoma 14.1
  • Browser Brave v1.73.89, Chrome latest
@jaydeepw jaydeepw changed the title Syntax Highlighting is not working Syntax highlighting is not working Nov 14, 2024
@sandypockets sandypockets self-assigned this Nov 19, 2024
@sandypockets sandypockets added the bug Something isn't working label Nov 19, 2024
@sandypockets
Copy link
Owner

Hi @jaydeepw

Thanks for opening this issue. The syntax highlighting should now be fixed!

CleanShot 2024-11-19 at 21 39 23@2x

Closing this issue, but feel free to reopen if there's anything else

@jaydeepw
Copy link
Author

Thanks, sounds good.

@jaydeepw
Copy link
Author

I think the issue is still not fixed. I did a fresh clone of the repo and installed the deps and gave it a spin.

However, I still dont see the right behavior.
Please check the attached .gif
code-highlighting1

@jaydeepw jaydeepw changed the title Syntax highlighting is not working Code highlighting is not working Nov 20, 2024
@sandypockets
Copy link
Owner

Thanks for sending over this gif. I just did a fresh clone myself and it worked without issue (in an incognito tab).

I noticed in your gif that the text, particularly the header navigation, and the headings, is using what looks like OS fallback fonts, and doesn't match the fonts that are used in the project (visible in the demo, here).

Screenshot from your gif
CleanShot 2024-11-20 at 20 05 38@2x

Screenshot of demo
CleanShot 2024-11-20 at 20 07 57@2x

The demo is a live instance of this repo (hosted on Vercel), so if the demo website is working normally, then cloning this repo should work normally too.

With all that in mind, it seems like the issue might be unrelated to the syntax highlighting, and that there might be some other configuration on your machine or browser that's preventing the page from fully loading, causing some font imports or package imports to fail.

Can you tell me a bit more about your set up, like what browser and version you're using, as well as which version of Node you're using? Do you see any errors in the console or failures in the network tab in your browser?

@jaydeepw
Copy link
Author

I noticed, after reloading the page I get the results that you are talking about. But on first load, it shows like my GIF image shows.

I am attaching another GIF for more clarity.

code-highlighting1

Can you tell me a bit more about your set up, like what browser and version you're using, as well as which version of Node you're using? Do you see any errors in the console or failures in the network tab in your browser?

I am using Brave, but same problem with Chrome too. I am using node v20.18.0 I dont see any errors in the console on the first load neither on refresh.

Also, the demo hosted on Vercel behaves the same like in my attached GIF in this comment. Interesting problem.

@sandypockets
Copy link
Owner

Thanks for including this and testing out the demo! It seems that the issue is indeed still unresolved, as I was able to replicate the error on the demo.

It seems the issue is actually with my machine, and not yours. Must have some cached content or something. I'll continue investigating and circle back once I have a solution in the works.

@sandypockets sandypockets reopened this Nov 24, 2024
@jaydeepw
Copy link
Author

Sounds good. Please update when ready, I will test out and confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants