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

Shortcode 'lead' produces invalid HTML #527

Closed
deining opened this issue Apr 20, 2021 · 0 comments · Fixed by #905
Closed

Shortcode 'lead' produces invalid HTML #527

deining opened this issue Apr 20, 2021 · 0 comments · Fixed by #905

Comments

@deining
Copy link
Collaborator

deining commented Apr 20, 2021

Related, but not similar to #526:

<section class="row td-box td-box--{{ $col_id }} position-relative td-box--gradient td-box--height-{{ $height }}">
<div class="container text-center td-arrow-down">
<span class="h4 mb-0">
{{ if eq .Page.File.Ext "md" }}
{{ .Inner | markdownify }}
{{ else }}
{{ .Inner | htmlUnescape | safeHTML }}
{{ end }}
</span>
</div>
</section>

This shortcode is used within https://www.docsy.dev and produces the HTML output below:

<a id="td-block-1" class="td-offset-anchor"></a>
<section class="row td-box td-box--primary position-relative td-box--gradient td-box--height-auto">
	<div class="container text-center td-arrow-down">
		<span class="h4 mb-0">
				<p>Docsy is a theme for the Hugo static site generator that’s specifically designed for technical documentation sets. Our aim is to help you get a working documentation site up and running as easily as possible, so you can concentrate on creating great content for your users.</p>
		</span>
	</div>
</section>

The problem with this code is the fact that the span tag is an inline element and therefore cannot held <p> tags. The above HTML code is therefore invalid.

Possible solution:

I would propose to replace the <span> tag with <div> tag which is a block-level element and can therefore held <p> tags. If desired, I can author a PR for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant