Closed mbuhot closed 1 year ago
Looks like this is actually a bug in morphdom: https://github.com/patrick-steele-idem/morphdom/pull/231
I'll see if there's a workaround without the performance hit of replacing <LivePatch>
with <LiveRedirect>
Wow, great digging! If we have to use <LiveRedirect>
it won't be horrible, but definitely worth looking for a different workaround. We could potentially prefix the ids with some unique string when building the markdown html?
Yes unique IDs will solve it. We could generate a unique prefix based on a hash of the page title/content or even just the heading level, so that we'd have h1-migrations
and h2-migrations
.
Every version of everything has a uuid, so we should be able to just use that as a prefix when generating the HTML.
If we thread through the UUID of the thing we're rendering all the way down to here: https://github.com/ash-project/ash_hq/blob/main/lib/ash_hq/docs/extensions/render_markdown/render_markdown.ex#L115, then we can prefix all the ids with that.
Thanks @zachdaniel, I'll create a PR today 👍
Brief Description
Navigating from https://ash-hq.org/docs/guides/ash_postgres/1.1.1/topics/polymorphic_resources.md to https://ash-hq.org/docs/guides/ash_postgres/1.1.1/topics/migrations_and_tasks.md via the tree-view results in the "Migrations" heading appears both as a
<h1>
and as a<h2>
(see image).Steps to reproduce the bug
On MacOS Safari visit https://ash-hq.org/docs/guides/ash_postgres/1.1.1/topics/polymorphic_resources.md Click the Guides -> Topics -> Ash Postgres -> Migrations and Tasks link in the tree view Notice the header is incorrect. Refresh the page and it displays correctly.
Context
Perhaps it is related to both pages having a DOM element with id="migrations" ?