codeant-ai-for-open-source[bot] commented on code in PR #43722:
URL: https://github.com/apache/superset/pull/43722#discussion_r3896169519
##########
superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx:
##########
@@ -37,7 +37,12 @@ export default function Handlebars(props: HandlebarsProps) {
const handlebarTemplateSource = formData.handlebarsTemplate
? formData.handlebarsTemplate
: '{{data}}';
- const templateSource = `${handlebarTemplateSource}\n${styleTemplateSource} `;
+ // Separate the style block from the template with a blank line. Markdown
+ // treats a template that opens with an HTML tag as a single HTML block that
+ // ends at the first blank line, so without this separator the `<style>` tag
+ // is absorbed into that block and the first blank line inside the CSS closes
+ // it, leaking the remaining rules into the chart as visible text.
+ const templateSource = `${handlebarTemplateSource}\n\n${styleTemplateSource}
`;
Review Comment:
**Suggestion:** When no CSS is configured, this still inserts a blank line,
changing adjacent Markdown lines into separate paragraphs and altering existing
template rendering. [logic error]
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=1ff928f4338d41c287a1b33a9836bb87&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=1ff928f4338d41c287a1b33a9836bb87&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx
**Line:** 45:45
**Comment:**
*Logic Error: When no CSS is configured, this still inserts a blank
line, changing adjacent Markdown lines into separate paragraphs and altering
existing template rendering.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43722&comment_hash=d7f1a97c74c5dd7c18e1ca9802009d332c78db798ba6f8023bd3db0779d58acf&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43722&comment_hash=d7f1a97c74c5dd7c18e1ca9802009d332c78db798ba6f8023bd3db0779d58acf&reaction=dislike'>๐</a>
--
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]