CSSUoB / CSSUoB/cssuob.github.io

Allow YAML string fields to be explicitly quoted when serialising front matter

Đang mở
#938 0 bình luận 0 reaction 1 người được giao Được @gellowg nhận Xem trên GitHub
bug
Ngôn ngữ chính
HTML
Star
29
Fork
44
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
15

Mô tả

I have run into an interoperability issue when a string field contains a value such as a 24-hour time.

For example, if a collection contains:
```
- label: "Start Time"
name: "start_time"
widget: "string"
```

If I enter: `18:30`, decap serialises it as `start_time: 18:30`.

I think Decap correctly treats this as a string. However, Jekyll’s YAML parsing interprets the unquoted value 18:30 using YAML 1.1 sexagesimal notation, resulting in: `1110`.

This means the value is rendered by Jekyll as 1110/1110.0 rather than 18:30.

Quoting the value fixes the issue:
`start_time: "18:30"`

## Expected behaviour
Given: `18:30`, Decap would serialise this to: `start_time: "18:30"`.

## Current behaviour
Decap serialises: `start_time: 18:30`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.