-
Notifications
You must be signed in to change notification settings - Fork 171
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
Fix nunjucks view syntax #579
Conversation
src/core/utils.js
Outdated
default: | ||
return fang(filePath) || { | ||
name: name, | ||
mode: 'text', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the issue we're having here, Highlight.js now requires this to be plaintext
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll have a look at this tomorrow.
756c907
to
52f61d3
Compare
fang 2.0.0 has a different return without `mode` field which is expected by fractal. This would require more changes.
36f03be
to
e7f3080
Compare
LGTM, but let's wait for @LeBenLeBen to take a look at it again :) |
@LeBenLeBen could you please take a look and merge if this is fine for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, it properly highlights Nunjucks syntax and the warning about text
reported in #576 is now gone!
Thank you @levito 🙇 |
This makes view panels render templates with the following file extensions in Django mode (official replacement mode for Nunjucks): .nunjucks, .nunjs,. .nunj, .njk, .nj, .jinja, .jinja2, .j2
It removes the
langMap
fromsrc/core/highlighter.js
which worked inconsistently and moves the mapping logic tosrc/core/utils.js
. This makes it work consistently and prevents warnings when using Nunjucks and running fractal or doing a static export.