Happy Christmas everyone! 🎄

Progress in Selfhosting

Four weeks ago, I mentioned:

Next, before open-sourcing the core service, we still need to complete a few tasks:

  • 1. Enable the core service to host static resources directly...
  • 2. Allow the core service to handle routing requests...
  • 3. Clean up important @TODO items...
  • 4. Write an installation and deployment script...

Items 1 and 2 were completed last weekend, now we can operate without relying on Cloudflare R2 and Worker.

I feel that everything should be ready by next month, and then we can go open source. 🚀

Fixes and Optimizations

Fixing Mathjax Rendering Issues

Quail uses goldmark-mathjax for rendering formulas. However, there's a bug in this package that causes the rendering process to crash.

Haven't had time to pinpoint the exact cause of this issue, so for now, it's just a simple workaround.

Also, due to limitations in Mathjax itself, < and <= can't be used directly in formulas; they need to be replaced with proper \(\latex\) syntax, i.e., \lt or \lte. Please take note of this. 🧮

Atom Feed Rendering Error

Some fields were non-ASCII, and I forgot to wrap them in <![CDATA[ ... ]]>.

The Payment Page Wouldn't Display

This was caused by a lack of synchronization in some states after separating the payment-related logic from the core service. It's been fixed now. 💳

H1 Tags Weren't Recognized in the TOC

In theory, H1 tags shouldn't appear in the body of an article – because a page should only have one H1 tag, which is the title.

However, authors might still input H1 tags, so they need to be processed correctly. This update fixed this issue.

More Languages in Syntax Highlight

Using the highlight.js library, only the syntax of the most common 40 languages was highlighted by default. Some less popular ones weren't supported. Now, we've added support for more languages, covering all non-third-party languages supported by highlight.js, for example:

FROM python:3.10.11-slim-bullseye AS builder
RUN apt-get update && apt-get install -y \
    fonts-wqy-zenhei \
    && rm -rf /var/lib/apt/lists/*

That's the update for this week. 📝🚀