Skip to content

Commit

Permalink
Switch titles to dangerously set innerhtml
Browse files Browse the repository at this point in the history
  • Loading branch information
leomet07 committed Sep 19, 2024
1 parent f9d5816 commit f003477
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions components/ListArticleDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ export default function ListArticleDisplay(props: {
<div className={styles.item_left}>
<p className={styles.department + " discrete-link"}>
<Link
href={`/department/${
DepartmentsArray[article.section_id]
}`}
href={`/department/${DepartmentsArray[article.section_id]
}`}
>
{
DepartmentsArrayDisplay[
article.section_id
article.section_id
]
}
</Link>
Expand All @@ -34,8 +33,8 @@ export default function ListArticleDisplay(props: {
<Link
href={"/article/" + article.slug}
className="discrete-link"
dangerouslySetInnerHTML={{ __html: article.title }}
>
{article.title}
</Link>
</h2>
<div className={styles.authors}>
Expand Down
3 changes: 1 addition & 2 deletions components/MixedArticleDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ function CenterArticle(props: {
<></>
)}
<Link passHref href={"/article/" + article.slug}>
<h2 id={styles.title} className="discrete-link">
{article.title}
<h2 id={styles.title} className="discrete-link" dangerouslySetInnerHTML={{ __html: article.title }}>
</h2>
</Link>
<p
Expand Down
2 changes: 1 addition & 1 deletion pages/article/[article_slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function Article(props: Props) {
{DepartmentsArrayDisplay[section_id]}
</Link>
</p>
<h1 id={styles.title}>{title}</h1>
<h1 id={styles.title} dangerouslySetInnerHTML={{ __html: title }}></h1>
<h2 id={styles.summary}>{summary}</h2>
<h3 id={styles.reading_time}>
{generateApproxReadingTime()}
Expand Down

0 comments on commit f003477

Please sign in to comment.