www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5915] New: Newlines are not propagated when copy&pasting code snippets

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915

           Summary: Newlines are not propagated when copy&pasting code
                    snippets
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



20:24:22 PDT ---
This only happens on d-programming-language.org.

If you try to copy&paste the first snippet from here:
http://d-programming-language.org/phobos/std_range.html

Pasted:
R r; // can define a range object if (r.empty) {} // can test for empty
r.popFront; // can invoke next auto h = r.front; // can get the front of the
range 

Note that Bugzilla might add its own newlines to limit text width. But there's
no newlines where there should be.

---

Copying from here:
http://www.digitalmars.com/d/2.0/phobos/std_range.html

Pasted:
R r;             // can define a range object
if (r.empty) {}  // can test for empty
r.popFront;          // can invoke next
auto h = r.front; // can get the front of the range

On digitalmars.com it works ok.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 30 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915




20:31:17 PDT ---
This is weird. If I try to copy code samples from
http://d-programming-language.org/expression.html, newlines aren't saved.

But when I compile expression.html from my local branch, and copy a sample from
my local
file:///D:/dev/git/projects/d-programming-language.org/expression.html, then
newlines *are* saved.

I wonder what's causing this behavior..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915




10:15:19 PDT ---
Can anyone else confirm this?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 01 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915


Yao Gomez <yao.gomez gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yao.gomez gmail.com



Where are you pasting the snippets of code? I'm using Opera (Win 7) and the
text from http://d-programming-language.org/phobos/std_range.html is correctly
pasted in a plethora of text editors, and text boxes from web pages.

I also tested http://d-programming-language.org/expression.html and it seems to
work right.

WORKSFORME.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc




 Can anyone else confirm this?
Using Firefox10 when I copy and paste I don't see newlines, so I confirm the problem. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 06 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915




02:04:31 PST ---

 Where are you pasting the snippets of code? I'm using Opera (Win 7) and the
 text from http://d-programming-language.org/phobos/std_range.html is correctly
 pasted in a plethora of text editors, and text boxes from web pages.
In a text editor that recognizes any form of newlines. I can confirm that it works ok in Opera, but not in Firefox. So this is some sort of browser compatibility issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 07 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915


Stewart Gordon <smjg iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com




 I can confirm that it works ok in Opera, but not in Firefox. So this is some
 sort of browser compatibility issue.
Very puzzling. Clearly it's a bug in Firefox, so there should be a bug report somewhere on b.m.o for it. The question is what exactly is triggering it to bite. But it seems to be happening only when viewing the page online - I haven't been able to reproduce it on a local copy of the page even after adding a base tag to make sure it gets all the CSS. It also stops happening if I disable JavaScript. It would seem that the listanchors function (an abomination anyway) is doing something funny to the DOM under FF - after all, for some obscure reason it gets stuck in the load of my local copy and so listanchors isn't called. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 10 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915




20:56:32 PST ---
They seem to work for me now. Can bearophile and Stewart confirm?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915





 They seem to work for me now. Can bearophile and Stewart confirm?
If I go in this page with the latest version of Firefox: http://dlang.org/phobos/std_algorithm.html And I copy the first example I get no newlines: int[] a = ...; static bool greater(int a, int b) { return a > b; } sort!(greater)(a); // predicate as alias sort!("a > b")(a); // predicate as string // (no ambiguity with array name) sort(a); // no predicate, "a < b" is implicit -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 07 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5915





 They seem to work for me now. Can bearophile and Stewart confirm?
Still failing for me (Firefox 18.0.2 Win32). Andrej - what version are you using? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 07 2013