Awful / Awful.app

Something Awful Forums browser for iOS
https://forums.somethingawful.com/showthread.php?threadid=3837546&perpage=40&noseen=1
136 stars 45 forks source link

Consecutive hyphens in a pasted YouTube link turn into an em dash #1015

Open nolanw opened 4 years ago

nolanw commented 4 years ago

Hey, thanks for following up on this and good intuition about the dash. I just tested and pasting a youtube link with the broken video ID from Ralph Hurley's post converts to the proper video tag in the forums reply page:

[video type="youtube"]9g3–WYH8SY[/video]

However, the embed (and original link) won't work because that's the wrong kind of dash; em dashes as far as I can tell aren't used in youtube video IDs. Note thathttps://youtube.com/watch?v=9g3%96WYH8SYdoesn't work, either.

Pasting it with a single en dash instead correctly formats the tag/embed, but the embed will also break because that's not a valid video ID:

Googling the ID foundhttps://www.youtube.com/watch?v=9g3--WYH8SY- note the two dashes. For reference, I can also paste this link at the reply page, and it is properly converted to a video tag:

So either Ralph Hurley's iPhone or Awful app decided to convert the two en dashes to an em dash at some point, causing it to break.

edit: if you do ever come across a youtube video link with some strange characters in it or whatever that doesn't convert to the video tag properly or doesn't embed properly, post it in the technical thread in QCS or otherwise let me know and I'll be happy to look into it. — astral

nolanw commented 4 years ago

We do some finagling when pasting other things to thwart iOS's attempts to incorrect dumb quotes in BBcode, so presumably that same finagling would work here?