Skip to content
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

💄 render descriptionShort as markdown, fix DoD link display #2958

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented Nov 28, 2023

This PR renders descriptionShort as markdown and makes sure that DoD links are not underlined and instead retain the style they have site-wide.

I don't know if there is a better way to make sure that links that have the dod-span class are not underlined - @sophiamersmann if you would prefer another way of doing this in CSS then please let me know! 🙏

Copy link
Contributor Author

danyx23 commented Nov 28, 2023

@@ -822,7 +822,11 @@ const KeyDataTable = (props: {
<div className="key-data__title key-data-description-short__title">
{datapageData.title}
</div>
<div>{datapageData.descriptionShort}</div>
<div>
<SimpleMarkdownText
Copy link
Member

Choose a reason for hiding this comment

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

The new renderer by default wraps any text into a paragraph which adds unwanted vertical space. I added an option called useParagraphs for single-liners specifically that – if set to false – disables that beaviour. It would be good to use that here.

<SimpleMarkdownText text={...} useParagraphs={false} />

Copy link
Member

Choose a reason for hiding this comment

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

Or, alternatively, if we expect descriptionShort be have multiple paragraphs, then it would be good to set the p margins to 0 here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know! The ETL guidelines say that this should be a single paragraph so I'll go with useParagraphs=false. Thank you!

@danyx23 danyx23 force-pushed the data-pages-dod-fixes branch from c863d7b to 0d59680 Compare November 28, 2023 14:36
@@ -393,7 +394,7 @@ export class Source extends React.Component<{
<div className="source">
{this.renderTitle()}
{this.def.descriptionShort && (
<p>{this.def.descriptionShort}</p>
<SimpleMarkdownText text={this.def.descriptionShort} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sophiamersmann should we add the useParagraphs stanca here as well then?

Copy link
Member

Choose a reason for hiding this comment

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

Since the old code wraps descriptionShort in a paragraph as well, I would leave it as is here.

Copy link
Contributor Author

danyx23 commented Nov 28, 2023

Merge activity

  • Nov 28, 9:54 AM: @danyx23 started a stack merge that includes this pull request via Graphite.
  • Nov 28, 9:54 AM: @danyx23 merged this pull request with Graphite.

Base automatically changed from data-page-fixes to master November 28, 2023 14:54
@danyx23 danyx23 merged commit 047690b into master Nov 28, 2023
12 checks passed
@danyx23 danyx23 deleted the data-pages-dod-fixes branch November 28, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants