forked from mirrors/pronouns.cc
fix: fix some markdown rendering bugs (closes #46)
This commit is contained in:
parent
691711d542
commit
033b9b5904
5 changed files with 30 additions and 25 deletions
|
@ -4,7 +4,8 @@ import sanitize from "sanitize-html";
|
||||||
const md = new MarkdownIt({
|
const md = new MarkdownIt({
|
||||||
html: false,
|
html: false,
|
||||||
breaks: true,
|
breaks: true,
|
||||||
}).disable(["heading", "link", "table"]);
|
linkify: true,
|
||||||
|
}).disable(["heading", "lheading", "link", "table", "blockquote"]);
|
||||||
|
|
||||||
export function renderMarkdown(src: string | null) {
|
export function renderMarkdown(src: string | null) {
|
||||||
return src ? sanitize(md.render(src)) : null;
|
return src ? sanitize(md.render(src)) : null;
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
ModalFooter,
|
ModalFooter,
|
||||||
} from "sveltestrap";
|
} from "sveltestrap";
|
||||||
import FieldCard from "$lib/components/FieldCard.svelte";
|
import FieldCard from "$lib/components/FieldCard.svelte";
|
||||||
import StatusIcon from "$lib/components/StatusIcon.svelte";
|
|
||||||
import PronounLink from "$lib/components/PronounLink.svelte";
|
import PronounLink from "$lib/components/PronounLink.svelte";
|
||||||
import PartialMemberCard from "$lib/components/PartialMemberCard.svelte";
|
import PartialMemberCard from "$lib/components/PartialMemberCard.svelte";
|
||||||
import FallbackImage from "$lib/components/FallbackImage.svelte";
|
import FallbackImage from "$lib/components/FallbackImage.svelte";
|
||||||
|
@ -44,7 +43,7 @@
|
||||||
let memberPage: number = 0;
|
let memberPage: number = 0;
|
||||||
let memberSlice: PartialMember[] = [];
|
let memberSlice: PartialMember[] = [];
|
||||||
$: memberSlice = data.members.slice(memberPage * 20, (memberPage + 1) * 20);
|
$: memberSlice = data.members.slice(memberPage * 20, (memberPage + 1) * 20);
|
||||||
const totalPages = Math.floor(data.members.length / 20) + 1;
|
const totalPages = Math.ceil(data.members.length / 20);
|
||||||
|
|
||||||
const prevPage = () => {
|
const prevPage = () => {
|
||||||
if (memberPage === 0) {
|
if (memberPage === 0) {
|
||||||
|
|
|
@ -456,6 +456,8 @@
|
||||||
rel="noopener noreferrer">Markdown</a
|
rel="noopener noreferrer">Markdown</a
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
|
<hr />
|
||||||
|
{#if bio}
|
||||||
<hr />
|
<hr />
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>Preview</CardHeader>
|
<CardHeader>Preview</CardHeader>
|
||||||
|
@ -463,6 +465,7 @@
|
||||||
{@html renderMarkdown(bio)}
|
{@html renderMarkdown(bio)}
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane tabId="pronouns" tab="Pronouns">
|
<TabPane tabId="pronouns" tab="Pronouns">
|
||||||
|
|
|
@ -384,6 +384,7 @@
|
||||||
rel="noopener noreferrer">Markdown</a
|
rel="noopener noreferrer">Markdown</a
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
|
{#if bio}
|
||||||
<hr />
|
<hr />
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>Preview</CardHeader>
|
<CardHeader>Preview</CardHeader>
|
||||||
|
@ -391,6 +392,7 @@
|
||||||
{@html renderMarkdown(bio)}
|
{@html renderMarkdown(bio)}
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane tabId="pronouns" tab="Pronouns">
|
<TabPane tabId="pronouns" tab="Pronouns">
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
>
|
>
|
||||||
Authentication
|
Authentication
|
||||||
</ListGroupItem>
|
</ListGroupItem>
|
||||||
<!--{#if hasHiddenMembers}-->
|
{#if hasHiddenMembers}
|
||||||
<ListGroupItem
|
<ListGroupItem
|
||||||
tag="a"
|
tag="a"
|
||||||
active={$page.url.pathname === "/settings/members"}
|
active={$page.url.pathname === "/settings/members"}
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
>
|
>
|
||||||
Hidden members
|
Hidden members
|
||||||
</ListGroupItem>
|
</ListGroupItem>
|
||||||
<!--{/if}-->
|
{/if}
|
||||||
{#if data.invitesEnabled}
|
{#if data.invitesEnabled}
|
||||||
<ListGroupItem
|
<ListGroupItem
|
||||||
tag="a"
|
tag="a"
|
||||||
|
|
Loading…
Reference in a new issue