Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #311 from serlo/fix-links
Browse files Browse the repository at this point in the history
fix: Make links point to the correct href in static renderer view and change link strings
  • Loading branch information
kulla authored Dec 20, 2023
2 parents a4b7a16 + 5136b6b commit 5298fe2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/frontend/plugins/create-renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ export function createRenderers(): InitRenderersArgs {
linkRenderer: ({ href, children }: ComponentProps<LinkRenderer>) => {
return (
<>
<Link href={href}>{children}</Link>
<a className="serlo-link" href={href}>
{children}
</a>
</>
)
},
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/serlo-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export function SerloEditor({

const serloLoggedInData = getLoggedInData(Instance.De) as LoggedInData

// HACK: Change strings in link element. Searching or inserting an id is not possible in this integration.
serloLoggedInData.strings.editor.plugins.text.linkOverlay.placeholder =
'https://example.com/'
serloLoggedInData.strings.editor.plugins.text.linkOverlay.inputLabel =
"Gib eine URL inklusive 'https://' ein"

return (
<>
<Head>
Expand Down

1 comment on commit 5298fe2

@vercel
Copy link

@vercel vercel bot commented on 5298fe2 Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.