gptel: Improve Org stream conversion

* gptel.el (gptel--convert-markdown->org,
gptel--stream-convert-markdown->org): Don't touch underscores in
the source markdown.  This will turn some emphasis blocks into
underlines in Org, but we can live with that.  Fix #40.
This commit is contained in:
Karthik Chikmagalur 2024-01-28 14:34:55 -08:00
parent c41a53f526
commit 10f57605ce

View file

@ -1212,7 +1212,7 @@ elements."
((looking-back "\\(?:[[:word:]]\\|\s\\)\\*\\{2\\}"
(max (- (point) 3) (point-min)))
(backward-delete-char 1))))
((or "_" "*")
("*"
(if (save-match-data
(and (looking-back "\\(?:[[:space:]]\\|\s\\)\\(?:_\\|\\*\\)"
(max (- (point) 2) (point-min)))
@ -1277,7 +1277,7 @@ text stream."
((looking-back "\\(?:[[:word:]]\\|\s\\)\\*\\{2\\}"
(max (- (point) 3) (point-min)))
(backward-delete-char 1))))
((and (or "_" "*") (guard (not in-src-block)))
((and "*" (guard (not in-src-block)))
(when (save-match-data
(save-excursion
(backward-char 2)