5j9 / citer

An online citation generator for Wikipedia
GNU General Public License v3.0
26 stars 13 forks source link

Support parameter delimiter spacing options #57

Closed EArmour closed 6 days ago

EArmour commented 6 days ago

Citer is currently hardcoded to always have spaces on either side of the pipe delimiter | between cite template parameters:

{{cite book | last= | first= | date=}}

This is inconsistent with the apparently preferred style shown on the template help pages, as well as the "insert template" option in the page editor, which use an asymmetrical style like:

{{cite book |last= |first= |date=}}

And those who are efficiency-minded may wish to forego spaces between params entirely (or just to match exists cites on the page for consistency):

{{cite book|last=|first=|date=}}

This PR adds a "Pipe spacing" selection, functioning the same as the "Date format" selector already present. However, regardless of the option selected, it does newly enforce compact/no spaces on the specific {{sfn|Name|2024}} templates, again in reflection of the template help page usage, and because there is much less need for spaces to improve readability with so few parameters.

This also restores the real-time updating of date formats in the citations, which appears to have been accidentally disabled with the removal of the onDateChange function with b5006129b48ab2afcd162e9c65e512dee6194983