A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jrblevin/markdown-mode/issues/634 below:

Error when inserting fenced code block at EOB · Issue #634 · jrblevin/markdown-mode · GitHub

When I try to insert fenced code block (either by typing three backticks or using C-c C-s C command) in GFM-mode at end of buffer and press Enter to continue without specifying a language, the code block will be inserted properly, but I get the Invalid search bound (wrong side of point) error message.

Expected Behavior

The code block will be inserted properly and without any errors.

Actual Behavior

The code block will be inserted properly, but an error message is displayed.

Steps to Reproduce
  1. Enter GFM mode and go to EOB.
  2. Press C-c C-s C to insert a fenced code block at point.
  3. When prompted to specify a language hit Enter.
Backtrace
Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
  re-search-forward("^[ \011]*\\(?:-[ \011]*\\)?\\([[:alpha:]][[:alpha:] _-]*?\\)\\([:=][ \011]*\\)\\(.*\\)$" 1 t)
  (while (re-search-forward markdown-regex-declarative-metadata end t) (progn (put-text-property (match-beginning 1) (match-end 1) (quote markdown-metadata-key) (match-data t)) (put-text-property (match-beginning 2) (match-end 2) (quote markdown-metadata-markup) (match-data t)) (put-text-property (match-beginning 3) (match-end 3) (quote markdown-metadata-value) (match-data t))))
  (progn (while (re-search-forward markdown-regex-declarative-metadata end t) (progn (put-text-property (match-beginning 1) (match-end 1) (quote markdown-metadata-key) (match-data t)) (put-text-property (match-beginning 2) (match-end 2) (quote markdown-metadata-markup) (match-data t)) (put-text-property (match-beginning 3) (match-end 3) (quote markdown-metadata-value) (match-data t)))) nil)
  (save-excursion (goto-char start) (progn (while (re-search-forward markdown-regex-declarative-metadata end t) (progn (put-text-property (match-beginning 1) (match-end 1) (quote markdown-metadata-key) (match-data t)) (put-text-property (match-beginning 2) (match-end 2) (quote markdown-metadata-markup) (match-data t)) (put-text-property (match-beginning 3) (match-end 3) (quote markdown-metadata-value) (match-data t)))) nil))
  markdown-syntax-propertize-yaml-metadata(2 1)
  (let ((close-begin (match-beginning 0)) (close-end (match-end 0)) (close-data (match-data t))) (put-text-property middle-begin close-begin (car (cdr (cdr fence-spec))) (list middle-begin close-begin)) (markdown-syntax-propertize-yaml-metadata middle-begin close-begin) (put-text-property close-begin close-end (car (cdr (car (cdr fence-spec)))) close-data))
  (progn (let ((close-begin (match-beginning 0)) (close-end (match-end 0)) (close-data (match-data t))) (put-text-property middle-begin close-begin (car (cdr (cdr fence-spec))) (list middle-begin close-begin)) (markdown-syntax-propertize-yaml-metadata middle-begin close-begin) (put-text-property close-begin close-end (car (cdr (car (cdr fence-spec)))) close-data)))
  (if (re-search-forward reg end t) (progn (let ((close-begin (match-beginning 0)) (close-end (match-end 0)) (close-data (match-data t))) (put-text-property middle-begin close-begin (car (cdr (cdr fence-spec))) (list middle-begin close-begin)) (markdown-syntax-propertize-yaml-metadata middle-begin close-begin) (put-text-property close-begin close-end (car (cdr (car (cdr fence-spec)))) close-data))))
  markdown-propertize-end-match("^[[:blank:]]*\\(?1:```\\)\\(?2:\\s *?\\)$" 9 (("^[[:blank:]]*\\(?1:```\\)\\(?2:[[:blank:]]*{?[[:blank:]]*\\)\\(?3:[^`[:space:]]+?\\)?\\(?:[[:blank:]]+\\(?4:.+?\\)\\)?\\(?5:[[:blank:]]*}?[[:blank:]]*\\)$" markdown-gfm-block-begin) ("^[[:blank:]]*\\(?1:```\\)\\(?2:\\s *?\\)$" markdown-gfm-block-end) markdown-gfm-code) 2)
  (let* ((correct-entry (cl-find-if (function (lambda (entry) (eq (cdr prev-begin-block) (car ...)))) markdown-fenced-block-pairs)) (enclosed-text-start (1+ (car prev-begin-block))) (start-length (save-excursion (goto-char (car prev-begin-block)) (string-match (markdown-maybe-funcall-regexp (car (car correct-entry))) (buffer-substring (point-at-bol) (point-at-eol))) (- (match-end 1) (match-beginning 1)))) (end-reg (markdown-maybe-funcall-regexp (car (car (cdr correct-entry))) start-length))) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start))
  (progn (let* ((correct-entry (cl-find-if (function (lambda (entry) (eq ... ...))) markdown-fenced-block-pairs)) (enclosed-text-start (1+ (car prev-begin-block))) (start-length (save-excursion (goto-char (car prev-begin-block)) (string-match (markdown-maybe-funcall-regexp (car ...)) (buffer-substring (point-at-bol) (point-at-eol))) (- (match-end 1) (match-beginning 1)))) (end-reg (markdown-maybe-funcall-regexp (car (car (cdr correct-entry))) start-length))) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start)))
  (if prev-begin-block (progn (let* ((correct-entry (cl-find-if (function (lambda ... ...)) markdown-fenced-block-pairs)) (enclosed-text-start (1+ (car prev-begin-block))) (start-length (save-excursion (goto-char (car prev-begin-block)) (string-match (markdown-maybe-funcall-regexp ...) (buffer-substring ... ...)) (- (match-end 1) (match-beginning 1)))) (end-reg (markdown-maybe-funcall-regexp (car (car ...)) start-length))) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start))))
  (let ((prev-begin-block (markdown-find-previous-block))) (if prev-begin-block (progn (let* ((correct-entry (cl-find-if (function ...) markdown-fenced-block-pairs)) (enclosed-text-start (1+ (car prev-begin-block))) (start-length (save-excursion (goto-char ...) (string-match ... ...) (- ... ...))) (end-reg (markdown-maybe-funcall-regexp (car ...) start-length))) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start)))))
  (save-excursion (goto-char start) (let ((prev-begin-block (markdown-find-previous-block))) (if prev-begin-block (progn (let* ((correct-entry (cl-find-if ... markdown-fenced-block-pairs)) (enclosed-text-start (1+ ...)) (start-length (save-excursion ... ... ...)) (end-reg (markdown-maybe-funcall-regexp ... start-length))) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start))))) (while (re-search-forward start-reg end t) (let* ((cur-line (buffer-substring (point-at-bol) (point-at-eol))) (correct-entry (cl-find-if (function (lambda ... ...)) markdown-fenced-block-pairs)) (enclosed-text-start (save-excursion (1+ (point-at-eol)))) (end-reg (markdown-maybe-funcall-regexp (car (car ...)) (if (and ... ...) (- ... ...) 0)))) (save-excursion (beginning-of-line) (re-search-forward (markdown-maybe-funcall-regexp (car (car correct-entry))) (point-at-eol))) (put-text-property (match-beginning 0) (match-end 0) (car (cdr (car correct-entry))) (match-data t)) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start))))
  (let ((start-reg (markdown-get-start-fence-regexp))) (save-excursion (goto-char start) (let ((prev-begin-block (markdown-find-previous-block))) (if prev-begin-block (progn (let* ((correct-entry ...) (enclosed-text-start ...) (start-length ...) (end-reg ...)) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start))))) (while (re-search-forward start-reg end t) (let* ((cur-line (buffer-substring (point-at-bol) (point-at-eol))) (correct-entry (cl-find-if (function ...) markdown-fenced-block-pairs)) (enclosed-text-start (save-excursion (1+ ...))) (end-reg (markdown-maybe-funcall-regexp (car ...) (if ... ... 0)))) (save-excursion (beginning-of-line) (re-search-forward (markdown-maybe-funcall-regexp (car ...)) (point-at-eol))) (put-text-property (match-beginning 0) (match-end 0) (car (cdr (car correct-entry))) (match-data t)) (markdown-propertize-end-match end-reg end correct-entry enclosed-text-start)))))
  markdown-syntax-propertize-fenced-block-constructs(1 9)
  (let ((indent (current-indentation)) start-bol) (delete-horizontal-space :backward-only) (markdown-ensure-blank-line-before) (indent-to indent) (setq start-bol (point-at-bol)) (insert "```" gfm-open-brace lang gfm-close-brace "\n") (indent-to indent) (if edit nil (insert 10)) (indent-to indent) (insert "```") (markdown-ensure-blank-line-after) (markdown-syntax-propertize-fenced-block-constructs start-bol (point)))
  (if (use-region-p) (let* ((b (region-beginning)) (e (region-end)) end (indent (progn (goto-char b) (current-indentation)))) (goto-char e) (if (looking-back "\n" nil) nil (newline)) (indent-to indent) (insert "```") (markdown-ensure-blank-line-after) (setq end (point)) (goto-char b) (if (looking-at-p "\n") nil (newline) (forward-line -1)) (markdown-ensure-blank-line-before) (indent-to indent) (insert "```" gfm-open-brace lang gfm-close-brace) (markdown-syntax-propertize-fenced-block-constructs (point-at-bol) end)) (let ((indent (current-indentation)) start-bol) (delete-horizontal-space :backward-only) (markdown-ensure-blank-line-before) (indent-to indent) (setq start-bol (point-at-bol)) (insert "```" gfm-open-brace lang gfm-close-brace "\n") (indent-to indent) (if edit nil (insert 10)) (indent-to indent) (insert "```") (markdown-ensure-blank-line-after) (markdown-syntax-propertize-fenced-block-constructs start-bol (point))) (end-of-line 0) (if edit (progn (markdown-edit-code-block))))
  (let ((gfm-open-brace (if markdown-code-block-braces "{" "")) (gfm-close-brace (if markdown-code-block-braces "}" ""))) (if (use-region-p) (let* ((b (region-beginning)) (e (region-end)) end (indent (progn (goto-char b) (current-indentation)))) (goto-char e) (if (looking-back "\n" nil) nil (newline)) (indent-to indent) (insert "```") (markdown-ensure-blank-line-after) (setq end (point)) (goto-char b) (if (looking-at-p "\n") nil (newline) (forward-line -1)) (markdown-ensure-blank-line-before) (indent-to indent) (insert "```" gfm-open-brace lang gfm-close-brace) (markdown-syntax-propertize-fenced-block-constructs (point-at-bol) end)) (let ((indent (current-indentation)) start-bol) (delete-horizontal-space :backward-only) (markdown-ensure-blank-line-before) (indent-to indent) (setq start-bol (point-at-bol)) (insert "```" gfm-open-brace lang gfm-close-brace "\n") (indent-to indent) (if edit nil (insert 10)) (indent-to indent) (insert "```") (markdown-ensure-blank-line-after) (markdown-syntax-propertize-fenced-block-constructs start-bol (point))) (end-of-line 0) (if edit (progn (markdown-edit-code-block)))))
  markdown-insert-gfm-code-block("" nil)
  funcall-interactively(markdown-insert-gfm-code-block "" nil)
  call-interactively(markdown-insert-gfm-code-block)
  (progn (replace-match "") (call-interactively (function markdown-insert-gfm-code-block)))
  (if (and markdown-gfm-use-electric-backquote (looking-back "^```" nil)) (progn (replace-match "") (call-interactively (function markdown-insert-gfm-code-block))))
  markdown-electric-backquote(nil)
  funcall-interactively(markdown-electric-backquote nil)
  call-interactively(markdown-electric-backquote nil nil)
  command-execute(markdown-electric-backquote)
Software Versions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4