diff options
author | Sean Allred <code@seanallred.com> | 2015-02-03 20:31:36 -0600 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2015-02-03 20:31:36 -0600 |
commit | 157a59aa853d24b2e21e8fde1a4862252edb1c00 (patch) | |
tree | 6e66d13f208d7e3f963356461c675c28124527dc | |
parent | 2c9e84e67a54c163fd194194dc2a4f0266336cc9 (diff) | |
parent | f275e00c221c506cd4f22144649649e65179e3cc (diff) |
Merge pull request #247 from vermiculus/issue-246--compress-commments
Issue 246 compress commments
-rw-r--r-- | sx-question-print.el | 6 | ||||
-rw-r--r-- | sx.el | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sx-question-print.el b/sx-question-print.el index f9ecfab..778b580 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -286,10 +286,10 @@ The comment is indented, filled, and then printed according to (format sx-question-mode-comments-format (sx-user--format "%d" .owner) (substring - ;; We fill with three spaces at the start, so the comment is - ;; slightly indented. (sx-question-mode--fill-and-fontify - (concat " " .body_markdown)) + ;; We fill with three spaces at the start, so the comment is + ;; slightly indented. + (concat " " (sx--squash-whitespace .body_markdown))) ;; Then we remove the spaces from the first line, since we'll ;; add the username there anyway. 3)))))) @@ -331,6 +331,10 @@ GET-FUNC and performs the actual comparison." (funcall ,get-func a) (funcall ,get-func b)))) +(defun sx--squash-whitespace (string) + "Return STRING with consecutive whitespace squashed together." + (replace-regexp-in-string "[ \r\n]+" " " string)) + ;;; Printing request data (defvar sx--overlays nil |