Skip to content

fix no name molecule parsing#4

Merged
asiomchen merged 2 commits into
mainfrom
no-name-fixes
Apr 15, 2026
Merged

fix no name molecule parsing#4
asiomchen merged 2 commits into
mainfrom
no-name-fixes

Conversation

@asiomchen

Copy link
Copy Markdown
Owner

Fix SDF import for molecules with blank or missing name, fixes #3

Summary

  • Molecules whose MOL-block title line is blank were silently dropped or had a corrupted
    molblock stored in frontmatter.

Changes

  • src/sdf-parser.ts: Normalize \r\n → \n before splitting; strip the post-delimiter newline only for records at index > 0.
  • src/sdf-import.ts: Read the MOL-block title line as the highest-priority name source before falling back to SDF
    properties.
  • src/import-utils.ts: Emit |2- instead of | for block scalars whose value starts with \n.
  • src/tests/sdf-parser.test.ts / src/tests/import-utils.test.ts: New test suite (Vitest) covering all three
    cases

@asiomchen asiomchen merged commit 4b654e3 into main Apr 15, 2026
1 check passed
@asiomchen asiomchen deleted the no-name-fixes branch April 16, 2026 16:35
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.

Invalid molecule if the molecule has no name

1 participant