Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting Infinite Loops #1211

Closed
jswrenn opened this issue Oct 20, 2020 · 4 comments
Closed

Syntax Highlighting Infinite Loops #1211

jswrenn opened this issue Oct 20, 2020 · 4 comments

Comments

@jswrenn
Copy link

jswrenn commented Oct 20, 2020

Bug Report

I've encountered a few instances where attempting to highlight semi-valid syntax fragments causes zola build to never terminate.

Environment

Zola version: 0.11.0

Expected Behavior

The build should complete, although the snippet might be mis-highlighted.

Current Behavior

The build doesn't terminate.

Step to reproduce

This snippet was the latest one to trigger the problem for me:

```javascript
{
  ...

  /* 30 - 14 = 16 seats taken  */
  "seats": "<strong>Maximum Enrollment:</strong> <span class=\"seats_max\">30</span> / <strong>Seats Avail:</strong> <span class=\"seats_avail\">14</span>",
  /* 10 + 5 + 1 = 16 seats taken */
  "regdemog_json": "{\"FY\":10,\"So\":5,\"Oth\":1}",
  /* 16 seats taken */
  "regdemog_html": "<p class=\"enroll_demog\">Current enrollment: 16</p><div class=\"demogchart\"></div><div class=\"demogchartlegend\"><ul><li class=\"pieitem item_fy\">62.50% - First Year</li><li class=\"pieitem item_so\">31.25% - Sophomore</li><li class=\"pieitem item_oth\">6.25% - Other</li></ul></div>"

  ...
}
```
@Keats
Copy link
Collaborator

Keats commented Oct 20, 2020

There's an issue with the js syntax, try to use the ts instead.

@gsurrel
Copy link

gsurrel commented Dec 6, 2020

I got bitten by the same problem: Zola hangs (infinite loop) when there is a JSON code block labeled as JavaScript. It's going through when annotated with ts or json instead.

@Keats
Copy link
Collaborator

Keats commented Dec 6, 2020

I'll try to update the JS syntax for the next release since it seems to be main culprit :/

Keats added a commit that referenced this issue Dec 15, 2020
@Keats
Copy link
Collaborator

Keats commented Jan 9, 2021

Should be fixed now

@Keats Keats closed this as completed Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants