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!: html validation: Do not export <style> elements above TOC #613

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

kaushalmodi
Copy link
Owner

@kaushalmodi kaushalmodi commented Apr 6, 2022

<style> elements are not allowed inside

HTML elements. It is
very likely that the TOC + post content would be wrapped in an
<article> element, and in those cases, the HTML Validator will throw
an error like:

Element style not allowed as child of element article in this
context.

The breaking change will be seen only when both toc and section
numbering is enabled. The 'breakage' is visual -- that the numbered
headings in the TOCs will have the unordered list bullets.

To fix it, add this to the CSS:

.toc.has-section-numbers ul {
  list-style: none;
}

<style> elements are not allowed inside <article> HTML elements. It is
very likely that the TOC + post content would be wrapped in an
<article> element, and in those cases, the HTML Validator will throw
an error like:

> Element style not allowed as child of element article in this
> context.

The breaking change will be seen only when both toc and section
numbering is enabled. The 'breakage' is visual -- that the numbered
headings in the TOCs will have the unordered list bullets.

To fix it, add this to the CSS:

    .toc.has-section-numbers ul {
      list-style: none;
    }
@kaushalmodi kaushalmodi merged commit 2f37d27 into main Apr 6, 2022
kaushalmodi added a commit to kaushalmodi/hugo-bare-min-theme that referenced this pull request Apr 6, 2022
kaushalmodi added a commit to kaushalmodi/hugo-onyx-theme that referenced this pull request Apr 6, 2022
rossabaker pushed a commit to rossabaker/cromulent that referenced this pull request Aug 9, 2022
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.

1 participant