denoland / docland

The documentation generation website for Deno
https://doc.deno.land
MIT License
119 stars 29 forks source link

Internal server error when a fenced code block contains an unknown language. #203

Open jespertheend opened 1 year ago

jespertheend commented 1 year ago

I added 'none' as type to a block of code with tripple backticks:

export class Vec3 {
    /**
     * My beautiful ascii art:
     * ```none
     *    ^ this
     *    |
     *    |
     *    o 170º = 2.9 pi
     *     \
     *      \
     *       V otherVector
     * ```
     * @param {Vec3} otherVector
     */
    angleTo(otherVector) {
        // implementation
    }
}

Without this, vscode was adding undesired syntax highlighting to the fenced code block.

But now doc.deno.land shows an internal server error when trying to see documentation of the class: https://doc.deno.land/https://gist.githubusercontent.com/jespertheend/83585f96c4cc7b940e80be4965966582/raw/d4d10b6efd3a97b052f7dbbaa6debacd6e357b5f/none-comment-class.js/~/Vec3

As a workaround, you can mark the code block as txt: https://doc.deno.land/https://gist.githubusercontent.com/jespertheend/fddd18715535160ad7fa6edb6b3d01b3/raw/8262ccd205a9be83adddb76c082328ed142ee773/txt-comment-class.js/~/Vec3

For some reason this is not an issue outside of classes, it seems like these comments don't support fenced code blocks: https://doc.deno.land/https://gist.githubusercontent.com/jespertheend/1359c87458d4d56b34eb51e9254abad2/raw/3196091001e127a5300ea8162e7b48086f3112df/none-comment-function.js

I think the best approach would be to just treat all unknown languages as txt, but otherwise using txt is a good workaround for now.