Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Double space bug in thoughts + others
« on October 4th, 2012, 06:06 PM »
As mentioned in the thoughts recently, documenting this bug so it can be fixed at some point.

preparsecode converts a double space to a single space followed by an nbsp entity, so that the usual collapsing of spaces does not occur. Trouble is, that extra entity is being escaped at some point between being saved and redisplayed.

Now, the two branches of the front page in SVN (the Home and Welcome templates, of which Welcome is the default) do not exhibit this bug.

They do have other bugs, however, where the AJAX return is inserted without values being injected into the return, plus neither of them is as functional as the master template is here.

There also really should be some kind of entry box on the front page for thoughts - in case folks do what I do and have the sidebar at the bottom, and it would also mean that the thoughts subtemplate should not be removed from the front page if the users have some ability to post.

(Also on that note: thoughts need some permissions adding!)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Double space bug in thoughts + others
« Reply #4, on November 13th, 2012, 01:53 AM »
OK, so I can't seem to reproduce the original main bug.

However, there are a few oddities. Firstly, if you AJAXively add a thought with a smiley, the smiley won't appear in the return, so it'll look like it just got removed, but a refresh shows it to be there. And of course editing works as expected with that smiley.

If a thought is saved with a double space, as mentioned the first space in any pair is converted to an nbsp, and that appears in the resultant thought. Fine, because that's how preparsecode works (so that double spacing after a period is honoured, for example), but it also means that if you edit that thought, it's shown in the editing part, because wherever the Edit button gets it from, it's not decoding that entity. I haven't tried it with other entities, though so it could have all manner of fun. Specifically, the entities that may have odd behaviour are nbsp, amp, lt, gt, apos, quot, and our old friend 039.