andi23rosca / solid-markdown

Render Markdown as Solid components
MIT License
106 stars 10 forks source link

solid markdown not rendering blocks of code #30

Closed Rotwo closed 5 months ago

Rotwo commented 5 months ago

I've been trying to render some code like this one:

#define LED_PIN 9
void setup() {
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);
}
void loop() {

}

but the code is not rendering any code format or colours. Please tell me if I'm missing some setting to enable that or if it is unsupported.

imkunet commented 5 months ago

Hi there. I've had a go at this issue too. Here's a Stabkblitz link of a minimal example of how to do the syntax highlighting.

https://stackblitz.com/edit/solidjs-template-9p3yvx?file=src%2FApp.tsx

Notes

EDIT: hold on I busted pnpm so badly that the entire project is busted let me fix it EDIT: alright it's been fixed and the link's been updated!

Rotwo commented 5 months ago

Hey! I have finally fixed it, I ended using a third-party library called highlight.js which works surprisingly well with solid-markdown. Also, thanks for letting me know the new npm package, it was really helpful to fix some types errors.