Apex just got a couple of useful fixes, and they came straight out of real-world usage.
Where Have I Been?
I’ve had a few people get worried about my lack of activity, but I’m ok. I dropped my MacBook Pro and broke the screen a couple of weeks ago. It took a week to get it fixed, and then I had a week of catching up on all of my projects, so the blog has been a bit neglected. I’m getting back to it now. The next Web Excursions is going to have some cool stuff, and I have a ton of new projects to tell you about.
As part of working on other projects, I’ve been discovering Apex bugs, so I’ve updated it with fixes. I’ve officially bumped to 1.0, and I will be shipping patch releases as needed to clear up additional bugs. The goal is to maintain momentum while tightening the rough edges that only show up once it’s used heavily in day-to-day workflows. Apex has been in development for 5 months now and has turned out to be a really fun and challenging project.
Real work, real feedback
I’ve been using Apex to generate things like the Marked help documentation, which has been a great stress test. That process has surfaced a few bugs, but overall it has been holding up well in an actual production scenario instead of just isolated test cases. Eventually I’ll be switching this blog over to using it and, as promised, I’ll be adding it to Marked 3 to make all syntaxes work without worrying about picking a processor. I have the Ruby and Swift bridges all working, so integrating with Jekyll and macOS/iOS projects should be easy once I fully trust the output. It’s getting very close.
What I’m building with it now
In addition to the Marked documentation, I’m also using Apex to generate the new TerminalWidget site I am working on. More info on that is coming soon, but so far it has been a really good proving ground for parser and output behavior under realistic content. It’s especially been a great chance to flesh out the advanced image tag handling.
A small syntax example from recent fixes
One of the recent fixes focused on image handling when combining modern formats with image attributes:
{:loading=lazy width=400 height=400}
That now behaves as expected in the generated output, including preserving the fallback image attributes. You get a full srcset tag with AVIF variants, ALT text, @2x versions, and attributes, all from one relatively simple Markdown string. The entire TerminalWidget widget gallery is built this way.
Greedy Autolinking
Another issue I’ve run into in multiple cases is that the autolinker tries to turn non-email addresses into mailto: links. This was especially apparent in cases of image@2x.png, which would turn into a mess of a link. I think I’ve fixed this by both avoiding autolinking within an HTML tag, and by detecting @\dx.\w+ and skipping autolinking on that. You can always run with --no-autolink and avoid the issue entirely — in most real-world cases, autolinking is unnecessary. I might make that default to off in the next release, requiring --autolink to enable it.
Swift Package
I’ve been testing the Swift package for Apex as well, and have fixed a lot of issues there. If you’re developing a Markdown app for Mac or iOS and have the free time to test Apex out in a real app, I’d love to get your feedback and bug reports.
Stay tuned for upcoming Marked 3 news (I’ve submitted a final build for release review on the MAS and will release the direct-purchase and Setapp versions at the same time), nvUltra updates (it’s just waiting on Marked 3 right now), TerminalWidget, and a new iOS app I’m working on with Dan Peterson, the original and long-time designer for 1Password.