From 6d0efd09a3b81ab23853aee839e3eaa0e7c3f37d Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Mon, 13 Nov 2023 18:14:58 +0100 Subject: [PATCH] markdown support dropped --- package.json | 5 ---- .../Article/AudioPlayer/PlayerPlaylist.tsx | 5 ++-- src/components/Article/Comment/Comment.tsx | 3 +-- src/components/Article/FullArticle.tsx | 7 ++---- src/components/Article/MD.tsx | 24 ------------------- src/pages/profile/profileSettings.page.tsx | 1 - 6 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 src/components/Article/MD.tsx diff --git a/package.json b/package.json index 080e97c6..2f5c90e0 100644 --- a/package.json +++ b/package.json @@ -118,11 +118,6 @@ "lint-staged": "15.0.2", "loglevel": "1.8.1", "loglevel-plugin-prefix": "0.8.4", - "markdown-it": "13.0.1", - "markdown-it-container": "3.0.0", - "markdown-it-implicit-figures": "0.11.0", - "markdown-it-mark": "3.0.1", - "markdown-it-replace-link": "1.2.0", "nanostores": "0.7.4", "prettier": "3.0.3", "prettier-eslint": "16.1.2", diff --git a/src/components/Article/AudioPlayer/PlayerPlaylist.tsx b/src/components/Article/AudioPlayer/PlayerPlaylist.tsx index 7ce74f36..7f456f8b 100644 --- a/src/components/Article/AudioPlayer/PlayerPlaylist.tsx +++ b/src/components/Article/AudioPlayer/PlayerPlaylist.tsx @@ -6,7 +6,6 @@ import { Popover } from '../../_shared/Popover' import { Icon } from '../../_shared/Icon' import styles from './AudioPlayer.module.scss' import { GrowingTextarea } from '../../_shared/GrowingTextarea' -import MD from '../MD' import { MediaItem } from '../../../pages/types' import SimplifiedEditor from '../../Editor/SimplifiedEditor' @@ -146,12 +145,12 @@ export const PlayerPlaylist = (props: Props) => {
- +
- +
diff --git a/src/components/Article/Comment/Comment.tsx b/src/components/Article/Comment/Comment.tsx index dc43c7ee..4bb7bc2f 100644 --- a/src/components/Article/Comment/Comment.tsx +++ b/src/components/Article/Comment/Comment.tsx @@ -2,7 +2,6 @@ import { Show, createMemo, createSignal, For, lazy, Suspense } from 'solid-js' import { clsx } from 'clsx' import { getPagePath } from '@nanostores/router' -import MD from '../MD' import { Userpic } from '../../Author/Userpic' import { CommentRatingControl } from '../CommentRatingControl' import { CommentDate } from '../CommentDate' @@ -171,7 +170,7 @@ export const Comment = (props: Props) => {
- }> + }> {t('Loading')}

}> { description={m.body} /> - +
)} @@ -329,9 +328,7 @@ export const FullArticle = (props: Props) => {
- }> - - +
diff --git a/src/components/Article/MD.tsx b/src/components/Article/MD.tsx deleted file mode 100644 index 4dd6cd9c..00000000 --- a/src/components/Article/MD.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import MD from 'markdown-it' -import mdfig from 'markdown-it-implicit-figures' -import mdmark from 'markdown-it-mark' -import mdcustom from 'markdown-it-container' -import mdlinks from 'markdown-it-replace-link' -import { createMemo } from 'solid-js' - -const mit = MD({ - html: true, - linkify: true, - typographer: true -}) -mit.use(mdmark) -mit.use(mdcustom) -mit.use(mdfig, { - dataType: false, //
- figcaption: true //
alternative text
-}) -mit.use(mdlinks) - -export default (props: { body: string }) => { - const body = createMemo(() => (props.body.startsWith('<') ? props.body : mit.render(props.body))) - return
-} diff --git a/src/pages/profile/profileSettings.page.tsx b/src/pages/profile/profileSettings.page.tsx index 991892c7..fc1c51cb 100644 --- a/src/pages/profile/profileSettings.page.tsx +++ b/src/pages/profile/profileSettings.page.tsx @@ -11,7 +11,6 @@ import { useSession } from '../../context/session' import FloatingPanel from '../../components/_shared/FloatingPanel/FloatingPanel' import { useSnackbar } from '../../context/snackbar' import { useLocalize } from '../../context/localize' -import { Userpic } from '../../components/Author/Userpic' import { createStore } from 'solid-js/store' import { clone } from '../../utils/clone' import SimplifiedEditor from '../../components/Editor/SimplifiedEditor'