Skip to content

Commit

Permalink
Adding emoji support
Browse files Browse the repository at this point in the history
- Fixes #163
- Bad because it doubles the size of the codebase, and it breaks hot
module reloading. Decide later on merge.
  • Loading branch information
dessalines committed Jun 1, 2019
1 parent 5161ff4 commit 52ffd96
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 170 deletions.
3 changes: 3 additions & 0 deletions ui/assets/libs/markdown-it-emoji/markdown-it-emoji.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"jwt-decode": "^2.2.0",
"markdown-it": "^8.4.2",
"markdown-it-container": "^2.0.0",
"markdown-it-emoji": "^1.4.0",
"moment": "^2.24.0",
"rxjs": "^6.4.0",
"terser": "^3.17.0"
Expand Down
5 changes: 3 additions & 2 deletions ui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<link rel="shortcut icon" type="image/svg+xml" href="/static/assets/favicon.svg" />
<link rel="apple-touch-icon" href="/static/assets/apple-touch-icon.png" />
<title>Lemmy</title>
<link rel="stylesheet" href="/static/assets/libs/balloon-css/balloon.min.css">
<script src="/static/assets/libs/sortable/sortable.min.js"></script>
<link rel="stylesheet" href="/static/assets/libs/balloon-css/balloon.min.css" type="text/css">
<script src="/static/assets/libs/sortable/sortable.min.js" type="text/javascript"></script>
<script src="/static/assets/libs/markdown-it-emoji/markdown-it-emoji.min.js" type="text/javascript"></script>
</head>

<body>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { UserOperation, Comment, User, SortType, ListingType } from './interfaces';
import * as markdown_it from 'markdown-it';
declare var markdownitEmoji: any;
import * as markdown_it_container from 'markdown-it-container';

export let repoUrl = 'https://github.com/dessalines/lemmy';
Expand Down Expand Up @@ -30,7 +31,7 @@ var md = new markdown_it({
return '</details>\n';
}
}
});
}).use(markdownitEmoji);

export function hotRank(comment: Comment): number {
// Rank = ScaleFactor * sign(Score) * log(1 + abs(Score)) / (Time + 2)^Gravity
Expand Down
Loading

0 comments on commit 52ffd96

Please sign in to comment.