Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Apply abbreviations to literal names in short form#181

Open
adunning wants to merge 1 commit into
jgm:masterjgm/citeproc:masterfrom
adunning:name-abbradunning/citeproc:name-abbrCopy head branch name to clipboard
Open

Apply abbreviations to literal names in short form#181
adunning wants to merge 1 commit into
jgm:masterjgm/citeproc:masterfrom
adunning:name-abbradunning/citeproc:name-abbrCopy head branch name to clipboard

Conversation

@adunning

@adunning adunning commented May 4, 2026

Copy link
Copy Markdown
Contributor

Add support for abbreviating literal names in names rendering with form="short".

Add support for abbreviating literal names in names rendering with
`form="short"`.
Copilot AI review requested due to automatic review settings May 4, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends CSL short-form rendering so abbreviation maps are applied to additional literal-like fields, specifically literal names rendered with <name form="short"/>, alongside new regression tests and a README note describing the behavior.

Changes:

  • Apply abbreviation lookup to literal names during short-form name rendering.
  • Add CSL fixture tests for abbreviated container-title, collection-title, and literal author names.
  • Document that form="short" rendering uses provided CSL abbreviations, including for literal names.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/csl/variables_ContainerTitleAbbreviation.txt Adds a fixture verifying container-title short-form abbreviation rendering.
test/csl/variables_CollectionTitleAbbreviation.txt Adds a fixture verifying collection-title short-form abbreviation rendering.
test/csl/name_LiteralShortFormAbbreviation.txt Adds a fixture for abbreviating a literal author name in short form.
src/Citeproc/Eval.hs Implements literal-name abbreviation during short-form name formatting.
README.md Documents how abbreviations are applied during short-form rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Citeproc/Eval.hs
-- we set delimiter to Nothing because we're handling delim
-- manually, to allow for things like "and" and no final comma
return $ Tagged (TagNames var namesFormat names)
return $ Tagged (TagNames var namesFormat namesForRendering)
Comment thread src/Citeproc/Eval.hs
Comment on lines +2195 to +2199
let namesForRendering =
if nameForm nameFormat == Just ShortName
then map abbreviateLiteralName names
else names
names' <- zipWithM (formatName nameFormat formatting) [1..] namesForRendering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.