Skip to content

Commit

Permalink
fix: favicon align and link parser
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Oct 29, 2023
1 parent 20b9fd2 commit a5156a0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/ui/link/MLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const MLink: FC<{

const showRichLink = !!parsedType && !!parsedName

console.log(text || parsedName, 'text || parsedName')
return (
<FloatPopover
as="span"
Expand Down
12 changes: 8 additions & 4 deletions src/components/ui/markdown/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ export const Markdown: FC<MdProps & MarkdownToJSX.Options & PropsWithChildren> =
link: {
react(node, output, state) {
const { target, title } = node
const realText =
node.content[0]?.content === node.target
? void 0
: node.content[0]?.content

let realText = ''

for (const child of node.content) {
if (child.type === 'text') {
realText += child.content
}
}

return (
<MLink
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/rich-link/Favicon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const Favicon: Component<FaviconProps> = (props) => {
if (!prefixToIconMap[nextSource]) return null

return (
<span className={clsxm('mr-1 [&_svg]:inline', className)}>
<span className={clsxm('mr-1 align-text-bottom [&_svg]:inline', className)}>
{prefixToIconMap[nextSource]}
</span>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/rich-link/RichLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const RichLink: FC<{
if (!urlPrefix) return null

return (
<span className="mx-1 inline-flex items-center space-x-1 align-bottom">
<span className="mx-1 inline-flex items-center space-x-1 align-text-bottom">
<Favicon source={source} />
<a
target="_blank"
Expand Down

1 comment on commit a5156a0

@vercel
Copy link

@vercel vercel bot commented on a5156a0 Oct 29, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

shiro – ./

springtide.vercel.app
innei.in
shiro-innei.vercel.app
shiro-git-main-innei.vercel.app

Please sign in to comment.