Function: markdown--fontify-table-alignment
markdown--fontify-table-alignment is a natively compiled function
defined in markdown-mode.el.
Signature
(markdown--fontify-table-alignment)
Documentation
Visually align cell separators of the table line at point.
Hiding markup makes the displayed content of a table cell narrower than the buffer text, which breaks the column alignment of tables that are aligned in the source. Give the whitespace before each cell separator a space display specification stretching it to the separator's buffer column, so that separators are displayed at the same column as in the source regardless of what is hidden before them.
Source Code
;; Defined in /nix/store/p33zgg95aglc47pl6zlgs43vki0snxf8-emacs-packages-deps/share/emacs/site-lisp/elpa/markdown-mode-20260827.909/markdown-mode.el
(defun markdown--fontify-table-alignment ()
"Visually align cell separators of the table line at point.
Hiding markup makes the displayed content of a table cell
narrower than the buffer text, which breaks the column alignment
of tables that are aligned in the source. Give the whitespace
before each cell separator a space display specification
stretching it to the separator's buffer column, so that
separators are displayed at the same column as in the source
regardless of what is hidden before them."
(beginning-of-line)
(while (re-search-forward "[ \t]+|" (line-end-position) t)
(let ((separator (1- (match-end 0))))
(unless (markdown-inline-code-at-pos-p separator)
(put-text-property
(match-beginning 0) separator
'display `(space :align-to ,(1- (current-column))))))))