Skip to content

Commit

Permalink
fix: ul not allowed as child of element span (#158)
Browse files Browse the repository at this point in the history
According to the html5 recommendations the <span> element can
only contain phrasing-content. The <ul> element is not in the list of
phrasing content tags. The html validation engine is enforcing those
rules. You can use a <div> as the container instead.

Reference: https://stackoverflow.com/questions/15823032/validation-error-ul-not-allowed-as-child-of-element-span
  • Loading branch information
yawnbo committed Mar 15, 2024
1 parent df61d0c commit 42e5e11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions _includes/extensions/google-translate.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="google_translate_element" style="display: none;">
</div>

<span class="ct-language">
<div class="ct-language">
<ul class="list-unstyled ct-language-dropdown">
{% for item in translate_langs %}
<li>
Expand All @@ -23,7 +23,7 @@
</li>
{% endfor %}
</ul>
</span>
</div>

<script type="text/javascript">
function googleTranslateElementInit() {
Expand Down
4 changes: 2 additions & 2 deletions _includes/views/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
{%- assign name = 'lang' -%}
{%- include functions.html func='get_value' default='en' -%}
{%- assign lang = return -%}
<span class="page-link">
<div class="page-link" style="display: inline;">
{%- include extensions/google-translate.html -%}
</span>
</div>
{%- endif -%}
</div>
</nav>
Expand Down

0 comments on commit 42e5e11

Please sign in to comment.