Ocelot-Social-Community / Ocelot-Social

Free and open-source social network for active citizenship.
https://ocelot.social
Other
95 stars 38 forks source link

🐛 [Bug] Hashtags - one line after an embed no hashtags are recognized #1937

Closed Tirokk closed 4 years ago

Tirokk commented 4 years ago

ogerly Authored by ogerly Closed

:bug: Bugreport

Steps to reproduce the behavior

  1. create a new contribution

  2. write a #hashtag about it

  3. bind a youtube video on https://www.youtube.com/watch?v=P0_YVKkUJXA

  4. write a #hashtag on the next line after the embed ( doesn't work)

  5. write a #hashtag on the second following line (works)

FireShot Capture 096 - Die Macht um Acht (37) - Human Connection - alpha human-connection org

  1. go to edit contribution
  2. go with the cursor to the #hashtags which didn't work
  3. now they should be selectable, respectively they should work
  4. save the edited post (now all #hashtags go )

FireShot Capture 097 - Die Macht um Acht (37) - Human Connection - alpha human-connection org

Expected behavior

a hashtag should also work on the first following line of an embed

Contribution

https://alpha.human-connection.org/post/6901630c-657a-4f74-94e7-e8274cbc8f47/die-macht-um-acht-37

Tirokk commented 4 years ago

MarcoBomfim Authored by MarcoBomfim


Can I take this one? I've managed to replicate the issue, and as you can see from the screenshot...

Screen Shot 2019-10-25 at 12.32.45.jpg

This is happening because the Video component is being created inside the same paragraph tag, instead of its own. Thus, when we try adding a new tag, it ignores it, since it thinks there is already a hashtag on this block.

I'm not sure, but I think we have two alternatives here:

This might happen to other components as well, but I've been away for quite some time, and a lot has changed since.

Tirokk commented 4 years ago

sushidave Authored by sushidave


@MarcoBomfim

Thank you for contributing to this project!

This also happens with mentions after embeds.

Absolutely. In HTML, a DIV tag inside a P tag is semantically incorrect. In the W3C specs it says about P elements that "It cannot contain block-level elements (including P itself).", see https://www.w3.org/TR/html401/struct/text.html#h-9.3.1.

So the solution would be the separation: Closing the P element of the text before opening the DIV block for the embed.

Tirokk commented 4 years ago

MarcoBomfim Authored by MarcoBomfim


Good to have confirmation, actually! I'll start working on it, then.

Tirokk commented 4 years ago

datenbrei Authored by datenbrei


Hi guys. There seem to be a lot of other HTML issues. I checked our output with some validators and there had been lots of issues.

Here I add a sampling of tools, which could be used for analysis:

Generic online validation tools

Any help would be great

Tirokk commented 4 years ago

MarcoBomfim Authored by MarcoBomfim


So, I've managed to get a version working locally, which allows mentions and tags on the line below the Embed. Although, due to the change I've made, it broke a test, which I'm checking right now if I can fix this in any other way, or if we'll have to change the test itself.

I'll keep this thread going, just to keep you folks posted, but I'll estimate that I'll be opening a PR by Friday.

Tirokk commented 4 years ago

roschaefer Authored by roschaefer


@MarcoBomfim I've randomly estimated the working hours to 5, so we see some progress in our burndown chart: https://app.zenhub.com/workspaces/nitro-5c0154ecc699f60fc92cf11f/reports/burndown?milestoneId=4816186