Closed jklewa closed 3 weeks ago
Thank you for the submission and the heads-up. This is worth thinking about, though I’m not convinced of the approach. One important (but fixable) aspect is the code goes against the functional style of the whole script. Seeing as I’d have to maintain this code after merging and that this is in essence a hack (I don’t say that pejoratively), it’s particularly important that it follows the code style and be consistent with the rest of the logic.
While reflecting and experimenting with this, I bumped into an interesting observation. ChatGPT itself doesn’t do this correctly:
Nor does GitHub, for that matter. This (which I had to render render with HTML for demonstration purposes):
```markdown # This is an h1 header Some Python code ```python def inner_function(): print("Inner function") inner_function() ``` Some more text ## An h2 header More text here ```
Becomes:
Which on first glance makes me think this will probably be more complicated than it looks at first glance. Not because of ChatGPT, but GitHub puts a lot of effort into Markdown. And while I appreciate the effort on the fix, I also don’t think it’s the right approach to work around this only on this workflow, because the Text View is generic. It should either be done in Alfred as a whole, or not at all.
I’ll open an issue internally to discuss this, to determine how viable it is. But since you marked this as draft I wanted to let you know sooner rather than later so you wouldn’t spend too much time on it. Although, as always, you’re welcome to use your own changes in your own local installation, as long as those are disclosed when opening bug reports.
Thank you again for the submission, and especially for bringing this to my attention. Have a relaxed Sunday!
Frequently Asked Questions
Workflow version
v2024.17
Alfred version
5.5.1 [2273]
macOS version
Sequoia 15.1 (24B83)
Debugger output
More details
When another code block is nested within a
markdown
code block, Alfred has trouble formatting the output.Alfred's Markdown Syntax doesn't specify how nested code blocks should behave.
This is an excerpt from ChatGPT's response using a prompt similar to "Examples of Markdown":
Current
Updated