diff options
-rwxr-xr-x | bot/sx-bot.sh | 2 | ||||
-rw-r--r-- | sx-babel.el | 6 | ||||
-rw-r--r-- | sx-question-print.el | 6 | ||||
-rw-r--r-- | sx-request.el | 4 | ||||
-rw-r--r-- | test/test-printing.el | 56 |
5 files changed, 69 insertions, 5 deletions
diff --git a/bot/sx-bot.sh b/bot/sx-bot.sh index 6a5df17..22c7284 100755 --- a/bot/sx-bot.sh +++ b/bot/sx-bot.sh @@ -1,6 +1,6 @@ #!/usr/bin/bash -DESTINATION_BRANCH=gh-pages +DESTINATION_BRANCH=data function notify-done { local title diff --git a/sx-babel.el b/sx-babel.el index 4386172..e115817 100644 --- a/sx-babel.el +++ b/sx-babel.el @@ -34,6 +34,12 @@ ;; @TODO: Make shell-mode work here. Currently errors because it ;; needs a process. `sh-mode' isn't as nice. (,(rx (or "$ " "# ")) sh-mode) + ;; Not sure if leaving out "[{" might lead to false positives. + (,(rx "\\" (+ alnum) (any "[{")) latex-mode) + ;; Right now, this will match a lot of stuff. Once we are capable + ;; of determining major-mode from tags, site, and comments, this + ;; will work as a last case fallback. + (,(rx (or (and "int" (+ space) "main" (* space) "("))) c-mode) ) "List of cons cells determining which major-mode to use when. Each car is a rule and each cdr is a major-mode. The first rule diff --git a/sx-question-print.el b/sx-question-print.el index d74a162..f6cd1dc 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -467,9 +467,11 @@ font-locking." (defun sx-question-mode--skip-references () "If there's a reference ahead, skip it and return non-nil." - (while (looking-at-p (format sx-question-mode--reference-regexp ".+")) + (forward-line 0) + (when (looking-at-p (format sx-question-mode--reference-regexp ".+")) ;; Returns non-nil - (forward-line 1))) + (forward-paragraph 1) + t)) (provide 'sx-question-print) ;;; sx-question-print.el ends here diff --git a/sx-request.el b/sx-request.el index f892367..9a788ca 100644 --- a/sx-request.el +++ b/sx-request.el @@ -217,8 +217,8 @@ Currently returns nil." ;;; Our own generated data -(defvar sx-request--data-url-format - "https://raw.githubusercontent.com/vermiculus/sx.el/data/data/%s.el" +(defconst sx-request--data-url-format + "http://raw.githubusercontent.com/vermiculus/sx.el/data/data/%s.el" "Url of the \"data\" directory inside the SX `data' branch.") (defun sx-request-get-data (file) diff --git a/test/test-printing.el b/test/test-printing.el index 2857cb7..c477b28 100644 --- a/test/test-printing.el +++ b/test/test-printing.el @@ -71,3 +71,59 @@ after being run through `sx-question--tag-format'." (sx--user-@name '((display_name . "ĤÞßĐŁŘĞĜÝŸÑŃŚŞŠŜŻŹŽÇĆČĈÙÚÛÜŬŮÒÓÔÕÖØŐÐÌÍÎÏıÈÉÊËĘÀÅÁÂÄÃÅĄĴ"))) "@HTHssDLRGGYYNNSSSSZZZCCCCUUUUUUOOOOOOOOIIIIiEEEEEAAAAAAAAJ"))) +(ert-deftest sx-question-mode--fill-and-fontify () + "Check complicated questions are filled correctly." + (should + (equal + (sx-question-mode--fill-and-fontify + "Creating an account on a new site requires you to log into that site using *the same credentials you used on existing sites.* For instance, if you used the Stack Exchange login method, you'd... + +1. Click the \"Log in using Stack Exchange\" button: + + ![][1] + +2. Enter your username and password (yes, even if you *just did this* to log into, say, Stack Overflow) and press the \"Log In\" button: + + ![][2] + +3. Confirm the creation of the new account: + + ![][3] + + some code block + some code block + some code block + some code block + some code block + some code block + + [1]: http://i.stack.imgur.com/ktFTs.png + [2]: http://i.stack.imgur.com/5l2AY.png + [3]: http://i.stack.imgur.com/22myl.png") + "Creating an account on a new site requires you to log into that site +using *the same credentials you used on existing sites.* For instance, +if you used the Stack Exchange login method, you'd... + +1. Click the \"Log in using Stack Exchange\" button: + + ![][1] + +2. Enter your username and password (yes, even if you *just did this* + to log into, say, Stack Overflow) and press the \"Log In\" button: + + ![][2] + +3. Confirm the creation of the new account: + + ![][3] + + some code block + some code block + some code block + some code block + some code block + some code block + + [1]: http://i.stack.imgur.com/ktFTs.png + [2]: http://i.stack.imgur.com/5l2AY.png + [3]: http://i.stack.imgur.com/22myl.png"))) |