-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Markdown not working after upgrade to 1.6.0 #1203
Comments
I see, so you're just using the markdown component with loading your own content. You can try adding this to your bootstrap providers in the app.config.ts // ... other imports
import { ContentRenderer, MarkdownContentRendererService } from '@analogjs/content';
export const appConfig: ApplicationConfig = {
providers: [
// ... other providers
provideContent(
withMarkdownRenderer({
loadMermaid: () => import('mermaid'),
}),
withPrismHighlighter()
),
{ provide: ContentRenderer, useClass: MarkdownContentRendererService }
],
}; |
Add these import 'prismjs/components/prism-bash';
import 'prismjs/components/prism-css';
import 'prismjs/components/prism-javascript';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-markup';
import 'prismjs/components/prism-typescript'; |
I think make sens to add it into instructions, otherwise it is confusing how to integrate with syntax highlights . Same for providers, make sense to add it to content providers, what is the sens to initiate content provider and separately markdown service |
@alexcibotari In 1.6, we introduced build-time markdown rendering and syntax highlighting, so it doesn't need to be done client-side. If you were using We can add some instructions for those who want to do rendering/syntax highlighting client-side. |
As I statically generate my site, I want them to be generated during build time also, not on client side. At the moment I can achieve it only with server page. Is there any other way you will suggest to deal with static generation of content from headless CMS ? |
Yes, we can add some guidance on using a headless CMS. Do you have an example repo using a headless CMS? |
I can add you to one of my repositories for a website with Headless CMS integration. Also, based on your guidance I can create a public example to share with everyone. |
👍 |
Done. I wrote an email, just in case it will require me to share some private information. |
I found out that without adding At the same time, the UI is flickering after refresh You can check it here : https://localess.org/docs/sdk/typescript |
@alexcibotari I released a patch version with a fix for the flickering providers: [
MarkedSetupService,
provideContent(
withMarkdownRenderer({
loadMermaid: () => import('mermaid'),
}),
withHighlighter({ useClass: PrismHighlighter })
),
{provide: ContentRenderer, useClass: MarkdownContentRendererService},
] |
@brandonroberts Thank you, the flickering is fixed. |
Please provide the environment you discovered this bug in.
I have a working application on version Angular 18 and Analog 1.4.0.
After upgrading Analog to version 1.6.0 markdown content is not rendered anymore.
Which area/package is the issue in?
content
Description
I have a working application on version Angular 18 and Analog 1.4.0.
After upgrading Analog to version 1.6.0 markdown content is not rendered anymore.
Please provide the exception or error you saw
Other information
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: