Skip to content

rendering bug in code blocks #177

@rsubr

Description

@rsubr

On Perlite v1.6, any code block that has the following syntax is rendered incorrectly. This bug is present regardless of the code block type (text, python, php, sh, bash, yaml, etc).

Input

```
[[ foo | bar ]]
```

Output

bar

This breaks any embedded shell script, YAML, etc.

More examples:

Input

```
until [[ -n grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty" ]] &&
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] &&
[[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]];
```

Output incorrectly rendered:

        until  jq -r ".db_host // empty"`  && \
           jq -r ".redis_cache // empty"`  && \
           jq -r ".redis_queue // empty"` ;

Fix

Used Google Antigravity to vibe code fix perlite/content.php. Preliminary code review looks good to me and all my test cases are passing.

content-php.patch

Thanks @secure-77 as always, pls include this in the next release.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions