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

Too much trailing spacing. #7

Open
artasparks opened this issue Dec 19, 2016 · 2 comments
Open

Too much trailing spacing. #7

artasparks opened this issue Dec 19, 2016 · 2 comments

Comments

@artasparks
Copy link
Contributor

artasparks commented Dec 19, 2016

From a bug report I got via email:

"""
I'm sorry for bothering with such a small thing, but I'm having a little problem with Glift at my personal blog. The space left between the end of the board and the beginning of the text below is too big, and I can't seem to fix it in any ordinary way, ¿so I'm thinking maybe I'm doing something wrong? Please let me know if you know how to fix it.
"""

From debugging, this comes from two extra <p>&nbsp;</p> entries. http://goamateur.tk/

@artasparks
Copy link
Contributor Author

whitespace-bug-report

@dormerod
Copy link
Contributor

With the 'Download SGF' link disabled, it does look like there's too much white space.

A quick fix would be to wrap the spacing paragraph from line 177 with the if statement that follows:

$html =
	"\n\r<div id='$divId' style='$style'></div>".
	"\n\r<script type='text/javascript'>".
	"gliftWidget = glift.create($json);</script>\n\r".
	"<div align ='center'><noscript>$noscript</noscript> ";

	// add a hyperlink to download the SGF if appropriate
	if ( $download && TRUE != $this->nolink )
	$html .= "<p>&nbsp;</p>\n\r<a href='$download' download>$anchor</a>";

	// close the <div> tag and add some white space
	$html .= "</div>\n\r<p>&nbsp;</p>";

But, since the size of the gap depends on the user's stylesheet, it might be better to make trailing whitespace user configurable? On the themes I tested the plugin on, some space is necessary to prevent the next paragraph sitting hard up against the Glift widget.

Also, looking at this again with fresh eyes, we really could remove all the line feeds and carriage returns to make the code more readable. They were somewhat useful for debugging when I was first writing the plugin, but I don't think they add much now.

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

2 participants