openchemlib 9.12.0 → 9.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1369,7 +1369,8 @@ function extendFromMolfile(Molecule2) {
1369
1369
  Molecule2.fromMolfile = function fromMolfile(molfile, options = {}) {
1370
1370
  const { customLabelPosition } = options;
1371
1371
  const molecule = _fromMolfile.call(this, molfile);
1372
- const lines = molfile.split("\n");
1372
+ const eol = molfile.includes("\r\n") ? "\r\n" : "\n";
1373
+ const lines = molfile.split(eol);
1373
1374
  if (lines.length < 4 || !lines[3].includes("V2000")) {
1374
1375
  return molecule;
1375
1376
  }
@@ -1396,6 +1397,13 @@ function extendFromMolfile(Molecule2) {
1396
1397
  }
1397
1398
  }
1398
1399
  }
1400
+ if (line.startsWith("M ZZC")) {
1401
+ const atom = Number(line.slice(7, 10).trim());
1402
+ const label = line.slice(10).trim();
1403
+ if (atom && label) {
1404
+ molecule.setAtomCustomLabel(atom - 1, label);
1405
+ }
1406
+ }
1399
1407
  }
1400
1408
  changeMolfileCustomLabelPosition(molecule, customLabelPosition);
1401
1409
  return molecule;
@@ -1426,7 +1434,8 @@ function extendToMolfile(Molecule2) {
1426
1434
  if (!includeCustomAtomLabelsAsALines && !includeCustomAtomLabelsAsVLines && !removeCustomAtomLabels) {
1427
1435
  return molfile;
1428
1436
  }
1429
- let lines = molfile.split("\n");
1437
+ const eol = molfile.includes("\r\n") ? "\r\n" : "\n";
1438
+ let lines = molfile.split(eol);
1430
1439
  if (removeCustomAtomLabels) {
1431
1440
  lines = lines.filter(
1432
1441
  (line) => !CUSTOM_ATOMS_LABELS_TAGS.some((tag) => line.startsWith(tag))
@@ -1453,7 +1462,7 @@ function extendToMolfile(Molecule2) {
1453
1462
  return molfile;
1454
1463
  }
1455
1464
  lines.splice(mEndIndex, 0, ...newLines);
1456
- return lines.join("\n");
1465
+ return lines.join(eol);
1457
1466
  };
1458
1467
  }
1459
1468
 
@@ -71250,7 +71259,7 @@ function getExports($wnd) {
71250
71259
  $sendStats("moduleStartup", "end");
71251
71260
  $gwt && $gwt.permProps && __gwtModuleFunction.__moduleStartupDone($gwt.permProps);
71252
71261
  const toReturn = $wnd["OCL"];
71253
- toReturn.version = "9.12.0";
71262
+ toReturn.version = "9.13.0";
71254
71263
  return toReturn;
71255
71264
  }
71256
71265
  var isBrowserWindow = typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -71394,8 +71403,8 @@ export {
71394
71403
  };
71395
71404
  /**
71396
71405
  * openchemlib - Manipulate molecules
71397
- * @version v9.12.0
71398
- * @date 2025-10-15T07:37:41.764Z
71406
+ * @version v9.13.0
71407
+ * @date 2025-10-28T16:31:52.366Z
71399
71408
  * @link https://github.com/cheminfo/openchemlib-js
71400
71409
  * @license BSD-3-Clause
71401
71410
  */