Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#12664 closed defect (fixed)

Newlines aren't preserved when bridges are copied to clipboard

Reported by: mttp Owned by: isis
Priority: Medium Milestone:
Component: Obfuscation/BridgeDB Version:
Severity: Keywords: bridgedb-https, bridgedb-ui, bridgedb-0.2.4
Cc: sysrqb, isis Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When BridgeDB's web interface returns bridges, each bridge is displayed on its own line, as they should be. However, when the bridges are copied and pasted into a text field, the bridges are all smushed together in one line.

Child Tickets

Attachments (1)

preserve-newlines.patch (732 bytes) - added by mttp 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by mttp

Attachment: preserve-newlines.patch added

comment:1 Changed 5 years ago by mttp

I've made a patch that I think corrects this issue.

comment:2 Changed 5 years ago by mttp

Status: newneeds_review

comment:3 Changed 5 years ago by chingucha

Sweet hack! I like it

comment:4 in reply to:  1 Changed 5 years ago by isis

Cc: isis added
Keywords: bridgedb-https bridgedb-ui added
Status: needs_reviewneeds_revision

Replying to mttp:

I've made a patch that I think corrects this issue.

Hi mttp, thanks for the patch!

One thing, however:

Python code goes in .py files; Javascript in .js files; HTML in .html files. The HTML templates for the web interface are in lib/bridgedb/templates, and the spot that you want is here. However, you may need to change the associated div.bridgelines CSS class to fix it (here).

The reason this bug is occuring is that BridgeDB used to use <code>/<pre> tags to enclose the bridge lines. Then, when we started giving out bridge lines which included the fingerprint, using <code> made the line wrap around, causing the fingerprints to look like they were on new lines by themselves. I created the div.bridgelines class to fix this, but I'm no CSS wizard.

comment:5 Changed 5 years ago by mttp

It seems that if this bug in Firefox (~13 years old now) were fixed, this wouldn't be an issue. You are right that since the div.bridge-lines block in custom.css includes the line white-space: pre-wrap; it's affected.

comment:6 Changed 4 years ago by isis

Resolution: fixed
Status: needs_revisionclosed

Okay, this is fixed in my fix/12664-bridgeline-newlines_r2 branch, and merged to develop for the upcoming 0.2.4 release. It also fixes other things, like making the "tor roots" logo actually be a background image, and it adds a "Select All" button which (if JS is enabled) will select all the bridge lines to try to reduce the amount of copy+paste errors that users are experiencing. The newlines, when pasted, actually translate to newlines.

comment:7 Changed 4 years ago by isis

Keywords: bridgedb-0.2.4 added
Note: See TracTickets for help on using tickets.