AmerMathSoc / texml

A repository for texml development
8 stars 2 forks source link

avoid nested xref #198

Open pkra opened 2 months ago

pkra commented 2 months ago

While jats and bits technically allow nested xref element, I think texml would do well to avoid it since it tends to lead to nested links in HTML which is invalid and causes usability issues.

Cases seen so far

pkra commented 2 months ago

I added a more complete list from a quick search through publications. We have 94 cases across 11 publications right now, some of which seem like bugs.

Almost all cases are from links inside tag or cite.

pkra commented 2 months ago

As per F2F, we want to avoid nested xrefs in general.

183 will be one part of that. Some of the bug-like examples will need to be checked. Otherwise, we'll try to flatten the inner xrefs (here and downstream).

@davidmjones maybe an inner xref should be resolved to a generic wrapping element in case we want to do something downstream (e.g., style it). But we can wait until the need arises.

pkra commented 2 months ago

Just FYI (since I don't think texml should change here): downstream also runs into nested links with xref inside toc-entry. That's because we turn toc-entry to a so we have also flattened those xref (since the earliest days).

pkra commented 2 months ago

An observation for the texml side of things: I stumbled upon the old fact that texml might generate xref without rid attribute (but with a ref-key and undefined ref-type).

I think (but would like to check that) this happens only in extreme edge cases, i.e., I can only find 5 papers right now.

More precisely, it seems this happens only when the referenced labels no longer exists in the source, usually by some clean up.

Since it only affects fairly old papers, I'm wondering if texml has made this obsolete.

Perhaps such an xref construction is an approach for the situation here, too.

pkra commented 3 weeks ago

@davidmjones ping on this.