mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Merge branch 'main' of https://github.com/commagray/lemmy into commagray-main
This commit is contained in:
commit
662efbcb68
2
docs/src/about_guide.md
vendored
2
docs/src/about_guide.md
vendored
@ -35,6 +35,8 @@ Horizontal Rule <br>\--- | Horizontal Rule<br>\*\*\* | Horizontal Rule <br><hr>
|
||||
\`Inline code\` with backticks | |`Inline code` with backticks
|
||||
\`\`\`<br>\# code block <br>print '3 backticks or'<br>print 'indent 4 spaces' <br>\`\`\` | ····\# code block<br>····print '3 backticks or'<br>····print 'indent 4 spaces' | \# code block <br>print '3 backticks or'<br>print 'indent 4 spaces'
|
||||
::: spoiler hidden or nsfw stuff<br>*a bunch of spoilers here*<br>::: | | <details><summary> hidden or nsfw stuff </summary><p><em>a bunch of spoilers here</em></p></details>
|
||||
Some ~subscript~ text | | Some <sub>subscript</sub> text
|
||||
Some ^superscript^ text | | Some <sup>superscript</sup> text
|
||||
|
||||
[CommonMark Tutorial](https://commonmark.org/help/tutorial/)
|
||||
|
||||
|
2
ui/package.json
vendored
2
ui/package.json
vendored
@ -37,6 +37,8 @@
|
||||
"markdown-it": "^10.0.0",
|
||||
"markdown-it-container": "^2.0.0",
|
||||
"markdown-it-emoji": "^1.4.0",
|
||||
"markdown-it-sub": "^1.0.0",
|
||||
"markdown-it-sup": "^1.0.0",
|
||||
"moment": "^2.24.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"prettier": "^2.0.4",
|
||||
|
28
ui/src/components/markdown-textarea.tsx
vendored
28
ui/src/components/markdown-textarea.tsx
vendored
@ -187,6 +187,24 @@ export class MarkdownTextArea extends Component<
|
||||
<use xlinkHref="#icon-italic"></use>
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-sm text-muted"
|
||||
data-tippy-content={i18n.t('subscript')}
|
||||
onClick={linkEvent(this, this.handleInsertSubscript)}
|
||||
>
|
||||
<svg class="icon icon-inline">
|
||||
<use xlinkHref="#icon-subscript"></use>
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-sm text-muted"
|
||||
data-tippy-content={i18n.t('superscript')}
|
||||
onClick={linkEvent(this, this.handleInsertSuperscript)}
|
||||
>
|
||||
<svg class="icon icon-inline">
|
||||
<use xlinkHref="#icon-superscript"></use>
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-sm text-muted"
|
||||
data-tippy-content={i18n.t('link')}
|
||||
@ -469,6 +487,16 @@ export class MarkdownTextArea extends Component<
|
||||
i.simpleInsert('#');
|
||||
}
|
||||
|
||||
handleInsertSubscript(i: MarkdownTextArea, event: any) {
|
||||
event.preventDefault();
|
||||
i.simpleSurround('~');
|
||||
}
|
||||
|
||||
handleInsertSuperscript(i: MarkdownTextArea, event: any) {
|
||||
event.preventDefault();
|
||||
i.simpleSurround('^');
|
||||
}
|
||||
|
||||
simpleInsert(chars: string) {
|
||||
if (!this.state.content) {
|
||||
this.state.content = `${chars} `;
|
||||
|
6
ui/src/components/symbols.tsx
vendored
6
ui/src/components/symbols.tsx
vendored
File diff suppressed because one or more lines are too long
4
ui/src/utils.ts
vendored
4
ui/src/utils.ts
vendored
@ -49,6 +49,8 @@ import { UserService, WebSocketService } from './services';
|
||||
|
||||
import Tribute from 'tributejs/src/Tribute.js';
|
||||
import markdown_it from 'markdown-it';
|
||||
import markdown_it_sub from 'markdown-it-sub';
|
||||
import markdown_it_sup from 'markdown-it-sup';
|
||||
import markdownitEmoji from 'markdown-it-emoji/light';
|
||||
import markdown_it_container from 'markdown-it-container';
|
||||
import emojiShortName from 'emoji-short-name';
|
||||
@ -148,6 +150,8 @@ export const md = new markdown_it({
|
||||
linkify: true,
|
||||
typographer: true,
|
||||
})
|
||||
.use(markdown_it_sub)
|
||||
.use(markdown_it_sup)
|
||||
.use(markdown_it_container, 'spoiler', {
|
||||
validate: function (params: any) {
|
||||
return params.trim().match(/^spoiler\s+(.*)$/);
|
||||
|
2
ui/translations/en.json
vendored
2
ui/translations/en.json
vendored
@ -53,6 +53,8 @@
|
||||
"archive_link": "archive link",
|
||||
"bold": "bold",
|
||||
"italic": "italic",
|
||||
"subscript": "subscript",
|
||||
"superscript": "superscript",
|
||||
"header": "header",
|
||||
"strikethrough": "strikethrough",
|
||||
"quote": "quote",
|
||||
|
10
ui/yarn.lock
vendored
10
ui/yarn.lock
vendored
@ -4317,6 +4317,16 @@ markdown-it-emoji@^1.4.0:
|
||||
resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz#9bee0e9a990a963ba96df6980c4fddb05dfb4dcc"
|
||||
integrity sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=
|
||||
|
||||
markdown-it-sub@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8"
|
||||
integrity sha1-N1/WAm6ufdywEkl/ZBEZXqHjr+g=
|
||||
|
||||
markdown-it-sup@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz#cb9c9ff91a5255ac08f3fd3d63286e15df0a1fc3"
|
||||
integrity sha1-y5yf+RpSVawI8/09YyhuFd8KH8M=
|
||||
|
||||
markdown-it@^10.0.0:
|
||||
version "10.0.0"
|
||||
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-10.0.0.tgz#abfc64f141b1722d663402044e43927f1f50a8dc"
|
||||
|
Loading…
Reference in New Issue
Block a user