github / github/pages-gem

Inconsistent behaviour with tags including special characters that are not escaped by quotes defined in an array

Open
#698 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
1.9k
Forks
360
PR merge metrics
No merged PRs in 30d

Description

### Before submitting an issue, please be sure to

- [x] Read [the contributing instructions](https://github.com/github/pages-gem/blob/master/docs/CONTRIBUTING.md#contributing-to-the-github-pages-gem)
- [x] Update to the latest Gem version (run `bundle update github-pages`)

### This issue affects

- [x] The site generated by GitHub Pages
- [ ] Building sites locally

*The GitHub Pages Gem is intended to help users replicate the GitHub Pages build environment locally. If your issue affects both the hosted version and the version previewed locally, you may be better suited reporting [seeking support in other forums](https://github.com/github/pages-gem/blob/master/docs/SUPPORT.md).*

### What did you do (e.g., steps to reproduce)

In post front-matter, I did not surround tag containing `?` with quotation marks in an array. This worked locally, however, GitHub Pages silently ignored these posts, without raising any error.

I'm not sure if other non-alphanumeric characters will cause the same behaviour (`!` worked fine). It's not clear which characters are considered special.

It doesn't matter whether it's `tag:` or `tags:`, but seem to only happen when an array is used.

What didn't work:

```yaml
---
layout: default
title: Will it work? No Quotes
tag: [but-why?]
---
```

What worked:

```yaml
---
layout: default
title: Will it work? No Question Mark in Tag
tag: [but-why]
---
```

```yaml
---
layout: default
title: Will it work? Quotes in Tag
tag: ["but-why?"]
---
```

### What did you expect to happen?

All three front-matter successfully generated pages locally, but only the first two were built by GitHub Pages.

Locally generated index:
```
Will it work? Quotes in Tag

Will it work? No Question Mark in Tag

Will it work? No Quotes
```

### What happened instead?

Index on GitHub Pages:
```
Will it work? Quotes in Tag

Will it work? No Question Mark in Tag
```

Interestingly, when viewing the markdown file of post that was ignored on GitHub, the front-matter is formatted as a code block instead of the usual table.

1

With quotation marks:
2

### Additional information

MWE:

* Link to the live site (if applicable): https://weixuanz.github.io/ghpages-test/
* Link to the source repo (if applicable): https://github.com/WeixuanZ/ghpages-test

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.