CDRH / chesnutt

Rails site code for the Charles W. Chesnutt Archive https://chesnuttarchive.org
0 stars 0 forks source link

remove duplicate headings for tables #256

Open kmcmullen opened 4 months ago

kmcmullen commented 4 months ago

When we have a table, the <head> of the table is currently displaying twice. See https://cdrhdev1.unl.edu/chesnutt/item/ccda.corr01888 ("Dr." and "Cr." are only supposed to appear once). We need to remove one of those.

erinchambers commented 1 month ago

The Chesnutt XSLT has a template that overrides Datura's <head> formatting, such that it wasn't ignoring head elements that were table headers. Meanwhile, Datura has a template for table/head, so we were getting duplicates.

There are probably more elegant ways to handle this, but I wanted to be as minimally invasive as possible... I added an <xsl:when> to the custom template: if its direct parent is <table>, the custom template just doesn't add anything. I also tested to make sure it only applies to table heads, and not headings within other table cells.

erinchambers commented 1 month ago

Here's the commit

kmcmullen commented 1 month ago

That seems perfect. Thanks, @erinchambers! Should I wait for you to close this?

erinchambers commented 1 month ago

Awesome! I'll have Karin review the PR and then close the issue