bito-code-review[bot] commented on PR #43722:
URL: https://github.com/apache/superset/pull/43722#issuecomment-5480980544
<!-- Bito Reply -->
The flagged issue is correct. The current implementation unconditionally
inserts a blank line (`
`) between the template and the style block, even when `styleTemplateSource`
is empty, which can cause unintended formatting changes in the rendered
Markdown.
To resolve this, you should conditionally include the separator only when
`styleTemplateSource` is present. Here is the corrected implementation:
```tsx
const styleTemplateSource = formData.styleTemplate || '';
const separator = styleTemplateSource ? '\n\n' : '';
const templateSource =
`${handlebarTemplateSource}${separator}${styleTemplateSource} `;
```
Would you like me to check the rest of the comments on this PR and implement
fixes for them as well?
**superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx**
```
const styleTemplateSource = formData.styleTemplate || '';
const separator = styleTemplateSource ? '\n\n' : '';
const templateSource =
`${handlebarTemplateSource}${separator}${styleTemplateSource} `;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]