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

Links in italic wrongly converted from Dokuwiki to reStructuredText #8182

Closed
dbitouze opened this issue Jul 13, 2022 · 1 comment
Closed
Labels

Comments

@dbitouze
Copy link

Explain the problem.

This is about links in italic when converting from Dokuwiki. As shown below, when converting:

  • to (e.g.) Org-mode, no problem;
    $ echo -e "The following //text and [[https://pandoc.org/|link]] are in italic in Dokuwiki//. Isn't it?" | pandoc -f dokuwiki -t org
    The following /text and [[https://pandoc.org/][link]] are in italic in Dokuwiki/. Isn't it?
    
  • to reStructuredText, the syntax is wrong since the italic marks are not separated from the previous and following words:
    $ echo -e "The following //text and [[https://pandoc.org/|link]] are in italic in Dokuwiki//. Isn't it?" | pandoc -f dokuwiki -t rst 
    The following *text and*\ `link <https://pandoc.org/>`__\ *are in italic in Dokuwiki*. Isn't it?
    
    and the \ after and before them, if inserted in order to add spaces, haven't any effect. Indeed, here is how the previous is converted with docutils' rst2html:
    <p>The following <em>text and</em><a class="reference external" href="https://pandoc.org/">link</a><em>are in italic in    Dokuwiki.</em> Isn't it?</p>
    

Pandoc version?

  • pandoc: v2.18
  • OS: Linux Mageia 8
@dbitouze dbitouze added the bug label Jul 13, 2022
@dbitouze
Copy link
Author

dbitouze commented Jul 14, 2022

More precisely:

  1. The current conversion provided by pandoc:
    The following *text and*\ `link <https://pandoc.org/>`__\ *are in italic in Dokuwiki*. Isn't it?
    is wrong since it would result in the html code (with rst2html and probably Sphinx-doc):
    <p>The following <em>text and</em><a class="reference external" href="https://pandoc.org/">link</a><em>are in italic in Dokuwiki</em>. Isn't it?</p>
    (missing spaces).
  2. A better conversion would be:
    The following *text and* `link <https://pandoc.org/>`__ *are in italic in Dokuwiki*. Isn't it?"
    (backslashes removed) since it would result in the html code (with rst2html and probably Sphinx-doc):
    <p>The following <em>text and</em> <a class="reference external" href="https://pandoc.org/">link</a> <em>are in italic in Dokuwiki</em>. Isn't it?</p>
    But that wouldn't be perfect since the link isn't in italic.
  3. Unfortunately, the expected conversion:
    The following *text and `link <https://pandoc.org/>`__ are in italic in Dokuwiki*. Isn't it?"
    would be wrong since it would result in the html code (with rst2html and probably Sphinx-doc):
    <p>The following <em>text and `link &lt;https://pandoc.org/&gt;`__ are in italic in Dokuwiki</em>. Isn't it?</p>
    instead of:
    <p>The following <em>text and <a class="reference external" href="https://pandoc.org/">link</a> are in italic in Dokuwiki</em>. Isn't it?</p>
    and, unfortunately, it seems there is nothing to do, at least currently.

Hence, probably the second conversion would be the least bad one.

@jgm jgm closed this as completed in 98fb852 Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant