mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-12 15:52:39 +10:00
chore(replace md-it): replaced markdown-it with micromark
This commit is contained in:
@ -189,7 +189,7 @@
|
||||
import { InformationCircleIcon } from "@heroicons/vue/20/solid";
|
||||
import { Bars3Icon, TrashIcon } from "@heroicons/vue/16/solid";
|
||||
import type { Game, GameVersion } from "@prisma/client";
|
||||
import markdownit from "markdown-it";
|
||||
import {micromark} from 'micromark';
|
||||
import UploadFileDialog from "~/components/UploadFileDialog.vue";
|
||||
|
||||
definePageMeta({
|
||||
@ -209,8 +209,7 @@ const { game: rawGame, unimportedVersions } = await $fetch(
|
||||
);
|
||||
const game = ref(rawGame);
|
||||
|
||||
const md = markdownit();
|
||||
const descriptionHTML = md.render(game.value?.mDescription ?? "");
|
||||
const descriptionHTML = micromark(game.value?.mDescription ?? "");
|
||||
|
||||
async function updateBannerImage(id: string) {
|
||||
if (game.value.mBannerId == id) return;
|
||||
|
||||
@ -161,7 +161,7 @@ import { PlusIcon } from "@heroicons/vue/20/solid";
|
||||
import { ArrowTopRightOnSquareIcon } from "@heroicons/vue/24/outline";
|
||||
import { StarIcon } from "@heroicons/vue/24/solid";
|
||||
import { Platform, type Game, type GameVersion } from "@prisma/client";
|
||||
import MarkdownIt from "markdown-it";
|
||||
import {micromark} from 'micromark';
|
||||
import moment from "moment";
|
||||
import LinuxLogo from "~/components/icons/LinuxLogo.vue";
|
||||
import WindowsLogo from "~/components/icons/WindowsLogo.vue";
|
||||
@ -176,7 +176,6 @@ const game = await $fetch<Game & { versions: GameVersion[] }>(
|
||||
`/api/v1/games/${gameId}`,
|
||||
{ headers }
|
||||
);
|
||||
const md = MarkdownIt();
|
||||
|
||||
// Preview description (first 30 lines)
|
||||
const showPreview = ref(true);
|
||||
@ -197,9 +196,9 @@ const descriptionSplitIndex = gameDescriptionCharacters.findIndex(
|
||||
const previewDescription = gameDescriptionCharacters
|
||||
.slice(0, descriptionSplitIndex + 1) // Slice a character after
|
||||
.join("");
|
||||
const previewHTML = md.render(previewDescription);
|
||||
const previewHTML = micromark(previewDescription);
|
||||
|
||||
const descriptionHTML = md.render(game.mDescription);
|
||||
const descriptionHTML = micromark(game.mDescription);
|
||||
|
||||
const showReadMore = previewHTML != descriptionHTML;
|
||||
const platforms = game.versions
|
||||
|
||||
Reference in New Issue
Block a user