Improved changelog detection
parent
7ce02dce06
commit
48df148289
|
@ -6,7 +6,7 @@ module.exports = Object.freeze({
|
|||
GT_TAGS: "a.tagItem",
|
||||
GT_TITLE: "h1.p-title-value",
|
||||
GT_TITLE_PREFIXES: "h1.p-title-value > a.labelLink > span[dir=\"auto\"]",
|
||||
GT_LAST_CHANGELOG: "div.bbCodeBlock-content > div:first-of-type",
|
||||
GT_LAST_CHANGELOG: "b:contains('Changelog') + br + div > div",
|
||||
GT_JSONLD: "script[type=\"application/ld+json\"]",
|
||||
WT_FILTER_POPUP_BUTTON: "a.filterBar-menuTrigger",
|
||||
WT_NEXT_PAGE: "a.pageNav-jump--next",
|
||||
|
|
|
@ -204,6 +204,11 @@ function extractChangelog(mainPost) {
|
|||
changelog = changelog.replace(/\n+/g, "\n");
|
||||
changelog = changelog.trim();
|
||||
|
||||
// Delete the version at the start of the changelog
|
||||
const firstNewLine = changelog.indexOf("\n");
|
||||
const supposedVersion = changelog.substring(0, firstNewLine);
|
||||
if (supposedVersion[0] === "v") changelog = changelog.substring(firstNewLine).trim();
|
||||
|
||||
// Return changelog
|
||||
return changelog ? changelog : null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue