-
-
Notifications
You must be signed in to change notification settings - Fork 181
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 no longer being rendered by viewContainerRef component creation #555
Comments
Hi @nbarrett Can you provide a reproduction repository? |
Hmm, might be difficult as my codebase is around 30K lines so difficult to isolate just a small example. The repo is publc though and the service that does the render is here. There is also an alternative method I added that passes the raw html containing markdown to |
I did manage to get my component working by doing this, but it bypasses ngx-markdown which I'd prefer not to do:
|
I'm experiencing the exact same issues in a project where markdown is also being rendered in a dynamic child component. An interesting addition is that this started to break once i migrated my root component to be standalone. When the root component of my app is still non-standalone using an NgModule it will render fine. I'm also observing that sometimes it does render, but only one single component using markdown at a time. This is on a news article page. Only the first component loads but every time i trigger some kind of event on the page one additional event renders. So when i click a dropdown button ten times it renders ten components. Maybe irrelevant information, but it feels like change detection makes this break when the component is loaded dynamically. |
- First leaflet commit which includes ngx-leaflet dependency - New functionality allows start point to be edited by dragging pin on map - Lat/Long, grid reference, postcode and location updated and saved on walk - Walk Edit Maps view can be toggled between Pin Location View and Google Maps - Walk View can be toggled between Pin Location View and Google Maps - Walk start/end location now standardised to fall in line with Ramblers data structure - Data migration performed automatically on detection of walks that are in the old format - trigger workflow for pre-main branch - Includes workaround for markdown not rendering on some components - documented in jfcere/ngx-markdown#555
First of all - thanks so much for ngx-markdown @jfcere , I've been using it for years and it's awesome! 🎉
Heres's my issue: I've just upgraded my Angular project to version 18 and have your dependencies set to:
Everything about the app works perflectly except one aspect where I render a component html programmatically using the mechanism below:
I need to do it "synchronously" this way as so that I can send the html off to an email service that's also part of my app. When I do this, any html that should render markdown returns an empty string. For instance here is a template that contains such markdown - for diagnostic I've added both
Without markdown
andWith markdown
:An example of the rendered html output from the above is here
Any suggesstions please? When I render the above template within my UI, it's fine, so it must be something about how the component is rendered via
viewContainerRef
.The text was updated successfully, but these errors were encountered: