Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `markdown-preview` displays the buffer name as the page title
- skip export tests if export command is not installed
- reduce memory allocations in property checking functions
- improve performance to check properties in range by using c functions

[gh-937]: https://github.com/jrblevin/markdown-mode/pull/937

Expand Down
19 changes: 8 additions & 11 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2931,19 +2931,16 @@ This may be useful for tables and Pandoc's line_blocks extension."
Also returns t if PROP is a list containing one of the PROP-VALUES.
Return nil otherwise."
(catch 'found
(cl-loop
with props = nil
for loc from begin to end
do
(when (setq props (get-text-property loc prop))
(cond ((listp props)
(let ((loc begin))
(while (<= loc end)
(when-let* ((props (get-text-property loc prop)))
(if (listp props)
;; props is a list, check for membership
(dolist (val prop-values)
(when (memq val props) (throw 'found loc))))
(t
;; props is a scalar, check for equality
(dolist (val prop-values)
(when (eq val props) (throw 'found loc)))))))))
(when (memq val props) (throw 'found loc)))
(dolist (val prop-values)
(when (eq val props) (throw 'found loc)))))
(setq loc (next-single-property-change loc prop nil (1+ end)))))))

(defun markdown-range-properties-exist (begin end props)
(cl-loop
Expand Down