aboutsummaryrefslogtreecommitdiff
path: root/sx-question-print.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-24 04:05:12 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-24 04:14:24 -0200
commit6f64e45d5a957b768fb238406a64167753edd434 (patch)
tree5fb0a428e3d45be59d88a1a7667e7d7dbd403c79 /sx-question-print.el
parent7ce3968e25c8c7a076f83f0b0d9d3b3b7d8afadc (diff)
Handle the `sub` and `sup` html tag
Diffstat (limited to 'sx-question-print.el')
-rw-r--r--sx-question-print.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/sx-question-print.el b/sx-question-print.el
index 5be3133..3b4069d 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -95,6 +95,11 @@ Some faces of this mode might be defined in the `sx-user' group."
"Face used for downvoted score in the question buffer."
:group 'sx-question-mode-faces)
+(defface sx-question-mode-sub-sup
+ '((t :height 0.7))
+ "Face used on <sub> and <sup> tags."
+ :group 'sx-question-mode-faces)
+
(defcustom sx-question-mode-header-tags "\nTags: "
"String used before the question tags at the header."
:type 'string
@@ -407,7 +412,14 @@ END should be a marker."
(save-excursion (goto-char l) (insert "`")))
(replace-match "")
;; Handle stuff between the two tags.
- (save-match-data (sx-question-mode--process-html-tags l r)))))))))
+ (save-match-data (sx-question-mode--process-html-tags l r))
+ (cond
+ ((string= tag "sub")
+ (add-text-properties
+ l r '(face sx-question-mode-sub-sup display (raise -0.3))))
+ ((string= tag "sup")
+ (add-text-properties
+ l r '(face sx-question-mode-sub-sup display (raise +0.3))))))))))))
;;; Handling links