Skip to content

Commit

Permalink
fix special links handler for embedded questions-as-links version
Browse files Browse the repository at this point in the history
  • Loading branch information
Aprillion committed Sep 15, 2023
1 parent 56e321f commit 63acd09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import useDraggable from '~/hooks/useDraggable'
import {getStateEntries} from '~/hooks/stateModifiers'
import Search from '~/components/search'
import {Header, Footer} from '~/components/layouts'
import {Question} from '~/routes/questions/$question'
import {LINK_WITHOUT_DETAILS_CLS, Question} from '~/routes/questions/$question'
import {fetchAnswerDetailsOnSite} from '~/routes/questions/answerDetailsOnSite'
import {Discord} from '~/components/icons-generated'
import InfiniteScroll from '~/components/infiniteScroll'
Expand Down Expand Up @@ -155,7 +155,8 @@ export default function App() {
if (
el.tagName !== 'A' ||
el.closest('.question-footer') ||
el.classList.contains('footnote-backref')
el.classList.contains('footnote-backref') ||
el.classList.contains(LINK_WITHOUT_DETAILS_CLS)
)
return

Expand Down
3 changes: 2 additions & 1 deletion app/routes/questions/$question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Action, ActionType} from '~/routes/questions/actions'
import {reloadInBackgroundIfNeeded} from '~/server-utils/kv-cache'

const UNKNOWN_QUESTION_TITLE = 'Unknown question'
export const LINK_WITHOUT_DETAILS_CLS = 'link-without-details'

export const loader = wrapCORS(async ({request, params}: LoaderArgs) => {
const {question} = params
Expand Down Expand Up @@ -102,7 +103,7 @@ export function Question({
<h2>
<a
href={`https://aisafety.info/?state=${pageid}_`}
className="transparent-link"
className={`transparent-link ${LINK_WITHOUT_DETAILS_CLS}`}
target="_blank"
rel="noreferrer"
>
Expand Down

0 comments on commit 63acd09

Please sign in to comment.