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

Invisible u-mention links leave large gaps on WordPress #903

Closed
edent opened this issue Dec 24, 2019 · 6 comments
Closed

Invisible u-mention links leave large gaps on WordPress #903

edent opened this issue Dec 24, 2019 · 6 comments

Comments

@edent
Copy link
Contributor

edent commented Dec 24, 2019

(This might be a bit obscure - and please forgive me if I've misunderstood something about the way Webmention works....)

Bridgy has successfully picked up a Twitter reply to my blog post (yay!)

https://brid-gy.appspot.com/comment/twitter/edent/1209420474964496385/1209445040814272513

At the bottom are some links with no content:

<a class="u-mention" href="http://edent.tel/"></a>
<a class="u-mention" href="https://shkspr.mobi/blog/"></a>
<a class="u-mention" href="https://twitter.com/alistair"></a>
<a class="u-mention" href="https://twitter.com/edent"></a>

This causes a large gap at the bottom of the rendered comment:
Screenshot_2019-12-24 My first visit to a hairdresser in a decade

What is the purpose of these links? Assuming they shouldn't be removed, would it be possible to change snarfed/granary@f8b10c6 (Fix for #163) so that they're joined with a space rather than a newline?

(Originally raised as pfefferle/wordpress-semantic-linkbacks#234)

@dshanske
Copy link

To comment... I don't see this in the Bridgy documentation...

@snarfed
Copy link
Owner

snarfed commented Dec 24, 2019

sorry for the trouble, @edent! and nice sleuthing. those u-mention links are a somewhat old way of handling twitter replies. they're bridgy's translation of twitter @-mentions, which are now implicit in twitter replies and gradually fading away, to the indieweb equivalent: a link to your homepage. (the u-mention class is descriptive but not strictly necessary.)

more importantly, i definitely can change bridgy's markup to avoid the line breaks in your wordpress, but i'm reluctant, since whitespace and line breaks in HTML don't (shouldn't) affect rendering, and if i start customizing for one web server, i'll inevitably hear from another one that needs a different customization that conflicts. do you maybe have a plugin that interprets HTML whitespace in comments as meaningful? maybe change that plugin? @dshanske, any ideas?

@edent
Copy link
Contributor Author

edent commented Dec 24, 2019

I think the issue is that WordPress sees the linebreaks in the comments and renders them as <br>.

This is in line with https://indieweb.org/note#Indieweb_whitespace_thinking

I'm using the semantic-linkback plugin, which enters them into the WordPress database with \n.

You are right not to make a major change like this - especially as it might affect others. But given that there is not designed to be anything visible to the user, I don't see what semantic use the \n is over , say &nbsp;

@snarfed
Copy link
Owner

snarfed commented Dec 24, 2019

I'm using the semantic-linkback plugin, which enters them into the WordPress database with \n.

this is probably the problem. cc @dshanske. Bridgy obviously isn't posting a WP comment itself, it's just publishing HTML, in which pure whitespace is not significant. so it sounds like the Semantic Linkbacks plugin shouldn't be converting line breaks in HTML to line breaks in WP comments, since they become meaningful there.

But given that there is not designed to be anything visible to the user, I don't see what semantic use the \n is over , say &nbsp;

you're right! there isn't any. i'd like @dshanske to look at the SL plugin here first, and ideally fix it there, since this is bigger than just a Bridgy issue. if that's not possible for some reason, i'm happy to change Bridgy; i just can't guarantee that that change will survive permanently in the future.

@snarfed
Copy link
Owner

snarfed commented Dec 24, 2019

(btw, i'm all too familiar with https://indieweb.org/note#Indieweb_whitespace_thinking , i've spent a fair amount of time on at least two different implementations across granary, bridgy, and bridgy fed. a key point here is that bridgy's HTML has neither the <br /> substitutions nor white-space:pre-wrap CSS that would indicate that these line breaks are meaningful and should be rendered.)

@snarfed
Copy link
Owner

snarfed commented Jan 13, 2020

tentatively closing, since we seem to all agree on the conclusion that this whitespace in HTML isn't meaningful and shouldn't affect the way receivers render mentions. feel free to reopen if anything changes!

@snarfed snarfed closed this as completed Jan 13, 2020
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

3 participants