LEAN-5987 Contributors Bio Support - #362
mbartenev-atypon wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical schema and serialization issues, plus migration and importer correctness gaps, remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (5)
What changed in this PR
Adds contributor biography support to the ProseMirror schema and JATS import/export paths while removing obsolete attributes.
Changes:
- Adds and registers the
bionode. - Allows optional biographies on contributors.
- Adds JATS bio parsing and serialization mappings.
- Removes obsolete
contentsattributes.
| File | Review summary |
|---|---|
src/schema/types.ts |
No final comments. |
src/schema/nodes/keywords_element.ts |
Nit (1 vote): stale contents type/parser field remains. |
src/schema/nodes/contributor.ts |
Critical (3 votes): add migration for legacy content. Nit (1 vote): update the importer snapshot and add bio coverage. |
src/schema/nodes/bio.ts |
Critical (3 votes): missing content hole drops children. Moderate (1 vote): content expression cannot represent multiple JATS bio paragraphs. |
src/schema/nodes/bibliography_element.ts |
No final comments. |
src/schema/index.ts |
No final comments. |
src/jats/importer/jats-dom-parser.ts |
Moderate (1 vote): unscoped rule mishandles standalone bios. Moderate (2 votes): bio IDs are not preserved. Nit (2 votes): add contributor-bio round-trip coverage. |
src/jats/exporter/jats-exporter.ts |
Moderate (2 votes): contributor serialization omits nested bios. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // This is a manual builder that is need only if we need to use this.writeParagraph() to strip rich text | ||
| // The editor will not allow rich text but if any imported - it will be stripped (can it be imported though)? | ||
| // | ||
| // private buildBioElement = (bio?: BioNode) => { |
There was a problem hiding this comment.
This is commented to make a decision on how we want to proceed with exports. If we want to stick with paragraphs stripped off of the rich text, then we need to use this instead of standard serialization approach that I've opted in for.
| }) | ||
| }) | ||
|
|
||
| // This will be used instead of this.serializeNode(bio) if paragraphs need rich-text stripping |
There was a problem hiding this comment.
If we want to proceed with paragraphs stripped off of the rich-text - we need to use this commented implementation instead of the currently active one.
|
|
||
| export const contributor: NodeSpec = { | ||
| content: 'inline*', | ||
| content: 'bio?', |
There was a problem hiding this comment.
Please note that despite the fact we normally go for attributes whenever we need to add to contributors, here I went for children because:
- Internal nodes to it are already present in the schema and serialization and parsing for them is provided (paragraph, alt-text, image_element)
- The bio is a nested xml structure and reconstruction and storing in attributes will be a bit clumsy.
- If we will ever need to manage more complex content or rich-text in that structure we will have to overhaul attributes anyway into nodes.



Uh oh!
There was an error while loading. Please reload this page.