From: David G. <go...@py...> - 2015-08-12 14:37:06
|
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 <Fra...@lo...> 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 > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-users > > Please use "Reply All" to reply to the list. |