A bug was reported where YouTube video titles containing single quotes (e.g., ‘Colin Wolfe & ‘The Chronic’’) were being truncated in Discourse topic titles when pasted directly into the topic title field cmwebdev. The issue stemmed from improper handling of single quotes during title retrieval, likely in the retrieve_title.rb logic cmwebdev. Initially unreproducible by techAPJ, the bug was confirmed after clarifying that the issue occurs specifically when pasting into the topic title field cmwebdev. techAPJ acknowledged the oversight and committed to fixing it. The issue was resolved via a commit to the onebox library that now sanitizes YouTube titles to handle quotes correctly techAPJ. Thanks were extended to cmwebdev for reporting the bug.
Paste YouTube link with title containing single quote in new topic title field Example link:https://www.youtube.com/watch?v=L6EbORDmpNY YouTube Title: Colin Wolfe & ‘The Chronic’
Fetched title cuts off at the first appearance of single quote. Discourse Title: Colin Wolfe &
In the source of that YouTube page, the title that Discourse is retrieving looks like this:
document.title = "Colin Wolfe \u0026 'The Chronic' - YouTube";
I’m guessing that the quote throws it off somewhere in here: