Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add {noformat} to parser #46

Open
d-miketa opened this issue Feb 20, 2022 · 2 comments
Open

Add {noformat} to parser #46

d-miketa opened this issue Feb 20, 2022 · 2 comments

Comments

@d-miketa
Copy link

Hi and thanks for all your work on this plugin!

One small and easily fixable bug I've noticed is the lack of treatment of {noformat} (https://jira.atlassian.com/browse/CONFCLOUD-68503) in text fields. In the meantime I've fixed it on my end with

(push
   '("^{noformat}\\(.*\\(?:
.*\\)*?\\)?
?{noformat}"
    . (lambda ()
        (let ((body (match-string 1))
              (md (match-data)))
          (prog1
              (concat
               "#+BEGIN_SRC\n"
               (replace-regexp-in-string "^" "  " body)
               "\n#+END_SRC")

            ;; Auto-detecting language alters match data, restore it.
            (set-match-data md)))))
   ejira-parser-patterns)

which is just a straightforward adaptation of your existing code for {quote} blocks.

@nyyManni
Copy link
Owner

Hi and thanks for the feedback!

Handling {noformat} is indeed missing from the current parser. However, it might not be the best option to map it into a #+BEGIN_SRC -block, since if one wants to modify the description via the org-file and push the changes back to JIRA, those {noformat}-blocks will permanently become {code}-blocks.

Some other block from org-mode could be used with {noformat} instead, though.

@d-miketa
Copy link
Author

Ah, I see, and that did not occur to me. I’ve swapped to BEGIN_EXAMPLE for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants