diff --git a/packages/ui-default/components/editor/index.ts b/packages/ui-default/components/editor/index.ts index 69689b933..10bc5c8aa 100644 --- a/packages/ui-default/components/editor/index.ts +++ b/packages/ui-default/components/editor/index.ts @@ -1,4 +1,5 @@ import _ from 'lodash'; +import Notification from 'vj/components/notification'; import DOMAttachedObject from 'vj/components/DOMAttachedObject'; export const config = { @@ -168,7 +169,16 @@ export default class Editor extends DOMAttachedObject { this.vditor = new Vditor(ele, { ...config, ...this.options, - after: () => resolve(null), + after: () => { + const pos = $(ele).find('button[data-mode="sv"]').get(); + const button = $(''); + button.on('click', (e) => { + Notification.info('You can select this in PreferenceSettings'); + e.preventDefault(); + }); + button.insertAfter(pos); + resolve(null); + }, input(v) { $dom.val(v); $dom.text(v); diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 6051ee278..a7438d83b 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.32.8", + "version": "4.32.9", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", diff --git a/packages/ui-default/setting.yaml b/packages/ui-default/setting.yaml index d53b7e347..cda81e532 100644 --- a/packages/ui-default/setting.yaml +++ b/packages/ui-default/setting.yaml @@ -54,7 +54,7 @@ preferredEditorType: monaco: Monaco Editor family: markdown category: preference - value: monaco + value: sv monacoTheme: type: vs-dark: VS Dark diff --git a/packages/ui-default/templates/components/md_hint.html b/packages/ui-default/templates/components/md_hint.html index cc916360c..a3859a56b 100644 --- a/packages/ui-default/templates/components/md_hint.html +++ b/packages/ui-default/templates/components/md_hint.html @@ -6,7 +6,7 @@
{{ _('Code blocks') }}
```c++
 int main() {
-return 0;
+  return 0;
 }
 ```
{{ _('Inline formulas') }}
@@ -20,13 +20,15 @@ return 0;
{{ _('Images') }}
![{{ _('Description') }}](https://...)
{{ _('Images With Size') }}
-
![{{ _('Description') }}](url = 100x100)
+
![{{ _('Description') }}](url =100x100)
{{ _('Footnote') }}
-
Here is a reference[^1].
+      
Here is a ref[^1].
 
-[^1]: Here is the footnote.
+[^1]: And the footnote.
{{ _('Videos') }}
-
@[video](https://.../file.mp4)
+
@[video](https://.../a.mp4)
+
{{ _('Mention')}}
+
@[](/user/uid)

{{ _('Learn More') }}