Skip to content

Change canonical reference delimiter from ":" to "." for manuscript formatting#296

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/update-canonical-reference-separator
Draft

Change canonical reference delimiter from ":" to "." for manuscript formatting#296
Copilot wants to merge 2 commits into
mainfrom
copilot/update-canonical-reference-separator

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 17, 2025

Manuscripts typically use "." as the section delimiter (e.g., "Sententiae liber 2.dist. 17") rather than ":" which is primarily for biblical references. When building canonical references from structured fields (Document, Section, Subsection), the system was hardcoded to use ":".

Changes

  • Updated modifyTableTR() in js/deer-config.js to use "." delimiter when constructing canonical references from structured fields
  • Added test coverage for canonical reference construction logic

Behavior

Before:

// Document="Manuscript", Section="2", Subsection="17"
canonicalReference = `${doc} ${section}:${subsection}` // "Manuscript 2:17"

After:

canonicalReference = `${doc} ${section}.${subsection}` // "Manuscript 2.17"

User-entered canonical reference strings (e.g., "Matthew 5:1") are preserved as-is. The structured fields are primarily for filtering/searching and only used to build the reference when no user input exists.

Original prompt

This section details on the original issue you should resolve

<issue_title>Default separator for Canonical Reference</issue_title>
<issue_description>The default delimiter for the first segment of a canonical reference locator was set to ":" as in "Matthew 5:4" but most manuscripts would default to just a ".". Allow for the reference locator string to be whatever is entered, but when building it for the interface from {Document, Section, Subsection} be sure to use the "." instead. In most cases, we would rather have the entered string be the displayed value anyway, with the subsection encoding being used mostly for filtering and searching.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Copilot AI changed the title [WIP] Update default separator for canonical reference Change canonical reference delimiter from ":" to "." for manuscript formatting Nov 17, 2025
Copilot AI requested a review from cubap November 17, 2025 21:36
Comment thread js/deer-config.js
if(!doc && (section && subsection)) doc = "Matthew"

if(doc && section && subsection) canonicalReference = `${doc} ${section}:${subsection}`
if(doc && section && subsection) canonicalReference = `${doc} ${section}.${subsection}`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

only reassign canonicalReference if it doesn't already have a value. This whole block can be put inside an if

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't need this test. The tests here are weak and will be handled separately.

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.

Default separator for Canonical Reference

2 participants