Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pkg/workflow/compiler.go
Outdated
| for _, line := range lines { | ||
| // Check for code block markers (``` or ~~~) | ||
| trimmedLine := strings.TrimSpace(line) | ||
| if strings.HasPrefix(trimmedLine, "```") || strings.HasPrefix(trimmedLine, "~~~") { |
There was a problem hiding this comment.
code blocks may have 3 or more backticks @copilot
There was a problem hiding this comment.
Fixed! Updated the code block detection logic to properly handle code blocks with 3 or more backticks/tildes instead of just exactly 3. Added a new isCodeBlockMarker helper function and comprehensive test coverage for various combinations (4 backticks, 5 tildes, etc.). Commit: 7aee975
… comment) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot match the opening marker for code region with the closing marker. Eg if the closing marker must be the opening marker. |
…erent marker types Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed! Updated the code block matching logic to ensure opening and closing markers match properly. Now `````python |
pkg/workflow/compiler.go
Outdated
| } | ||
| } | ||
| // All characters are backticks | ||
| return marker, count, "" |
There was a problem hiding this comment.
@copilot merge marker,count into returning a string instead
There was a problem hiding this comment.
Updated the extractCodeBlockMarker function to return a single string containing the complete marker (e.g., "```", "~~~~") instead of separate marker character and count values. This simplifies the API and makes the code cleaner. Commit: 53c2139
…BlockMarker Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This PR implements the feature requested in #822 to remove XML comments from the final prompts generated by the Go compiler.
Problem
XML comments (
<!-- -->) are "builtin" comments in markdown and should be removed when rendered to prompts, similar to how HTML rendering engines handle them. This allows developers to keep commented text in workflow markdown files without polluting the final prompt sent to AI engines.Solution
Added XML comment removal functionality to the prompt generation process:
removeXMLCommentsfunction: Removes XML comments while preserving comments that appear within code blocks (``` or ~~~ delimited)Recent Updates
can only be closed by ``````, not by~~~` or different backtick counts)extractCodeBlockMarker,isValidCodeBlockMarker, andisMatchingCodeBlockMarkerfor robust code block boundary detectionExample
Before (in markdown file):
More content here.
More content here.