Page MenuHomePhabricator

Exclude headings from lookups
Open, Needs TriagePublicFeature

Description

Terms appearing in headings or subheadings should not be looked up on the headings, but can be looked up if that appear outside heading tasks.

Excluding terms in h1 - h5 from being looked up would be helpful.

Justification
Any common terms including acronyms that are used in part of a heading, especially a subheading, cause a messy and unhelpful layout - these are especially common as the last or first word in a heading. Excluding these, or excluding certain tags from lookup would be helpful.

Example
On the helminthic therapy wiki, *Necator americanus and *larvae* are both looked up within the subheading The homeopathic remedy, “Necator americanus L3 larvae".

Event Timeline

Amousey changed the subtype of this task from "Task" to "Feature Request".Mar 6 2021, 1:45 PM

Currently, the elements to be ignored are defined by the following xpath query:

$textElements = $xpath->query(
   "//*[not(ancestor-or-self::*[@class='noglossary'] or ancestor-or-self::a)][text()!=' ']/text()"
);

If the query would be taken from a configuration variable instead of being hardcoded, other classes or tags could be easiliy added.