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

Adding socialite widgets to the page produce html-code with errors #21

Open
N0rbert opened this issue Mar 1, 2020 · 0 comments
Open

Comments

@N0rbert
Copy link

N0rbert commented Mar 1, 2020

Steps to reproduce:

  1. Have latest dokuwiki installed

  2. Have latest dokuwiki-plugin-socialite installed

  3. Add ~~socialite~~ tag to the page

  4. Validate the page with https://validator.w3.org

  5. Get error:

    Error: No p element in scope but a p end tag seen.
    From line 88, column 1; to line 88, column 4
    /li></ul>↩</p>↩↩↩↩

Why this happens and how to fix?
We need to change

<p>
	<ul class="socialite">
		<li class="icon"><a class="vk" target="_blank" href="...">Vk</a></li>
		<li class="icon"><a class="telegram" target="_blank" href="...">Telegram</a></li>
		<li class="icon"><a class="facebook" target="_blank" href="...">Facebook</a></li>
		<li class="icon"><a class="twitter" target="_blank" href="...">Twitter</a></li>
	</ul>
</p>

to

	<ul class="socialite">
		<li class="icon"><a class="vk" target="_blank" href="...">Vk</a></li>
		<li class="icon"><a class="telegram" target="_blank" href="...">Telegram</a></li>
		<li class="icon"><a class="facebook" target="_blank" href="...">Facebook</a></li>
		<li class="icon"><a class="twitter" target="_blank" href="...">Twitter</a></li>
	</ul>

On my local wiki I solved this by fixing <p> tags with patch below:

--- /tmp/dokuwiki-plugin-socialite/
+++ /var/www/dokuwiki/lib/plugins/socialite/syntax/button.php
@@ -93,13 +93,13 @@
             $display = $this->getConf('display') ;
         }
 
-        $renderer->doc .= '<ul class="socialite">';
+        $renderer->doc .= '</p><ul class="socialite">';
         foreach ($data['networks'] as $network) {
             if (in_array($network, $valid_networks)) {
                 $renderer->doc .= $this->socialite_button($display, $network);
             }
         }
-        $renderer->doc .= '</ul>';
+        $renderer->doc .= '</ul><p>';
 
         return true;
     }

Note: the validation problem is also exists on your demo page - check https://validator.w3.org/nu/?doc=https%3A%2F%2Fservidordebian.org%2Fen%2Fblog%2F2015%2F08_24_dokuwiki-plugin-socialite .

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

No branches or pull requests

1 participant