Closed Bug 978912 Opened 7 years ago Closed 7 years ago

Mapping "->" to "->" in Notes

Categories

(Firefox OS Graveyard :: Gaia::Notes, defect)

defect
Not set
normal

Tracking

(b2g-v1.3 verified, b2g-v1.3T fixed, b2g-v1.4 fixed)

RESOLVED FIXED
1.4 S3 (14mar)
Tracking Status
b2g-v1.3 --- verified
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: andre.jaenisch, Assigned: yor)

Details

Attachments

(1 file)

44 bytes, text/x-github-pull-request
matias
: review+
Details | Review
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36

Steps to reproduce:

1. Start Notes app in Firefox OS v1.1 (Alcatel OneTouch Fire).
2. Add a new note.
3. Enter "->" in the text field.
4. Save by hitting "Done." (leads to closing this note)
5. Reopen the note.


Actual results:

The "->" is translated to "->" (html entity)


Expected results:

I'd expected to see "->" again or even better → (→).
Yan, can you take a look?
Flags: needinfo?(yor)
Assignee: nobody → yor
Flags: needinfo?(yor)
Matias, I see the code is converting '&' to '&' before saving to storage,
in evernote.js:1066:

  var text = child.nodeValue.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/&(?!amp;)/g, "&amp;");

Why is this line needed?  The data should already be in HTML, no?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(matias)
Even if the input is in plain text, the replace order is wrong.
Ampersands must be replaced before any other meta characters:

  var text = child.nodeValue.replace(/&(?!amp;)/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
Yan, the replacement was needed after we received a review saying everything is deleted after typing '&' in the note body.

I think that if you change the replace order like Masatoshi suggested it will work fine.
Flags: needinfo?(matias)
Attached file Pull request
Keywords: checkin-needed
This doesn't have r+ AFAICT.
Keywords: checkin-needed
Attachment #8387052 - Flags: review?(matias)
Attachment #8387052 - Flags: review?(matias) → review+
Keywords: checkin-needed
https://github.com/mozilla-b2g/notes/commit/fb4110face6c98fb56733c28d5dfbae94922c9f2
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.4 S3 (14mar)
I was able to verify this issue as Fixed in the following build with the latest version of Notes app:

v1.3 Environmental Variables:
Device: Buri v1.3 MOZ
BuildID: 20140410004002
Gaia: 62acb4b0e774b6709b8be400d849f807404bb21b
Gecko: 94baf6039462
Version: 28.0
Firmware Version: v1.2-device.cfg
You need to log in before you can comment on or make changes to this bug.