Table of Contents

Class MarkdownParser

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

A small Markdown reader for the long descriptions Modrinth returns.

It is deliberately partial. Those descriptions are Markdown with raw HTML mixed in, written to be rendered by a web page, and pulling in a full Markdown engine (and an HTML sanitiser behind it) to show them in a desktop panel would be a large dependency for a read-only view. What is supported is what those pages actually use: headings, lists, quotes, code, emphasis, links and rules. Everything else — HTML tags, images, scripts — is dropped rather than shown raw, so a project page can never inject markup into the app.

Images are dropped on purpose: the gallery already shows them, and a description with thirty remote images would mean thirty downloads for a page the user may only skim.

public static class MarkdownParser
Inheritance
MarkdownParser
Inherited Members

Fields

MaxCharacters

Descriptions longer than this are cut; the page offers Modrinth for the rest.

public const int MaxCharacters = 20000

Field Value

int

Methods

Parse(string?)

Parses a description into blocks. Null or empty input gives an empty list.

public static IReadOnlyList<MarkdownBlock> Parse(string? markdown)

Parameters

markdown string

Returns

IReadOnlyList<MarkdownBlock>