diff --git a/parser/metadecoders/decoder.go b/parser/metadecoders/decoder.go index 3f322ad92e4..a65731ae4ca 100644 --- a/parser/metadecoders/decoder.go +++ b/parser/metadecoders/decoder.go @@ -244,7 +244,7 @@ func (d Decoder) unmarshalORG(data []byte, v any) error { } else if k == "tags" || k == "categories" || k == "aliases" { jww.WARN.Printf("Please use '#+%s[]:' notation, automatic conversion is deprecated.", k) frontMatter[k] = strings.Fields(v) - } else if k == "date" { + } else if k == "date" || k == "lastmod" || k == "publishdate" || k == "expirydate" { frontMatter[k] = parseORGDate(v) } else { frontMatter[k] = v diff --git a/parser/metadecoders/decoder_test.go b/parser/metadecoders/decoder_test.go index 590c9fa9e0d..ff6f8c226a0 100644 --- a/parser/metadecoders/decoder_test.go +++ b/parser/metadecoders/decoder_test.go @@ -126,6 +126,9 @@ func TestUnmarshalToInterface(t *testing.T) { {[]byte(nil), JSON, map[string]any{}}, {[]byte(`#+a: b`), ORG, expect}, {[]byte(`#+DATE: <2020-06-26 Fri>`), ORG, map[string]any{"date": "2020-06-26"}}, + {[]byte(`#+LASTMOD: <2020-06-26 Fri>`), ORG, map[string]any{"lastmod": "2020-06-26"}}, + {[]byte(`#+PUBLISHDATE: <2020-06-26 Fri>`), ORG, map[string]any{"publishdate": "2020-06-26"}}, + {[]byte(`#+EXPIRYDATE: <2020-06-26 Fri>`), ORG, map[string]any{"expirydate": "2020-06-26"}}, {[]byte(`a = "b"`), TOML, expect}, {[]byte(`a: "b"`), YAML, expect}, {[]byte(`b`), XML, expect},