Skip to content

Commit dd2fff2

Browse files
authored
reference: add refcontent (#139)
Add missing member to reference struct Fixes: #137 Signed-off-by: Miek Gieben <miek@miek.nl>
1 parent ceb0d12 commit dd2fff2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

mast/reference/reference.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ type SeriesInfo struct {
7373

7474
// Reference is the entire <reference> structure.
7575
type Reference struct {
76-
XMLName xml.Name `xml:"reference"`
77-
Anchor string `xml:"anchor,attr"`
78-
Front Front `xml:"front"`
79-
Format *Format `xml:"format,omitempty"`
80-
Target string `xml:"target,attr"`
81-
Series *SeriesInfo `xml:"seriesInfo,omitempty"`
76+
XMLName xml.Name `xml:"reference"`
77+
Anchor string `xml:"anchor,attr"`
78+
Front Front `xml:"front"`
79+
Format *Format `xml:"format,omitempty"`
80+
Target string `xml:"target,attr"`
81+
Series *SeriesInfo `xml:"seriesInfo,omitempty"`
82+
RefContent string `xml:"refcontent"`
8283
}

mast/reference/reference_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ func TestReference(t *testing.T) {
1414
</author>
1515
<date month='February' year='2019'/>
1616
</front>
17+
<refcontent>blah</refcontent>
1718
</reference>
1819
`)
19-
expect := `<reference anchor="IANA" target="https://www.iana.org/assignments/media-types/media-types.xhtml"><front><title>IANA Media Types</title><author><organization>IANA</organization></author><date year="2019" month="February"></date></front></reference>`
20+
expect := `<reference anchor="IANA" target="https://www.iana.org/assignments/media-types/media-types.xhtml"><front><title>IANA Media Types</title><author><organization>IANA</organization></author><date year="2019" month="February"></date></front><refcontent>blah</refcontent></reference>`
2021

2122
var x Reference
2223
if err := xml.Unmarshal(in, &x); err != nil {

0 commit comments

Comments
 (0)