     (org-indent-mode              . spacemacs//space-doc-org-indent-mode)
     (view-mode                    . spacemacs//space-doc-view-mode)
     (hide-line-numbers            . spacemacs//space-doc-hide-line-numbers)
-    (alternative-emphasis            . spacemacs//space-doc-alternative-emphasis)
-    (alternative-tags-look           . spacemacs//space-doc-alternative-tags-look)
+    (alternative-emphasis         . spacemacs//space-doc-alternative-emphasis)
+    (alternative-tags-look        . spacemacs//space-doc-alternative-tags-look)
     (link-protocol                . spacemacs//space-doc-link-protocol)
     (org-block-line-face-remap    . spacemacs//space-doc-org-block-line-face-remap)
     (org-kbd-face-remap           . spacemacs//space-doc-org-kbd-face-remap)

                :after
                #'spacemacs//space-doc-org-do-emphasis-faces-advice)))

(defun spacemacs//space-doc-emphasis-region (begin end)
  "Emphasis region based on its leading character.
The character should be one of the markers from `org-emphasis-alist'."
  (let* ((beginning-marker-overlay nil)
         (ending-marker-overlay nil))
    (setq beginning-marker-overlay
          (make-overlay begin (1+ begin))
          ending-marker-overlay
          (make-overlay (1- end) end))
    (if (string= (buffer-substring-no-properties begin
                                                 (1+ begin))
                 (spacemacs--space-doc-cache-struct-kbd-marker
                  spacemacs--space-doc-cache))
        (progn
          (overlay-put beginning-marker-overlay
                       'face
                       (spacemacs--space-doc-cache-struct-btn-marker-face
                        spacemacs--space-doc-cache))
          (overlay-put ending-marker-overlay
                       'face
                       (spacemacs--space-doc-cache-struct-btn-marker-face
                        spacemacs--space-doc-cache)))
      ;; If inside table.
      (if (save-excursion
            (goto-char begin)
            (beginning-of-line)
            (looking-at-p org-table-any-line-regexp))
          (progn
            (overlay-put beginning-marker-overlay
                         'face
                         (spacemacs--space-doc-cache-struct-marker-face
                          spacemacs--space-doc-cache))
            (overlay-put ending-marker-overlay
                         'face
                         (spacemacs--space-doc-cache-struct-marker-face
                          spacemacs--space-doc-cache)))
        (overlay-put beginning-marker-overlay
                     'invisible t)
        (overlay-put ending-marker-overlay
                     'invisible t)))
    (overlay-put beginning-marker-overlay
                 'space-doc-emphasis-overlay t)
    (overlay-put ending-marker-overlay
                 'space-doc-emphasis-overlay t)))

(defun spacemacs//space-doc-alternative-emphasis (&optional enable)
  "Emphasis overlays.
If ENABLE is non-nil, overlay regions which have already been emphasized by
`org-do-emphasis-faces'in the current buffer.
Otherwise remove all overlays with property `space-doc-emphasis-overlay'.
This functions is aimed to be used with `spacemacs-space-doc-modificators'."
  ;; Remove overlays.
  (spacemacs//space-doc-advice-org-do-emphasis-faces enable)
  (dolist (overlay (overlays-in (point-min) (point-max)))
    (when (overlay-get overlay 'space-doc-emphasis-overlay)
      (delete-overlay overlay)))
  (when enable
    (dolist (emphasized-region
             (spacemacs//space-doc-find-regions-by-text-property
              'org-emphasis t))
      (spacemacs//space-doc-emphasis-region
       (car  emphasized-region)
       (cadr emphasized-region)))))

(defun spacemacs//space-doc-org-kbd-face-remap (&optional enable)
  "Remove boxes from key bindings.

  :group 'space-doc
  (spacemacs//space-doc-centered-buffer-mode-goto-origin space-doc-mode)
  (if (derived-mode-p 'org-mode)
      (let ((inhibit-read-only t))
        (spacemacs//space-doc-set-cache space-doc-mode)
        (dolist (modificator spacemacs-space-doc-modificators-functions)
          (when (member (car modificator)
                        spacemacs-space-doc-modificators)
            (funcall (cdr modificator) space-doc-mode))))
    ;; Force `org-mode' to replace font text properties with the default ones.
    (unless space-doc-mode (org-font-lock-ensure))
    (message (format "space-doc-mode error:%s isn't an org-mode buffer"
                     (buffer-name)))
    (setq space-doc-mode nil)))
