Jump to content

Markdown Transform — Convert Markdown to BBCode, HTML, and RTF


Recommended Posts

I'd love to make this work but I think I must be missing something...

I'm on an M1 Macbook Pro - I set up hotkeys but when i use them I just here a sound effect after a couple of seconds and a link to the original file is on my clipboard. I don't see a new HTML or RTF file anywhere?

 

Thanks

911424898_Screenshot2022-07-04at18_19.18@2x.thumb.jpg.0117d81b725bfebb39627a3b4cfd994d.jpg

 

 

 

Link to comment
1 hour ago, vitor said:

@alfredpanda The Workflow works on selected text, not files. I guess I can add a File Action too, if you need it specifically. No ETA, though it shouldn’t happen too far off. It will make the Workflow require Alfred 5, since the Read File Contents Automation Task is ideal for it.

Ah I'm sorry for misunderstanding.

 

Files would be great! There are tools that export to .md - I would love to batch convert those to .rtf, .html or .txt to be able to import into Apple Notes.

Link to comment

I’m thinking of converting the files and saving the result to the clipboard, like it currently works. Saving the results to files is a different case, because there’s the whole matter of where to save them with which name, and whatnot.


But with that in, you can make your own short Workflow to save the clipboard contents to whatever file you want with a Write File Output.

Link to comment
  • 1 year later...

Nothing has changed in quite a while, and I use it every day with zero issues. I also don’t have any other problem reports from anyone else. A debugger output is necessary to start determining what could be happening, as well as the macOS and Alfred versions. No doubt the cause will be external (e.g. a faulty version of multimarkdown) since the workflow hasn’t changed.

Link to comment
On 7/7/2023 at 9:01 PM, vitor said:

Nothing has changed in quite a while, and I use it every day with zero issues. I also don’t have any other problem reports from anyone else. A debugger output is necessary to start determining what could be happening, as well as the macOS and Alfred versions. No doubt the cause will be external (e.g. a faulty version of multimarkdown) since the workflow hasn’t changed.

 

The issue is intermittent so when I face it I don't have the debugger activated. If I find something useful I'll bring it here, but it's likely related to my environment.

Edited by xilopaint
Link to comment

There are no plans to make it work in reverse. Supporting the conversion to BBCode and RTF is complicated enough as it is, and those can’t be reversed anyway because the output has custom styling to fix common issues.

Link to comment
  • vitor changed the title to Markdown Transform — Convert Markdown to BBCode, HTML, and RTF
  • 5 weeks later...

@vitor There seems to be an issue specific to the forum where converting Markdown to BBCode doesn't fully replace the text if the converted text isn't at the beginning of a line. I just noticed it today, it only seems to happen in the main reply box of the forum.

Converting markdown on its own:

