[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark d7ae7158bd 48/67: fix(adjust-position) newli
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark d7ae7158bd 48/67: fix(adjust-position) newline char prevent string match |
Date: |
Sat, 22 Jul 2023 06:59:03 -0400 (EDT) |
branch: externals/org-remark
commit d7ae7158bdc7d2ce93e85a5f1c8d7878215a1953
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix(adjust-position) newline char prevent string match
Cater to the case when the text is divided by a newline character \n.
Remove all spaces and newline chars before comparing the strings.
When the highlighted text is long and include a newline, it's not
easy (possilbe?) to determine it should be replaced with a space or no
space. Eliminate the ambiguity by removing all spaces and newline chars.
---
org-remark.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index f487493bee..9ccd25a513 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/nobiot/org-remark
;; Version: 1.1.0
;; Created: 22 December 2020
-;; Last modified: 11 July 2023
+;; Last modified: 12 July 2023
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
@@ -1074,12 +1074,15 @@ It searches for TEXT, which should be the original text
of the highlight."
;; if you change it, this will bring it back to the "original".
(let* ((beg (overlay-start highlight))
(end (overlay-end highlight))
- (paragraph-beg)(paragraph-end)
- ;; Cater to the case when the text is divided by a \n
- ;; The regexp must look for space or \n
- (text (replace-regexp-in-string " " "\[ \n\]" text)))
+ (paragraph-beg)(paragraph-end))
(org-with-wide-buffer
- (unless (string= (buffer-substring beg end) text)
+ (unless (string=
+ ;; Cater to the case when the text is divided by a newline
+ ;; character \n. Remove all spaces and newline chars
+ ;; before comparing the strings.
+ (replace-regexp-in-string "[\n ]" ""
+ (buffer-substring beg end))
+ (replace-regexp-in-string "[\n ]" "" text))
;; Look at one paragraph ahead as it is possible that the
;; position has been displaced across a paragraph
(goto-char beg) (backward-paragraph 2) (setq paragraph-beg (point))
- [elpa] externals/org-remark c38f46e806 42/67: refactor(highlight-add): remove spurflous/obsolete elements, (continued)
- [elpa] externals/org-remark c38f46e806 42/67: refactor(highlight-add): remove spurflous/obsolete elements, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark b94c64e381 45/67: feature: Make icons customizable, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark f1ea78bcf1 47/67: refactor: highlight-add, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark f21ab48aad 62/67: refactor: simple name replace org-remark-get-epub-source, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 160de610f8 64/67: fix: make sure new top-level headline is appended, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark fea8103b9b 65/67: fix(legacy): compilation warning #66, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 32149d5135 25/67: fix: Exclude pdfs from default file type #57, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 14996bc1ce 30/67: refactor: notes-set-properties & new-headline, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 356c87468a 31/67: feature(nov) find-source and link correctly (WIP), ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 0d4902f9eb 43/67: docs: flymake, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark d7ae7158bd 48/67: fix(adjust-position) newline char prevent string match,
ELPA Syncer <=
- [elpa] externals/org-remark 4900be37ba 57/67: docs: Fix erroneous newline, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 498354ace4 67/67: docs: README with configuration for nov.el, ELPA Syncer, 2023/07/22