getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.12k stars 925 forks source link

bash redirection characters break syntax highlighting #1454

Open johannst opened 3 years ago

johannst commented 3 years ago

Bug Report

Environment

Zola version: 0.13.0

Current Behavior

When including redirection chars {>, <} in a code block of type sh, the syntax highlighting is wrong.

Step to reproduce

Create a code block of type sh and add following snippet:

# abc
foo=1
# cba
foo=1

cat <<EOF
# abc
foo=1
# cba
foo=1
foo=1
# cba
foo=1
foo=1
EOF

cmd < bar
# abc
foo=1
# cba
foo=1
foo=1
# cba
foo=1
foo=1

cmd > bar
# abc
foo=1
# cba
foo=1
foo=1
# cba
foo=1
foo=1

Tested with default and gruvbox-dark theme, this results in the following: zola-13-sh-wrong-syntax-highlight

Keats commented 3 years ago

That looks like an issue in the syntax highlighting itself? Can you try writing that in Sublime and see if it highlights correctly?

johannst commented 3 years ago

Thank you for the quick response.

I just installed sublime3, pasted the snippet and changed the syntax to bash. Here the highlighting looks fine to me.

sublime-3-bash-syntax-highlight

johannst commented 3 years ago

Just a small update, I observed a similar issue in a make code block. Left is Sublime3, right is the rendered html page. make-syntax-highlight