Skip to content

A colon in an !expr block throws an error #152

@thothal

Description

@thothal

I raised an issue on SO I came along when trying to use the !expr syntax in my rmarkdown YAML header.

While this compiles w/o any problem:

navbar:
   - title: !expr Sys.Date()
     href: "#"
     align: right

this throws an error:

navbar:
   - title: !expr format(Sys.Date(), "Created on: %Y-%d-%m")
     href: "#"
     align: right

After some trial and error, I figured that the colon followed by a space : is the culprit, and I found a workaround by replacing the colon by its Unicode representation:

navbar:
   - title: !expr format(Sys.Date(), "Created on\U003A %Y-%d-%m")
     href: "#"
     align: right

The least we can do is to highlight this in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions