emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-contrib 2380ff9985: lisp/ox-confluence.el: escape brac


From: ELPA Syncer
Subject: [nongnu] elpa/org-contrib 2380ff9985: lisp/ox-confluence.el: escape braces in org-confluence-code/verbatim
Date: Wed, 19 Jul 2023 04:01:50 -0400 (EDT)

branch: elpa/org-contrib
commit 2380ff9985d3a21aa7746e3e9d1b96a437c748ce
Author: Lungang Fang <lungang.fang@gmail.com>
Commit: Bastien Guerry <bzg@gnu.org>

    lisp/ox-confluence.el: escape braces in org-confluence-code/verbatim
    
    In ={hello} world= and ~hi {0} {1} {2}~, "{hello}" and "{0}" etc. are 
expected
    to be exported verbatim. However, currently they are exported to "{{{hello}
    world}}" and "{{hi {0} {1} {2}}}" respectively. As a result, "{hello}", 
"{0}"
    etc. are treated by confluence wiki as macros and hence cause errors like
    "Unknown macro: {hello}".
    
    This fix is to escape the openning curly braces, i.e. adding a back slash 
before
    them. The results are "{{\{hello} world}}" and "{{hi \{0} \{1} \{2}}}".
---
 lisp/ox-confluence.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-confluence.el b/lisp/ox-confluence.el
index 127a6c5183..52b0102b17 100644
--- a/lisp/ox-confluence.el
+++ b/lisp/ox-confluence.el
@@ -108,10 +108,12 @@
    (org-trim (org-element-property :value fixed-width))))
 
 (defun org-confluence-verbatim (verbatim contents info)
-  (format "\{\{%s\}\}" (org-element-property :value verbatim)))
+  (let ((content (org-element-property :value verbatim)))
+    (format "\{\{%s\}\}" (string-replace "{" "\\{" content))))
 
 (defun org-confluence-code (code contents info)
-  (format "\{\{%s\}\}" (org-element-property :value code)))
+  (let ((content (org-element-property :value code)))
+    (format "\{\{%s\}\}" (string-replace "{" "\\{" content))))
 
 (defun org-confluence-headline (headline contents info)
   (let* ((low-level-rank (org-export-low-level-p headline info))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]