0

这是我的 wordpresss 模板代码一次又一次发生的屏幕截图:

https://www.box.net/shared/zrql76wiimr790587yxj

起初我认为这是一个记事本++问题。但这也发生在 phpstorm 上。

知道为什么会这样吗?

4

1 回答 1

2

Your code isn't messed up, this is a question about how your system handles lineendings.

Linux and OSX save lineendings differently from Windows.

Linux and OSX saves lineendings with a Line Feed (LF):

\n

While windows saves it with Carriage Return + Line Feed (CR+LF):

\r\n

So what is probably happening is that your file has been written on a system that doesn't save lineendings in the windows format. Your editor most probably supports these kind of line endings and can handle it, look into the menus of your editor.

** Below is part of an edit and not part of my answer.**

You can check EditorConfig which can be helpful when you are trying to keep settings across projects and/or editors and also, if you keep your code under git, Dealing with line endings article from Github may be also helpful.

End of edit

Read more here: Wiki article

于 2012-12-26T17:26:19.100 回答