-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to search description #132
base: main
Are you sure you want to change the base?
Conversation
<h2 style={{ whiteSpace: "pre-line" }}> | ||
{searchHeader.description.replaceAll("\\n", "\n")} | ||
</h2> | ||
<Markdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Markdown will enable elements here that don't belong, such as lists, tables, and multiple paragraphs. This seems like overkill for the stated problem.
I think a more targeted solution would be to add a searchHeader.descriptionUrl
option. Then this code would conditionally render a link if that option is defined. What do you think of this approach?
const searchHeaderDescription = searchHeader.description.replaceAll("\\n", "\n");
const searchHeaderContent = searchHeader.descriptionUrl ? (
<a href={searchHeader.descriptionUrl}>{searchHeaderDescription}</a>
) : searchHeaderDescription;
return (
<VuiTextColor color="subdued">
<h2 style={{ whiteSpace: "pre-line" }}>
{searchHeaderContent}
</h2>
</VuiTextColor>
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in this way the whole description is a single URL right?
In this case, the idea was to have something like "Created by Bob Gourley (OODA)" where only OODA is a URL linking to Bob's website. Any good way to do that?
I think Markdown can also be useful to do multi-line descriptions that we want to control the line breaks e.g. with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd probably make the whole thing a link or I'd add a location in the UI for rendering some kind of authorship link. I'll approve this PR to unblock you though.
Making the "search_description" be a Markdown component to support a need in one demo to include LINK in that description.