Omeka stripping away "id" attribute of HTML anchors

I am attempting to create footnotes within an HTML-enabled element that provides more detailed information about an item. In general I follow these guidelines, so that a footnote reference might look like this:

<a href="#fn1" id="fr1">[1]</a>

and the footnote itself might look like this:

[<a id="fn1" href="#fr1">1</a>] footnote text

I have the HTML for each item in a spreadsheet which I import using the CSV Import plugin. However, when I viewed my item on the “show” page, I noticed that the anchors are not linking to each other within the page, and upon inspecting the HTML I discovered that “id” attributes have been stripped away, so that the footnote HTML looks like this now:

<a href="#fn1">[1]</a>
[<a href="#fr1">1</a>] footnote text

At first I thought that they were being removed by Omeka’s own HTML filtering (under Settings > Security), but after disabling this, the attribute is still being removed. Perhaps it is TinyMCE that’s doing it, but if so, I don’t know how to stop it.

Please let me know if you have any ideas.

I think the problem here is the use of CSV Import. It is the HTML Purifier that’s stripping the ID attributes, but the wrinkle is that the importer forces the usage of the purifier even if it’s disabled in the security settings.

1 Like

Yes, you’re right, thanks. Having turned off the security and inputted the HTML directly into the element, I see that the anchors work correctly. What is the best way to troubleshoot/get support for the plugin? Sorry, I’m new to these forums (and to Omeka).

That behavior’s been part of the plugin for so long that I’d hesitate to make any changes to it because users could be depending on it by now. If anything, it’d have to be a setting that just allowed users to switch off the purifier (or make it obey the global setting).

If you’re interested in trying to change it just for yourself, the relevant file in the importer is models/CsvImport/ColumnMap/Element.php, in the map method. You could change that to just not run the purifier.

The alternative solution would be changing the purifier’s configuration to allow IDs, which would be a change to the Omeka core.

Thanks so much. Seems like a dead end, practically speaking. I’ll either copy-paste the HTML manually from my spreadsheet or figure out a new footnote design.