CriticMarkup preview blank

This is in regard to an issue posted by @Sealfur in the Marked support site. The CriticMarkup preview is appearing blank, despite python3 being installed on the system.

What I’d like to try is just running the criticmarkup script directly from the command line and seeing what results it outputs. The script is located at:

/Applications/Marked\ 2.app/Contents/Resources/markedcritic.py

(unless you’re running the Setapp version, let me know)

So we’re going to run:

cat PATH | /usr/local/bin/python3 /Applications/Marked\ 2.app/Contents/Resources/markedcritic.py

Substituting the path to your test Markdown file for PATH. You can easily insert the path to your file by dragging the file from Finder to Terminal with the cursor positioned where you want the path inserted.

Let me know what output you get from that.

Ah, this is interesting.[1] It gives me mostly markdown but the CriticMarkup is now rendered in html.

# The CriticMarkup Syntax
  
The CriticMarkup syntax is fairly straightforward. The key thing to remember is that CriticMarkup is processed _before_ any other MultiMarkdown is handled. It's almost like a separate layer on top of the MultiMarkdown syntax.
  
When editing in MultiMarkdown Composer, you can have CriticMarkup syntax flagged in the both the editor pane and the preview window. This will allow you to see changes in the HTML preview.
  
## Deletions from the original text:
  
This is <del class="crit">could be</del> a test.
  
## Additions:
  
This <span style="display:none"></span><ins class="crit">is </ins>a test.
  
## Substitutions:
  
This <del class="crit" data-subout="sub1">isn't</del><ins class="crit" id="sub1">is</ins> a test.
  
## Highlighting:
  
This is a <mark class="crit">test</mark>.
  
## Comments:
  
This is a test<span class="critic criticcomment">What is it a test of?</span>.

(It’s 1am in Melbourne, but I can do any further steps tomorrow.)


  1. Interesting to me, at least. ↩︎

<musings> Thinking about this and it starts to make sense to me. I wonder if I have the process correct:

  • Marked 2 renders Markdown. That’s its job and it does it well.
  • For UI purposes, the Markdown is converted to html so that formatted documents can be viewed on-screen. But the original Markdown is always sitting under there, waiting to be converted to another output format.
  • CriticMarkup is a whole other syntax that needs to be parsed.[1]
  • markedcritic.py processes CriticMarkup before passing the document to the Marked 2 memory. That’s why in the cat output I see the html tags around the proofing changes.
  • But… if markedcritic.py puts out the correct combination of Markdown and inline html, (which, saved as a new file I can view normally in Marked 2) what’s blocking the render in the CriticMarkup view?

Sometimes I wish I’d done CompSci at uni so I could help with things like this. But if you ever need to troubleshoot some CSS, hit me up. </musings>


  1. I note, also, that the original website now just 301s to the toolkit repository. ↩︎

It’s just that, for whatever reason, the script is actually NOT returning the same output you got with ‘cat’. That’s the part I have to figure out.