diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-04-19 14:32:33 +0100 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-04-19 14:32:33 +0100 |
commit | 7f378722c467b2b420e6e0903e895bd25768f355 (patch) | |
tree | 9bb8371faa1faa0ec50e8a77989d0b4190fa95ce | |
parent | 99efd883a238f7fdbf36a919daa282536e3f5b4b (diff) |
kbd face and add space between multiple kbds. Fixes #275
-rw-r--r-- | sx-question-print.el | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sx-question-print.el b/sx-question-print.el index 4a1c4f7..5347eb9 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -552,6 +552,18 @@ font-locks code-blocks according to mode." "Face used on <sub> and <sup> tags." :group 'sx-question-mode-faces) +(defface sx-question-mode-kbd-tag + '((((background dark)) + :height 0.9 + :weight semibold + :box (:line-width 3 :style released-button :color "gray30")) + (((background light)) + :height 0.9 + :weight semibold + :box (:line-width 3 :style released-button :color "gray70"))) + "Face used on <kbd> tags." + :group 'sx-question-mode-faces) + (defun sx-question-mode--inside-code-p () "Return non-nil if point is inside code. This can be inline Markdown code or a Markdown code-block." @@ -588,7 +600,10 @@ END-MARKER should be a marker." (save-match-data (sx-question-mode--process-html-tags l r)) (cond ((string= tag "kbd") - (add-text-properties l r '(face markdown-inline-code-face))) + (add-text-properties l r '(face sx-question-mode-kbd-tag)) + (when (looking-at-p + (format sx-question-mode--html-tag-regexp "kbd")) + (insert " "))) ((string= tag "sub") (add-text-properties l r '(face sx-question-mode-sub-sup-tag display (raise -0.3)))) |