Ticket #2603 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

rst escaping produces different text and xhtml output

Reported by: misc@… Owned by: asterix
Priority: normal Milestone: 0.11
Component: chat Version: hg
Severity: normal Keywords: xhtml-im
Cc: Blocked By:
OS: Blocking:

Description

When sending \o/, rst produces a different output for html and for text part of the message :

<message to="jabberfr@chat.jabberfr.org" type="groupchat" id="121">
<body>\\o/ \o/</body>
<html xmlns="http://jabber.org/protocol/xhtml-im">
<body xmlns="http://www.w3.org/1999/xhtml">
<p>\o/ o/</p>
</body>
</html>
</message>

rst should not escape \o to o, or we should escape \ before passing it to docutils

Attachments

gajim_fix_2603.patch (0.5 KB) - added by misc@… 4 years ago.
patch to correct the issue by escaping \

Change History

Changed 4 years ago by misc@…

patch to correct the issue by escaping \

Changed 4 years ago by nk

why we should escape? if rst is on, we write raw rst no??

Changed 4 years ago by misc@…

We should escape because it will otherwise give differents messages content based on the correspondant's client.

As I said, typing '\o' give o in xhtml part of the message, and \o in the regular text part of the message. So depending on the client, people will see different content.

And I do not think anybody want to send raw xml to check if his correspondant will see xhtml or not, thus choosing to type \\o or \o.

Changed 4 years ago by jim++

  • status changed from new to closed
  • resolution set to invalid
  • milestone set to 0.11

Actual behaviour is imposed by rst. We can't escape "\".

A backslash followed by any character (except whitespace characters) escapes that character. The escaped character represents the character itself, and is prevented from playing a role in any markup interpretation. The backslash is removed from the output. A literal backslash is represented by two backslashes in a row (the first backslash "escapes" the second, preventing it being interpreted in an "escaping" role)

Add/Change #2603 (rst escaping produces different text and xhtml output)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Next status will be 'needinfo'
 
Note: See TracTickets for help on using tickets.