Skip to content

Commit 3ecaf74

Browse files
committed
Jerry-Z07.WindBoard: Fix release notes parsing
1 parent 8fde3b6 commit 3ecaf74

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tasks/Jerry-Z07.WindBoard/Script.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ switch -Regex ($this.Check()) {
2929
if (-not [string]::IsNullOrWhiteSpace($Object1.body)) {
3030
$ReleaseNotesObject = $Object1.body | Convert-MarkdownToHtml -Extensions 'advanced', 'emojis', 'hardlinebreak'
3131

32-
$ReleaseNotesTitleNode = $ReleaseNotesObject.SelectNodes('./h1|./h2|./h3').Where({ $_.InnerText -notmatch "[${CJK}]" }, 'First')
33-
$ReleaseNotesCNTitleNode = $ReleaseNotesObject.SelectNodes('./h1|./h2|./h3').Where({ $_.InnerText -match "[${CJK}]" }, 'First')
32+
$ReleaseNotesTitleNode = $ReleaseNotesObject.SelectNodes('./h1').Where({ $_.InnerText -notmatch "[${CJK}]" }, 'First')
33+
$ReleaseNotesCNTitleNode = $ReleaseNotesObject.SelectNodes('./h1').Where({ $_.InnerText -match "[${CJK}]" }, 'First')
3434
if ($ReleaseNotesTitleNode -and $ReleaseNotesCNTitleNode) {
35-
$ReleaseNotesNodes = for ($Node = $ReleaseNotesTitleNode[0].NextSibling; $Node -and $Node.Name -notin @('h1', 'h2'); $Node = $Node.NextSibling) { $Node }
35+
$ReleaseNotesNodes = for ($Node = $ReleaseNotesTitleNode[0].NextSibling; $Node -and $Node.Name -ne 'hr'; $Node = $Node.NextSibling) { $Node }
3636
# ReleaseNotes (en-US)
3737
$this.CurrentState.Locale += [ordered]@{
3838
Locale = 'en-US'
3939
Key = 'ReleaseNotes'
4040
Value = $ReleaseNotesNodes | Get-TextContent | Format-Text
4141
}
4242

43-
$ReleaseNotesCNNodes = for ($Node = $ReleaseNotesCNTitleNode[0].NextSibling; $Node -and $Node.Name -notin @('h1', 'h2'); $Node = $Node.NextSibling) { $Node }
43+
$ReleaseNotesCNNodes = for ($Node = $ReleaseNotesCNTitleNode[0].NextSibling; $Node -and $Node.Name -ne 'hr'; $Node = $Node.NextSibling) { $Node }
4444
# ReleaseNotes (zh-CN)
4545
$this.CurrentState.Locale += [ordered]@{
4646
Locale = 'zh-CN'

0 commit comments

Comments
 (0)