Function: markdown-ts--toc-atx_header-normalize

markdown-ts--toc-atx_header-normalize is a byte-compiled function defined in markdown-ts-mode-x.el.gz.

Signature

(markdown-ts--toc-atx_header-normalize TEXT)

Documentation

Remove trailing # from TEXT unless they are backslash escaped.

First remove HTML comments.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode-x.el.gz
(defun markdown-ts--toc-atx_header-normalize (text)
  "Remove trailing # from TEXT unless they are backslash escaped.
First remove HTML comments."
  (if (string-match-p "[[:blank:]]*\\\\+#+[[:blank:]]*\n*\\'" text)
      text
    (replace-regexp-in-string "[[:blank:]]*#+[[:blank:]]*\n*\\'" "" text)))