Notifications menu shows raw backslash escapes in titles


(Leo Davidson) #1

This is quite minor, at least in the situation I saw it in.


  • The notifications menu looks like it shows raw topic titles, without applying the backslash escaping rules. Compare left and right red boxes:


  • Here’s what the raw thread title looks like:


  • And how the title is rendered when viewing the topic itself:


All look correct to me except for the notification menu.

(We also surely have proof that time travel will never exist, as nobody has gone back in time and stopped MS-DOS / Windows from using a common escape character all over file paths and leaking into conversations about file paths. :smiley: )


(Sam Saffron) #3

I don’t think this is worth fixing.

There is no need to escape \ in titles, this is subtle bug in our title prettier.

Just make your title ..folder Using "\"; Says... no need to escape stuff.


(Leo Davidson) #4

FWIW, there are some cases where you do need to escape baskslashes in titles.

One example is a title about UNC paths in Windows:


Problem going to \\server\share

becomes:

Problem going to \server\share

unless you double up the first pair of backslashes:

Problem going to \\\\server\share


Our forum is about a file manager, so this example isn’t entirely contrived. That said, it is still rare for it to matter, and the problem is still small and cosmetic, so it may still not be worth fixing. We can certainly live with it.


(Sam Saffron) #5

I think that is a bug then … our pretifier has to stop this backslash escaping.

It is completely non-obvious that you should need to escape in the title.


(Sam Saffron) #6

I see… was reading through the code, will leave it for @codinghorror to decide.

The reason this happens is due to:

Should I remove this magic?

Or maybe our topic titles should be passed through the prettfier prior to being sent as notifications. Not sure.


(Leo Davidson) #7

If the escaping is kept in titles, one thing that is a little odd is that the rules aren’t the same as in message bodies.

For example, C:\* requires you double the backslash in a message body, but not in a title.

(I guess it makes sense in a way: Bold and italic markdown don’t apply to titles, * has no special meaning at the end of words in titles, so it doesn’t need escaping. OTOH, it’s easier to remember either one set of rules, or that escaping isn’t needed at all for titles. Still, it’s minor in the grand scheme of things so whatever you choose to do, if anything, is fine. Always a risk that changing something breaks something else!)


(Jeff Atwood) #8

That only applies to titles? Why is that even there?


(Sam Saffron) #9

That code only apply to title prettify, we lifted it from the original implementation. Happy to remove it if you are comfortable with there being no easy way to specify " in a title (as opposed to the pretiffied version)


(Jeff Atwood) #10

Yeah I suggest removing it then


(Sam Saffron) #11

There is still the edge case that quotes are not all “fancy” in notifications, we should probably make it consistent some day.

But, agree, that fancy escaping is just confusing for most people.


(Sam Saffron) #13

This specific issue is fixed by:


(Sam Saffron) #14