Custom preprocessor fails to load
As suggested elsewhere in these discussions I'm trying to enable emoji support via a custom preprocessor.
Anytime I enable the preprocessor option Marked hangs on the
There is never any output in the "Custom Processor Log", the Debug Log shows the following:
> 2021/01/20 21:21:00:606 | ===> UTI found for test.md: net.daringfireball.markdown > 2021/01/20 21:21:00:652 | Processing document [2021-01-21 05:21:00 +0000] > 2021/01/20 21:21:00:652 | file:///Users/smee/Desktop/test.md opened with encoding 4 > 2021/01/20 21:21:00:652 | Loading test.md succeeded > 2021/01/20 21:21:00:652 | Checking for includes > 2021/01/20 21:21:00:652 | Extracting scrippets > 2021/01/20 21:21:00:654 | Extracted 0 scrippets > 2021/01/20 21:21:00:654 | Inserting included files (processed) from file:///Users/smee/Desktop/ > 2021/01/20 21:21:00:664 | Executable is available > 2021/01/20 21:21:00:664 | Processing using custom preprocessor > 2021/01/20 21:21:00:664 | Launching pre-render task
I seem to get the same result regardless of my preprocessor, even
/bin/cat causes the same result.
This is my first stab at this, so it's not unlikely I've completely missed something. Any help would be much appreciated
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by Brett on 21 Jan, 2021 11:55 AM
First, please include the results of Help->Report an Issue, as that will answer some of the initial questions I have.
First questions, though: if you run a ‘cat file.md|yourscript.ah’ on the command line, do you get the expected result?
Does your script have a shebang at the top?
Is your script set to executable permissions?
Answer those for me (or ask for further clarification if needed) and we’ll try to figure it out.
Might also help to attach the script itself so I can test on my end.
As a final note, I’ll mention that I just added emoji support, it will be in the next update :).
2 Posted by Jake W on 21 Jan, 2021 06:26 PM
Thanks for your reply Brett!
Yes, when I run
cat file.md|myscript.shI get the expected result.
In following the instructions for the "Report an Issue" and trying to build a reproduction I can include I may have stumbled on my issue. The test file I had picked was the output of a script I was working on and yesterday I didn't notice that it was quite a large file.
My preprocessor works fine when I open smaller files.
I've included my configuration, my script, and a test file which will trigger this issue. If you remove one character from the test file it will process normally. (edit: I couldn't attach my files so I created a Gist instead.)
I went ahead with these questions in case it's helpful, however knowing it's a file size issue I can easily work around this and look forward to the next update with native emoji support.
Thanks again for the quick reply, and thanks for Marked, it's such an excellent app.
// Configuration (do not edit) Marked 2 1010 (Direct)
macOS Version: 10.15.7
defaultProcessor: Discount (GFM)
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
Support Staff 3 Posted by Brett on 21 Jan, 2021 08:49 PM
Ok, I can get the same "loading" hang using your script and test files.
It's weird because the file loads fine without the preprocessor (or with
any of my usual preprocessors). On the command line your script does
exactly what it's supposed to do, and without any delay. I'm not sure
what's choking the process up... I'll look into it further.