mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
275f623278
- Change fixture response of posts route to actual format. - Extracted classNames logic of routes into style-body mixin. - Additionally replaced all double-quotes with single-quotes for style conformance.
6 lines
276 B
JavaScript
6 lines
276 B
JavaScript
export default function (s) {
|
|
s = s.replace(/(^\s*)|(\s*$)/gi, ""); // exclude start and end white-space
|
|
s = s.replace(/[ ]{2,}/gi, " "); // 2 or more space to 1
|
|
s = s.replace(/\n /, "\n"); // exclude newline with a start spacing
|
|
return s.split(' ').length;
|
|
} |