mirror of
https://github.com/LemmyNet/joinlemmy-site.git
synced 2024-11-25 22:01:17 +00:00
Fixing news preview.
This commit is contained in:
parent
bfadf4ebfe
commit
6da2dbb005
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,9 @@ function titleToUrl(title: string): string {
|
||||||
function previewMarkdown(markdown: string): string {
|
function previewMarkdown(markdown: string): string {
|
||||||
return markdown
|
return markdown
|
||||||
.replace(/#/g, "")
|
.replace(/#/g, "")
|
||||||
|
.split(/\n/g)
|
||||||
|
.slice(3)
|
||||||
|
.join("\n")
|
||||||
.replace(/[\n\r]/g, " ")
|
.replace(/[\n\r]/g, " ")
|
||||||
.slice(0, 100)
|
.slice(0, 100)
|
||||||
.concat("...");
|
.concat("...");
|
||||||
|
|
Loading…
Reference in a new issue