|
@@ -21,43 +21,6 @@ enum UpdateStatus {
|
|
Downloading = 'downloading',
|
|
Downloading = 'downloading',
|
|
Finished = 'finished',
|
|
Finished = 'finished',
|
|
}
|
|
}
|
|
-const a = `Marked - Markdown Parser
|
|
|
|
-========================
|
|
|
|
-
|
|
|
|
-[Marked] lets you convert [Markdown] into HTML. Markdown is a simple text format whose goal is to be very easy to read and write, even when not converted to HTML. This demo page will let you type anything you like and see how it gets converted. Live. No more waiting around.
|
|
|
|
-
|
|
|
|
-How To Use The Demo
|
|
|
|
--------------------
|
|
|
|
-
|
|
|
|
-1. Type in stuff on the left.
|
|
|
|
-2. See the live updates on the right.
|
|
|
|
-
|
|
|
|
-That's it. Pretty simple. There's also a drop-down option above to switch between various views:
|
|
|
|
-
|
|
|
|
-- **Preview:** A live display of the generated HTML as it would render in a browser.
|
|
|
|
-- **HTML Source:** The generated HTML before your browser makes it pretty.
|
|
|
|
-- **Lexer Data:** What [marked] uses internally, in case you like gory stuff like this.
|
|
|
|
-- **Quick Reference:** A brief run-down of how to format things using markdown.
|
|
|
|
-
|
|
|
|
-Why Markdown?
|
|
|
|
--------------
|
|
|
|
-
|
|
|
|
-It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [markdown] says,
|
|
|
|
-
|
|
|
|
-> The overriding design goal for Markdown's
|
|
|
|
-> formatting syntax is to make it as readable
|
|
|
|
-> as possible. The idea is that a
|
|
|
|
-> Markdown-formatted document should be
|
|
|
|
-> publishable as-is, as plain text, without
|
|
|
|
-> looking like it's been marked up with tags
|
|
|
|
-> or formatting instructions.
|
|
|
|
-
|
|
|
|
-Ready to start writing? Either start changing stuff on the left or
|
|
|
|
-[clear everything](/demo/?text=) with a simple click.
|
|
|
|
-
|
|
|
|
-[Marked]: https://github.com/markedjs/marked/
|
|
|
|
-[Markdown]: http://daringfireball.net/projects/markdown/
|
|
|
|
-`;
|
|
|
|
|
|
|
|
const ReleaseNotes = memo(function ReleaseNotes({ data }: { data: string }) {
|
|
const ReleaseNotes = memo(function ReleaseNotes({ data }: { data: string }) {
|
|
const [html, setHtml] = useState<string>('');
|
|
const [html, setHtml] = useState<string>('');
|
|
@@ -71,7 +34,7 @@ const ReleaseNotes = memo(function ReleaseNotes({ data }: { data: string }) {
|
|
export default function Update() {
|
|
export default function Update() {
|
|
const [query] = useSearchParams();
|
|
const [query] = useSearchParams();
|
|
const version = query.get('version');
|
|
const version = query.get('version');
|
|
- const releaseContent = query.get('releaseContent');
|
|
|
|
|
|
+ const releaseContent = query.get('releaseContent') || '';
|
|
const [status, setStatus] = useState<UpdateStatus>(UpdateStatus.Ready);
|
|
const [status, setStatus] = useState<UpdateStatus>(UpdateStatus.Ready);
|
|
const [progress, setProgress] = useState<number>(0);
|
|
const [progress, setProgress] = useState<number>(0);
|
|
const t = useI18n();
|
|
const t = useI18n();
|
|
@@ -141,7 +104,7 @@ export default function Update() {
|
|
};
|
|
};
|
|
|
|
|
|
return (
|
|
return (
|
|
- <div className='bg-background flex min-h-screen flex-col items-center justify-center px-4 pb-5 pt-7'>
|
|
|
|
|
|
+ <div className='bg-background flex min-h-screen w-screen flex-col items-center justify-center px-4 pb-5 pt-7'>
|
|
<div className='flex w-full flex-1 flex-col rounded-lg bg-white p-5 shadow-xl dark:bg-neutral-800'>
|
|
<div className='flex w-full flex-1 flex-col rounded-lg bg-white p-5 shadow-xl dark:bg-neutral-800'>
|
|
<h1 className='text-foreground mb-3 text-center text-3xl font-bold'>{t('update.title')}</h1>
|
|
<h1 className='text-foreground mb-3 text-center text-3xl font-bold'>{t('update.title')}</h1>
|
|
|
|
|
|
@@ -153,9 +116,12 @@ export default function Update() {
|
|
|
|
|
|
<div className='mb-3 flex flex-1 flex-col'>
|
|
<div className='mb-3 flex flex-1 flex-col'>
|
|
<h2 className='text-foreground mb-3 text-lg font-semibold'>{t('update.changelog')}</h2>
|
|
<h2 className='text-foreground mb-3 text-lg font-semibold'>{t('update.changelog')}</h2>
|
|
- <div className='text-foreground h-[220px] flex-grow-0 list-inside list-disc space-y-2 overflow-y-auto rounded-md p-4 py-3 dark:bg-neutral-700'>
|
|
|
|
- {/* {releaseContent} */}
|
|
|
|
- <ReleaseNotes data={a} />
|
|
|
|
|
|
+ <div className='text-foreground h-[220px] w-full flex-grow-0 list-inside list-disc space-y-2 overflow-y-auto rounded-md p-4 py-3 dark:bg-neutral-700'>
|
|
|
|
+ {releaseContent.split('\n').map((line, index) => (
|
|
|
|
+ <div key={index} className='w-full break-all'>
|
|
|
|
+ {line}
|
|
|
|
+ </div>
|
|
|
|
+ ))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div className='relative w-full'>
|
|
<div className='relative w-full'>
|