@manuscripts/transform 4.3.9 → 4.3.11

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.
@@ -135,18 +135,14 @@ const wrappers = {
135
135
  issue: (str) => `<issue>${str}</issue>`,
136
136
  supplement: (str) => `<supplement>${str}</supplement>`,
137
137
  page: (str) => {
138
- let fpage = str;
139
- let lpage;
140
- const parts = str.split('-');
141
- if (parts.length === 2) {
142
- fpage = parts[0];
143
- lpage = parts[1];
138
+ const parts = str.split(/([-–])/);
139
+ if (parts.length === 3) {
140
+ const fpage = parts[0].trim();
141
+ const separator = parts[1].trim();
142
+ const lpage = parts[2].trim();
143
+ return `<fpage>${fpage}</fpage>${separator}<lpage>${lpage}</lpage>`;
144
144
  }
145
- str = str.replace(fpage, `<fpage>${fpage}</fpage>`);
146
- if (lpage) {
147
- str = str.replace(lpage, `<lpage>${lpage}</lpage>`);
148
- }
149
- return str;
145
+ return `<fpage>${str.trim()}</fpage>`;
150
146
  },
151
147
  title: (str, item) => {
152
148
  const type = item.type;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "4.3.9";
4
+ exports.VERSION = "4.3.11";
@@ -128,18 +128,14 @@ const wrappers = {
128
128
  issue: (str) => `<issue>${str}</issue>`,
129
129
  supplement: (str) => `<supplement>${str}</supplement>`,
130
130
  page: (str) => {
131
- let fpage = str;
132
- let lpage;
133
- const parts = str.split('-');
134
- if (parts.length === 2) {
135
- fpage = parts[0];
136
- lpage = parts[1];
131
+ const parts = str.split(/([-–])/);
132
+ if (parts.length === 3) {
133
+ const fpage = parts[0].trim();
134
+ const separator = parts[1].trim();
135
+ const lpage = parts[2].trim();
136
+ return `<fpage>${fpage}</fpage>${separator}<lpage>${lpage}</lpage>`;
137
137
  }
138
- str = str.replace(fpage, `<fpage>${fpage}</fpage>`);
139
- if (lpage) {
140
- str = str.replace(lpage, `<lpage>${lpage}</lpage>`);
141
- }
142
- return str;
138
+ return `<fpage>${str.trim()}</fpage>`;
143
139
  },
144
140
  title: (str, item) => {
145
141
  const type = item.type;
@@ -1 +1 @@
1
- export const VERSION = "4.3.9";
1
+ export const VERSION = "4.3.11";
@@ -1 +1 @@
1
- export declare const VERSION = "4.3.9";
1
+ export declare const VERSION = "4.3.11";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/transform",
3
3
  "description": "ProseMirror transformer for Manuscripts applications",
4
- "version": "4.3.9",
4
+ "version": "4.3.11",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -44,6 +44,8 @@
44
44
  "@babel/core": "7.23.7",
45
45
  "@babel/preset-env": "7.23.8",
46
46
  "@babel/preset-typescript": "7.23.3",
47
+ "@eslint/eslintrc": "3.3.1",
48
+ "@eslint/js": "9.39.1",
47
49
  "@jats4r/dtds": "0.0.10",
48
50
  "@manuscripts/eslint-config": "0.5.1",
49
51
  "@types/jest": "30.0.0",
@@ -53,29 +55,30 @@
53
55
  "@types/semver": "7.7.0",
54
56
  "@types/uuid": "9.0.8",
55
57
  "@types/w3c-xmlserializer": "2.0.4",
56
- "@typescript-eslint/eslint-plugin": "5.62.0",
57
- "@typescript-eslint/parser": "5.62.0",
58
+ "@typescript-eslint/eslint-plugin": "8.46.4",
59
+ "@typescript-eslint/parser": "8.46.4",
58
60
  "babel-jest": "30.0.5",
59
- "eslint": "8.57.1",
60
- "eslint-config-prettier": "8.10.0",
61
+ "eslint": "9.39.1",
62
+ "eslint-config-prettier": "10.1.8",
63
+ "eslint-plugin-diff": "2.0.3",
61
64
  "eslint-plugin-header": "3.1.1",
62
- "eslint-plugin-import": "2.31.0",
63
- "eslint-plugin-jest": "27.9.0",
65
+ "eslint-plugin-import": "2.32.0",
66
+ "eslint-plugin-jest": "29.1.0",
64
67
  "eslint-plugin-jsx-a11y": "6.10.2",
65
- "eslint-plugin-mdx": "2.3.4",
68
+ "eslint-plugin-mdx": "3.6.2",
66
69
  "eslint-plugin-node": "11.1.0",
67
- "eslint-plugin-prettier": "4.2.1",
68
- "eslint-plugin-promise": "6.6.0",
70
+ "eslint-plugin-prettier": "5.5.4",
71
+ "eslint-plugin-promise": "7.2.1",
69
72
  "eslint-plugin-react": "7.37.5",
70
- "eslint-plugin-react-hooks": "4.6.2",
71
- "eslint-plugin-simple-import-sort": "8.0.0",
73
+ "eslint-plugin-react-hooks": "7.0.1",
74
+ "eslint-plugin-simple-import-sort": "12.1.1",
72
75
  "husky": "8.0.3",
73
76
  "jest": "30.0.5",
74
77
  "jest-environment-jsdom": "30.0.5",
75
78
  "libxmljs2": "0.35.0",
76
79
  "migration-base": "npm:@manuscripts/transform@2.3.20",
77
80
  "npm-run-all": "4.1.5",
78
- "prettier": "2.8.8",
81
+ "prettier": "3.6.2",
79
82
  "prosemirror-state": "1.4.3",
80
83
  "prosemirror-view": "1.39.2",
81
84
  "rimraf": "6.0.1",