okjuan / vbook

0 stars 0 forks source link

Implement hover cards for post links #5

Closed okjuan closed 7 months ago

okjuan commented 8 months ago

This has turned out to be much trickier than expected. There are tricky implications to nesting the hovercard inside the linked text because <p>s cannot contain block-level elements. But I don't want to stop using <p>s for accessibility reasons. Nor do I want to sacrifice having block elements in the hovercards. So, for each internal site link, I break the containing <p> in half by inserting </p>, insert a link and a <div> containing the hovercard, and then mend the second part of the original <p> by inserting <p>.

TODO

screenshot1 image