So I went to read the Secret History of Empires, but realized that it was problematic that it didn't have hover-links for the cards; considering that I don't know almost any of the card effects by name yet. So, I went about adding an "auto-link" feature, which would (optionally) add the hover-links to all card names used in a post, even if the person who posted it doesn't have the extension, or chose not to add the card link markup.
So I got basic functionality working fine; but cards that use the names of other cards turns out to be a bigger problem than I thought. I give the markup to City Quarter; it then becomes surprisingly hard to not mess it up as it tries to then give that same text the markup for City.
So, the solution is to take the easy way out, at least for now... cards that are a smaller part of other card names are simply excluded. City won't get the markup; City Quarter works fine. All the Villages work except Village, and sadly Villa. It doesn't affect very many Empires cards anyway; I think just Villa and Triumph. So enjoy reading the secret history with card links!
And in an effort to get this out before everyone has read the secret history anyway, only enabling the links works for now. Unchecking the box does nothing. Checking it again messes stuff up by adding in the links a second time. But refreshing the page always starts clean.