Re: Replace with citation not as expected

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=JE7MAbAd4TUBWBfpYAn7fXUFq4Aui-0-yT4NhiFsHayw@mail.gmail.com>
In your example, try adding an underscore after the citation in the
substitution definition. Replace:

.. |CIT2002_STYLE| replace:: mystyle [CIT2002]

with:

.. |CIT2002_STYLE| replace:: mystyle [CIT2002]_

Without the trailing underscore, it's just bracketed text. The output
in the example looks right to me, based on the input.

DG


On Wed, Aug 12, 2015 at 7:31 AM, Françoise Pinsard
<[email protected]> wrote:
>
> Hi
>
> Python 2.7.10 :: Anaconda 2.3.0 (x86_64)
> rst2html.py (Docutils 0.12 [release], Python 2.7.10, on darwin)
>
> Here an example to illustrate something strange when I put a citation
> in a replace ...
>
> tp.rst :
>
> Citation references, like [CIT2002]_.
>
> Another one |CIT2002_STYLE|.
>
> .. [CIT2002] Author. 2002.
>
> .. |CIT2002_STYLE| replace:: mystyle [CIT2002]
>
> rst2html produce (div class document content) ::
>
>  <p>Citation references, like <a class="citation-reference"
> href="#cit2002" id="id1">[CIT2002]</a>.</p>
>  <p>Another one mystyle [CIT2002].</p>
>  <table class="docutils citation" frame="void" id="cit2002" rules="none">
>  <colgroup><col class="label" /><col /></colgroup>
>  <tbody valign="top">
>  <tr><td class="label"><a class="fn-backref"
> href="#id1">[CIT2002]</a></td><td>Author. 2002.</td></tr>
>
> while I expected ::
>
>  <p>Citation references, like <a class="citation-reference"
> href="#cit2002" id="id1">[CIT2002]</a>.</p>
>  <p>Another one mystyle <a class="citation-reference" href="#cit2002"
> id="id1">[CIT2002]</a>.</p>
>
> this problem was initially and indirectly raised using sphinxcontrib-bitex
> see
> https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/84
>
> Regards
>
>
> --
> Françoise
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Docutils-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/docutils-users
>
> Please use "Reply All" to reply to the list.

------------------------------------------------------------------------------
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.