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

Fix details triggers that contain markup #1736

Merged
merged 10 commits into from
Aug 31, 2020
Merged

Conversation

rogermparent
Copy link
Contributor

Before, as pointed out here by @jorgeorpinel, any markup like code quotes would break a header as only the first child
had its text extracted. Now, the Collapsible uses the whole children value of the
header it's made from as the trigger text, so anything that can go in a heading can go in a details trigger.

simpleLinker is also changed to not apply to code quotes within headings, partially because of this and also because auto-links in headers feels like it clutters the UX a bit since the same contents will very likely be linked in the following paragraph. I can re-enable this behavior if we find it desirable.

Code quotes in headers are no longer auto-linked by `simpleLinker`, both for UX
and bugfix purposes.

Before, any markup like code quotes would break a header as only the first child
had its text extracted. Now the trigger uses the whole children value of the
header it's made from.
@shcheklein shcheklein temporarily deployed to dvc-landing-fix-details-t4ihvr August 28, 2020 23:58 Inactive
@jorgeorpinel

This comment has been minimized.

@rogermparent

This comment has been minimized.

@shcheklein
Copy link
Member

simpleLinker is also changed to not apply to code quotes within headings, partially because of this and also because auto-links in headers feels like it clutters the UI

it's fine to keep it disabled, looks like no one likes it

Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

@rogermparent looks great, thanks! please take a look at the comments and address them as it makes sense.

This is unrelated to the PR, but while we're ts-linting we may as well
Now it just runs off the first (filtered) child. If that child is a header, it's
assumed the last item of the heading is an auto-link and removed.

Currently, every `details` first child is a heading, and all headings have
auto-links.
This is mostly as an example of this PR's fix working.
@rogermparent rogermparent temporarily deployed to dvc-landing-fix-details-t4ihvr August 31, 2020 15:28 Inactive
Even if the element is a string, the regex test will return false from a
non-string property.
@rogermparent rogermparent temporarily deployed to dvc-landing-fix-details-t4ihvr August 31, 2020 16:02 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-fix-details-t4ihvr August 31, 2020 16:15 Inactive
@rogermparent
Copy link
Contributor Author

All the feedback has been addressed, check out a live example of this working on the preview!

The behavior now throws if the details tag isn't led with a heading like we do everywhere now. This is one of a few possible behaviors we could implement for this situation, but I'm assuming that we want to keep details tag invocations relatively uniform and always topped with a heading.

@@ -7,34 +7,6 @@
alone does.
*/

async function createStaticGithubDataNode(api, fieldData = {}) {
Copy link
Member

Choose a reason for hiding this comment

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

is it unused now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it gets picked up by lint-ts.

Copy link
Member

Choose a reason for hiding this comment

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

hmm ... why didn't it pick it up earlier?

@shcheklein shcheklein merged commit 4a5fb51 into master Aug 31, 2020
@shcheklein shcheklein deleted the fix-details-headers branch February 28, 2021 19:37
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.

3 participants