Strikethrough Not Shown in Preview

I’m not positive that this is a bug (maybe it’s a feature request?), so forgive me if this is the wrong forum for it.

When previewing a draft, text that has been struck out using example is not shown with a line through it. So, when previewing the draft, the ~~ is shown before and after the text.

I’d like to see the line through the text when previewed. Is there something I can do to correct his, or is this something the developer needs to add to app so that the <del> tags are used in place of ~~ when building the HTML for the preview?

I suspect that’s because strikeout isn’t part of normal markdown.

Tables aren’t part of the original Markdown syntax, either, but they are rendered perfectly by the Drafts preview.

But strike through is critic markup which might be part of say Github flavored Markdown, but not Multi Markdown or original Markdown whereas tables I think are only not included in original.

Drafts supporting Multi Markdown would explain tables vs. Strike through.

However I did take a very quick look at the Multi Markdown scripting object. It has options to handle critic markup. After setting the critic related attributes to true I set a template tag and specified that in a subsequent HTML preview action. Unfortunately the strike through remained uncensored. Now I only had 2 or 3 mins to try this so I suspect I just misread something.

If no one else picks this up in the mean time I’ll try and take another look later today when I have more than a couple of minutes.

It’s also important to note that the strikethrough is displayed in the editor, so it’s clear that the developer intended for it to be part of Drafts. It’s only when previewing a draft that strikethrough is ignored. I therefore have to believe, until he says otherwise, that the developer intended to support strikethrough (again, he does—in the editor), and the lack of support for it when previewing a draft is a minor oversight that needs to be corrected.



Okay - ignore the critic markup bit from earlier. With a bit more research I’m not convinced that is true … probably just matches where I’ve seen it.

I haven’t been able to force the MMD engine into recognising it except by being heavy handed. Until such time as a solution is published here, the following heavy handed aproach of substituting the tilde pairs for ‘del’ tags should offer an interim solution. You can then modify the intial script based substitution action to include any additional markups that may not be available, but have HTML tags defined or CSS transformations … though you might also want to amend the preview action step as well, in order to support that.

Thanks for looking into it. :slight_smile:

Did you mean for that to be a link? (Maybe the forum isn’t allowing it to be displayed as a link?)

Hmmmm. I guess the forum doesn’t recognise the Drafts action URLs as valid URLS. I’ve posted a few like this where I didn’t think it was worth adding it to the official directory (this one’s hopefully just a temporary workaround) - first time anyone’s mentioned such links not working. :frowning:

Try this link instead. It is to an export of the action as a file.

This is great! Thank you so much for putting this together! I’ve modified your action a bit to add dark/light theme support. I’ve also changed the name to “Dark/Light Preview II” because it’s going to be my go-to for previewing drafts now. Have a look.

Download Dark/Light Preview II

Is there a reason you all aren’t using the Action Directory to share these actions? Just curious. It will allow you update for fixes/changes and have a stable link. If for some reason you don’t want them visible other than here, just make them unlisted. It’s a better way to share since people can preview the content of the action before installing.

I didn’t realize actions could be posted as unlisted for sharing, and I didn’t want to post this one prematurely. Also, as @sylumer said in an earlier comment, we thought this was a temporary workaround. Will you be adding strikethrough to the preview by default (it’s already supported in the editor)?

In the meantime, I’ll post this action publicly in the directory so others can use it. I’ve given @sylumer credit for his code in the script’s comments and in the action’s description.

Here’s the action in the directory.

Ultimately it was a mistake that I shipped the syntax highlighting for strikethrough, as it is. This gets to the fact that I still have a little work to do figuring out how opinionated about Markdown Drafts should be.

Currently, Drafts ships only with MultiMarkdown. MultiMarkdown does not support strikethrough as you are doing it - that is a GitHub Flavored Markdown addition. It does support CriticMarkup for striking - which can be enabled by script for the output, but is off by default and does not syntax highlight.

I’d prefer not to ship multiple Markdown engines like I did in Drafts 4, but will have to assess as we move forward. This will get better once syntax highlighting definitions get opened up for customization down the road so people can better match their preferences.

I’d not realised there was a way to make actions unlisted. Quite a lot of the time the actions I’ve posted for I haven’t really felt were of general use outside of the discussion and so we’re not well placed for the directory. Basically I didn’t want to clutter it with examples and junky tests. I’ll certainly look at the directory and hiding actions as a posting option going forward!

I wonder if this is related to another issue report I’ve just created (or if that one is related to this one?). The behavior there is a little different, with HTML mail messages created using the Mail action displaying strikethrough text as what looks like a subscript. I created the separate issue because maybe it’s not related at all.

Have you considered CommonMark? That community is vibrant and active, though not paritcularly decisive. It’s basically the most inclusive Markdown spec (has GFM and MMD features).

MultiMarkdown uses the ~ tilde notation for superscript…so that’s doing what is expected from MultiMarkdown. It’s really just confusing that I’m syntax highlighting the strikethrough that MultiMarkdown does not support. I’ll do some clean up here in a release soon.

I’ve considered it. I was hoping to stick with just one Markdown engine in Drafts 5, however. I may have to add CommonMark as an option. We’ll see.

Well I mean just do CommonMark—skip the other specs and don’t even offer them as an option (since CommonMark sort of includes the other ones anyways).

MultiMarkdown is far more popular. Many rely on it’s extensions.

1 Like

I am against CommonMark. It does not pass the “un_f**king_believable” test (i.e. italics in the middle of a word).