GNU bug report logs - #50861
Bug in kexport:html

Previous Next

Package: hyperbole;

Reported by: Hugo Thunnissen <devel <at> hugot.nl>

Date: Tue, 28 Sep 2021 00:13:01 UTC

Severity: normal

Done: Hugo Thunnissen <devel <at> hugot.nl>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50861 in the body.
You can then email your comments to 50861 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-hyperbole <at> gnu.org:
bug#50861; Package hyperbole. (Tue, 28 Sep 2021 00:13:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hugo Thunnissen <devel <at> hugot.nl>:
New bug report received and forwarded. Copy sent to bug-hyperbole <at> gnu.org. (Tue, 28 Sep 2021 00:13:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hugo Thunnissen <devel <at> hugot.nl>
To: bug-hyperbole <at> gnu.org
Subject: Bug in kexport:html
Date: Tue, 28 Sep 2021 01:20:25 +0200
Hi there,

I am using hyperbole version 7.1.3.
On GNU Emacs 27.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.25)

When exporting a kotl-mode file using `kexport:html' I encountered a
problem with the regex that is used to replace klinks with a HTML anchor
tag. The problem seemed to stem from the use of the \\0 back
reference. 

Relevant part of the backtrace:

    Debugger entered--Lisp error: (error "Invalid use of ‘\\’ in replacement text")
    replace-match("<A HREF=\"#k\\1\">\\0</A>" nil nil "&lt;@ 5a&gt;" nil)


I was able to fix the problem with the following code:
    
    (eval-after-load 'kotl-mode
      (let ((klink-replacement
             (cons (format "&lt;\\s-*@\\s-*\\(%s\\)[^=&>]*&gt;"
    		               kexport:kcell-partial-reference-regexp)
    	           "<A HREF=\"#k\\1\">\\1</A>")))
        (setf (alist-get (car klink-replacement) kexport:html-replacement-alist nil nil 'string=)
              (cdr klink-replacement))))
    
which essentially just replaces the \0 reference in the replacement
text with a \1 reference. I can't find documentation of a \0
back-reference in the elisp regexp manual, as the \N references are
1-based according to it
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html). Is
there something I'm missing?

If there is something I can do to help or give you more information, let
me know.

-Hugo




Information forwarded to bug-hyperbole <at> gnu.org:
bug#50861; Package hyperbole. (Wed, 29 Sep 2021 12:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 50861 <at> debbugs.gnu.org (full text, mbox):

From: Robert Weiner <rswgnu <at> gmail.com>
To: Hugo Thunnissen <devel <at> hugot.nl>
Cc: 50861 <at> debbugs.gnu.org
Subject: Re: bug#50861: Bug in kexport:html
Date: Wed, 29 Sep 2021 08:41:12 -0400
Yes, this has been fixed in the pre-releases available from the Hyperbole git repo, master branch.  Please close the issue when you have a chance.  — Bob

-- Bob

> On Sep 27, 2021, at 9:11 PM, Hugo Thunnissen <devel <at> hugot.nl> wrote:
> 
> 
> Hi there,
> 
> I am using hyperbole version 7.1.3.
> On GNU Emacs 27.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.25)
> 
> When exporting a kotl-mode file using `kexport:html' I encountered a
> problem with the regex that is used to replace klinks with a HTML anchor
> tag. The problem seemed to stem from the use of the \\0 back
> reference. 
> 
> Relevant part of the backtrace:
> 
>    Debugger entered--Lisp error: (error "Invalid use of ‘\\’ in replacement text")
>    replace-match("<A HREF=\"#k\\1\">\\0</A>" nil nil "&lt;@ 5a&gt;" nil)
> 
> 
> I was able to fix the problem with the following code:
> 
>    (eval-after-load 'kotl-mode
>      (let ((klink-replacement
>             (cons (format "&lt;\\s-*@\\s-*\\(%s\\)[^=&>]*&gt;"
>                           kexport:kcell-partial-reference-regexp)
>                   "<A HREF=\"#k\\1\">\\1</A>")))
>        (setf (alist-get (car klink-replacement) kexport:html-replacement-alist nil nil 'string=)
>              (cdr klink-replacement))))
> 
> which essentially just replaces the \0 reference in the replacement
> text with a \1 reference. I can't find documentation of a \0
> back-reference in the elisp regexp manual, as the \N references are
> 1-based according to it
> (https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html). Is
> there something I'm missing?
> 
> If there is something I can do to help or give you more information, let
> me know.
> 
> -Hugo
> 
> 
> 
> _______________________________________________
> Bug-hyperbole mailing list
> Bug-hyperbole <at> gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-hyperbole




Reply sent to Hugo Thunnissen <devel <at> hugot.nl>:
You have taken responsibility. (Wed, 29 Sep 2021 19:11:02 GMT) Full text and rfc822 format available.

Notification sent to Hugo Thunnissen <devel <at> hugot.nl>:
bug acknowledged by developer. (Wed, 29 Sep 2021 19:11:02 GMT) Full text and rfc822 format available.

Message #13 received at 50861-done <at> debbugs.gnu.org (full text, mbox):

From: Hugo Thunnissen <devel <at> hugot.nl>
To: 50861-done <at> debbugs.gnu.org
Subject: Re: bug#50861: Bug in kexport:html
Date: Wed, 29 Sep 2021 21:10:15 +0200
Closed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 28 Oct 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.