From 6f64e45d5a957b768fb238406a64167753edd434 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 24 Jan 2015 04:05:12 -0200 Subject: Handle the `sub` and `sup` html tag --- sx-question-print.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 and 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 -- cgit v1.2.3