Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
},
"jest.jestCommandLine": "yarn test",
Expand Down
27 changes: 27 additions & 0 deletions packages/plugin-iobroker/src/tools.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { cleanChangelogForNews } from "./tools";

describe("cleanChangelogForNews", () => {
it("removes author names with umlauts", () => {
const input = `
* (Jürgen) Line 1
* (Jérôme) Line 2
* (René) Line 3
* (Burić) Line 4
* (Çoban) Line 5
* (Jörg) Line 6
* (Keßler) Line 7
`.trim();

const expected = `
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
`.trim();

expect(cleanChangelogForNews(input)).toBe(expected);
});
});
2 changes: 1 addition & 1 deletion packages/plugin-iobroker/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function limitKeys<T>(obj: Record<string, T>, count: number): Record<stri
return ret;
}

const changelogAuthorRegex = /^[ \t]*[\*\-][ \t]*\([\p{L}\p{M}0-9@\-_,;&\+\/ ]+\)[ \t]*/gim;
const changelogAuthorRegex = /^[ \t]*[\*\-][ \t]*\([\p{L}\p{M}0-9@\-_,;&\+\/ ]+\)[ \t]*/gimu;
const changelogBulletPointTestRegex = /^[ \t]*[\*\-][ \t]*/;
const changelogBulletPointReplaceRegex = new RegExp(changelogBulletPointTestRegex, "mg");

Expand Down