[background=#eee][font=courier,monospace]markdown[/font][/background]

 

Converting markdown with a space in front:

[background=#eee][font=courier,monospace]markdown[/font][/background]`markdown`

 

Link to comment

Weird, I cannot reproduce that. First, please try it with 2024.3, just released. If you can still reproduce that, please reply with a code block with the exact text that you can reproduce with (asking for a code block so we know it’s exactly as intended).

Link to comment

I updated to 2024.3. After some further testing, it seems browser dependent. I'm only having the issue in Firefox, which for me currently version 131.0.2. Other apps seem fine.

 

At the beginning of the line, it's what I expect:

`markdown`
[background=#eee][font=courier,monospace]markdown[/font][/background]

 

With a space in front, it's not:

 `markdown`
 [background=#eee][font=courier,monospace]markdown[/font][/background]`markdown`

 

Edited by FireFingers21
Link to comment

In Firefox:

[15:34:08.067] Logging Started...
[15:34:42.157] Markdown Transform[Universal Action] Processing complete
[15:34:42.169] Markdown Transform[Universal Action] Passing output '`markdown`' to Arg and Vars
[15:34:42.170] Markdown Transform[Arg and Vars] Processing complete
[15:34:42.174] Markdown Transform[Arg and Vars] Passing output '`markdown`' to Run Script
[15:34:42.247] Markdown Transform[Run Script] Processing complete
[15:34:42.254] Markdown Transform[Run Script] Passing output '<p><code>markdown</code></p>
' to Conditional
[15:34:42.255] Markdown Transform[Conditional] Processing complete
[15:34:42.261] Markdown Transform[Conditional] Passing output '<p><code>markdown</code></p>
' to Run Script
[15:34:42.340] Markdown Transform[Run Script] Processing complete
[15:34:42.352] Markdown Transform[Run Script] Passing output '<p><code>markdown</code></p>

' to Run Script
[15:34:42.381] Markdown Transform[Run Script] Processing complete
[15:34:42.391] Markdown Transform[Run Script] Passing output '[background=#eee][font=courier,monospace]markdown[/font][/background]






' to Transform
[15:34:42.394] Markdown Transform[Transform] Processing complete
[15:34:42.395] Markdown Transform[Transform] Passing output '[background=#eee][font=courier,monospace]markdown[/font][/background]' to Run Script
[15:34:42.449] Markdown Transform[Run Script] Processing complete
[15:34:42.458] Markdown Transform[Run Script] Passing output '' to Dispatch Key Combo

 

And in Safari:

[15:36:59.915] Logging Started...
[15:37:10.409] Markdown Transform[Universal Action] Processing complete
[15:37:10.418] Markdown Transform[Universal Action] Passing output '`markdown`' to Arg and Vars
[15:37:10.420] Markdown Transform[Arg and Vars] Processing complete
[15:37:10.420] Markdown Transform[Arg and Vars] Passing output '`markdown`' to Run Script
[15:37:10.490] Markdown Transform[Run Script] Processing complete
[15:37:10.500] Markdown Transform[Run Script] Passing output '<p><code>markdown</code></p>
' to Conditional
[15:37:10.502] Markdown Transform[Conditional] Processing complete
[15:37:10.503] Markdown Transform[Conditional] Passing output '<p><code>markdown</code></p>
' to Run Script
[15:37:10.526] Markdown Transform[Run Script] Processing complete
[15:37:10.533] Markdown Transform[Run Script] Passing output '<p><code>markdown</code></p>

' to Run Script
[15:37:10.561] Markdown Transform[Run Script] Processing complete
[15:37:10.567] Markdown Transform[Run Script] Passing output '[background=#eee][font=courier,monospace]markdown[/font][/background]






' to Transform
[15:37:10.569] Markdown Transform[Transform] Processing complete
[15:37:10.570] Markdown Transform[Transform] Passing output '[background=#eee][font=courier,monospace]markdown[/font][/background]' to Run Script
[15:37:10.609] Markdown Transform[Run Script] Processing complete
[15:37:10.616] Markdown Transform[Run Script] Passing output '' to Dispatch Key Combo

 

Link to comment

The debugger in the Firefox case shows everything correctly, meaning the workflow is functioning as intended. In your previous examples we can see it pastes the correct conversion and the original text, which suggests to me that what might be happening is:

  1. Alfred triggers a copy (⌘C).
  2. Firefox, for some reason, is deselecting the text.
  3. The text is pasted.

That would explain what you see. Question being: why is Firefox doing it? Have you tried in other text fields outside the forum?


Also, I decided to test it on Firefox on the forum and still cannot reproduce. I’m on 15.0.1. If you're on an older macOS, might be worth upgrading to check. Otherwise, since I was unable to force it, unsure what else to check for.

Link to comment

I've tried different text fields both within the forum and elsewhere. The text field I'm currently typing in is the only one I've been able to produce the issue. I'm running 15.0.1 as well. I restarted both Firefox and macOS to no avail. I've even tried private browsing with all extensions disabled.

 

I'll play around with the issue a bit more, but at this point I'm inclined to just wait and see if an update rolls around and makes it go away. It's not a huge issue, but I'll report back if I notice any changes

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...