-
Notifications
You must be signed in to change notification settings - Fork 19
Fix ineffective parseMustache option
#111
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
Conversation
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.
Pull Request Overview
This PR fixes the issue with the mustache parsing option not being respected, and improves code readability and linting in the related modules.
- Updates the falsy check for the parseMustache configuration to correctly disable mustache parsing.
- Introduces a token extraction check to skip rendering when no mustache tokens are found.
- Refactors code in the HTML editor to use a clearer undefined check.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/mssql.js | Corrects parseMustache logic and refactors token extraction control flow. |
| src/mssql.html | Improves the undefined check for parseMustache in the editor. |
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.
Pull Request Overview
This PR fixes the issue preventing the disabling of mustache parsing by correcting the falsy check while also tidying up the code.
- Fixed falsy check for the mustache parsing configuration.
- Added an auto-skip for mustache rendering if no tokens are found.
- Improved code tidiness and linting.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/mssql.js | Updated falsy check for mustache parsing and token handling. |
| src/mssql.html | Revised undefined check for parseMustache in the editor UI. |
Comments suppressed due to low confidence (2)
src/mssql.js:499
- [nitpick] The corrected falsy check for config.parseMustache now properly respects explicit false values. Verify that other falsy inputs (e.g., null or 0) are intended to enable mustache parsing.
node.parseMustache = !(config.parseMustache === false || config.parseMustache === 'false'); // if not explicitly set to false, then enable mustache parsing
src/mssql.html:420
- [nitpick] Using 'typeof' to safely check for undefined enhances robustness over direct undefined comparisons.
if (typeof node.parseMustache === 'undefined') {
|
@bestlong please review & merge ASAP |
The new option to disable mustache parsing did not work due to an incorrect falsy check.
This PR does:
parseMustacheis respected