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

Lift AbstractString type restriction on summary arg of details #295

Closed
genericallyterrible opened this issue Feb 22, 2024 · 2 comments · Fixed by #296
Closed

Lift AbstractString type restriction on summary arg of details #295

genericallyterrible opened this issue Feb 22, 2024 · 2 comments · Fixed by #296

Comments

@genericallyterrible
Copy link
Contributor

summary was initially restricted to AbstractString to ensure good default behavior. Non-inline elements would easily create undesirable results an end-user could not remedy other than to only use string-like objects. Here is an example with a long heading:

image

Even MDN demonstrates this issue:

image

The restriction of only plain string content within <summary> elements is not one enforced by specification and so should be removed, provided an updated implementation can deliver a good default behavior for most simple cases.

Inspired: #290 (comment)

@rgouveiamendes
Copy link

If this helps, for Markdown I somehow got a solution with a pretty straightforward CSS trick:

pluto-output summary > .markdown {
		display:inline-flex;
		max-width:98%;
	}

(see for example here.)

@genericallyterrible
Copy link
Contributor Author

Ended up adding a simple div wrapper for non-string values with this set of styles:

pluto-output div.summary-title {
	display: inline-block;
	width: calc(100% - 1em);
	margin-left: -1em;
	padding-left: 1em;
}

@fonsp fonsp closed this as completed in #296 Mar 4, 2024
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 a pull request may close this issue.

2 participants