Code comments do not paste on Apple Developer Forums

Commented code doesn't paste correctly into the Apple Developer Forums – it requires copy/paste multiple times to fix the formatting with comments.


// This is comment

/* c = square root(a^2 + b^2)
   Calculate the distance betwen two points
@return linear distance between two CGPoints
*/
func distanceBetweenPoints(a: CGPoint, b: CGPoint) -> CGFloat {
    return sqrt((b.x - a.x)*(b.x - a.x) + (b.y - a.y)*(b.y - a.y))
}


Buggy code paste

  1. The second / of the // comment block is removed (along with the rest of the comment)
  2. With a block comment the * is removed from the / start of the block comment.


/
/ c = square root(a^2 + b^2)
Calculate the distance betwen two points
@return linear distance between two CGPoints
*/
func distanceBetweenPoints(a: CGPoint, b: CGPoint) -> CGFloat {
    return sqrt((b.x - a.x)*(b.x - a.x) + (b.y - a.y)*(b.y - a.y))
}

Posted bug report: #22152920: Code comments do not paste on the new Apple Developer Forums

Did you try the (clumsy PITA) method of escaping them?

Ha. I had been wondering why I was seeing all those "/" lines in people's code samples. Now it all becomes clear.


I wish Apple would just buck up the $249 for a vBulletin license so we could have a real forum... yes I like to dream.

Code comments do not paste on Apple Developer Forums
 
 
Q