String literals can span multiple lines. One way is using triple-quotes: """...""" or '''...''' . End-of-line characters are automatically included in the string, but it’s possible to prevent this by adding a \ at the end of the line.
Seem that it is not the answer for the title. What it asked is about the colorizer. Now it also colored for multiple lines string included in once-quote which is wrong.
It has appeared in the history discussion on this post. Both pycharm and vscode give the correct demonstration. Moreover, the github can currect color the wrong_string too.
Make a bug report to highlight.js if you care, this is not something that this website does itself, it uses a very standard external piece of software.
So this thread should be moved to Discourse Feedback, right? At first I was uncertain, but now with the latest posts, it seems obvious that the issue is about the discuss.python.org website itself and its “Discourse” engine, right?
This isn’t a “bug” in discourse. It’s in hightlight.js
Raising it on this website at all isn’t helpful - it’s not going to get anything changed
You have to convince the maintainers over there that it’s a bug at all - I disagree, but I don’t care to argue with you, and it doesn’t matter if you convince me or not.
Yes, of course I agree that ultimately it very much seems to be an issue with highlight.js. But I still think it’d be more helpful to move this thread to Discourse Feedback. It would have more chances of catching the eyes of the people in charge of discuss.python.org, and they might be able to escalate towards Discourse team and eventually towards highlight.js team.
Zero chance of that happening. You can just escalate to highlight.js yourself. These kinds of small highlighting “bugs” for invalid code are not going to be considered serious by most people.
You want three different teams to take this bug serious enough for them to bother other teams. Essentially, you want to waste time of ~a dozen people at least instead of raising a bug report yourself.
I do not care that much about the bug itself, I care about moving posts in the category they fit best. Also I care more about what the original poster, @Locked-chess-official, thinks about my suggestion. You, @MegaIng, made a good point and I acknowledged it.
Thanks for the link. Can you host the html snippet somewhere, to just view it in a browser? It makes it really clear, without having to save it locally. I’d add a third example of the triple quoted multi-line string too, personally.