           "$p = `git -C $d rev-parse --show-prefix`; "
           "chomp($o, $p); "
           "if ($o) { print \"$o/blob/master/$p$b\"; } else { print \"file://$f\" }' "
-          (shell-quote-argument (buffer-file-name)) ")#L"
+          (shell-quote-argument (buffer-file-name)) ")"
           (if (region-active-p)
-            (concat
-              (number-to-string (line-number-at-pos (region-beginning))) "-"
-              (number-to-string (line-number-at-pos (region-end))))
-            (number-to-string (line-number-at-pos)))
+            (concat "#L"
+              (number-to-string (line-number-at-pos (region-beginning))) "-L"
+              (number-to-string (line-number-at-pos (- (region-end) 1) )))
+            (if (> (line-number-at-pos) 1) (concat "#L" (number-to-string (line-number-at-pos))) ""))
           "\"")
         nil 0))))
 


(defun jekyll-server-start (directory port file-name)
  "Start a Jekyll server for DIRECTORY on PORT and open FILE-NAME."
  (require 'rvm)
  (rvm-use-default)
  (let* (
          (url (concat "http://localhost:" (number-to-string port)

;;; Code:

(require 'cl-lib)

(autoload 'rvm-use-default "rvm" nil t)

(defvar github-markdown-servers '() "The servers we have running.")
(defvar github-markdown-server-port 7494 "The next available server port.")
